Changeset 40806 in vbox for trunk/include
- Timestamp:
- Apr 6, 2012 9:05:19 PM (13 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/mangling.h
r40668 r40806 1221 1221 # define RTSortIsSorted RT_MANGLER(RTSortIsSorted) 1222 1222 # define RTSpinlockAcquire RT_MANGLER(RTSpinlockAcquire) 1223 # define RTSpinlockAcquireNoInts RT_MANGLER(RTSpinlockAcquireNoInts)1224 1223 # define RTSpinlockCreate RT_MANGLER(RTSpinlockCreate) 1225 1224 # define RTSpinlockDestroy RT_MANGLER(RTSpinlockDestroy) 1226 1225 # define RTSpinlockRelease RT_MANGLER(RTSpinlockRelease) 1227 # define RTSpinlockReleaseNoInts RT_MANGLER(RTSpinlockReleaseNoInts)1228 1226 # define RTStrAAppendExNVTag RT_MANGLER(RTStrAAppendExNVTag) 1229 1227 # define RTStrAAppendNTag RT_MANGLER(RTStrAAppendNTag) -
trunk/include/iprt/spinlock.h
r28800 r40806 39 39 40 40 /** 41 * Temporary spinlock state variable.42 * All members are undefined and highly platform specific.43 */44 typedef struct RTSPINLOCKTMP45 {46 #ifdef IN_RING047 # ifdef RT_OS_LINUX48 /** The saved [R|E]FLAGS. */49 unsigned long flFlags;50 # define RTSPINLOCKTMP_INITIALIZER { 0 }51 52 # elif defined(RT_OS_WINDOWS)53 /** The saved [R|E]FLAGS. */54 RTCCUINTREG uFlags;55 /** The KIRQL. */56 unsigned char uchIrqL;57 # define RTSPINLOCKTMP_INITIALIZER { 0, 0 }58 59 # elif defined(__L4__)60 /** The saved [R|E]FLAGS. */61 unsigned long flFlags;62 # define RTSPINLOCKTMP_INITIALIZER { 0 }63 64 # elif defined(RT_OS_DARWIN) || defined(RT_OS_FREEBSD) || defined(RT_OS_SOLARIS)65 /** The saved [R|E]FLAGS. */66 RTCCUINTREG uFlags;67 # define RTSPINLOCKTMP_INITIALIZER { 0 }68 69 # elif defined(RT_OS_OS2)70 /** The saved [R|E]FLAGS. (dummy) */71 RTCCUINTREG uFlags;72 # define RTSPINLOCKTMP_INITIALIZER { 0 }73 74 # else75 # error "PORTME\n"76 /** The saved [R|E]FLAGS. */77 RTCCUINTREG uFlags;78 # endif79 80 #else /* !IN_RING0 */81 /** The saved [R|E]FLAGS. (dummy) */82 RTCCUINTREG uFlags;83 # define RTSPINLOCKTMP_INITIALIZER { 0 }84 #endif /* !IN_RING0 */85 } RTSPINLOCKTMP;86 /** Pointer to a temporary spinlock state variable. */87 typedef RTSPINLOCKTMP *PRTSPINLOCKTMP;88 /** Pointer to a const temporary spinlock state variable. */89 typedef const RTSPINLOCKTMP *PCRTSPINLOCKTMP;90 91 /** @def RTSPINLOCKTMP_INITIALIZER92 * What to assign to a RTSPINLOCKTMP at definition.93 */94 #ifdef DOXYGEN_RUNNING95 # define RTSPINLOCKTMP_INITIALIZER96 #endif97 98 99 100 /**101 41 * Creates a spinlock. 102 42 * 103 43 * @returns iprt status code. 104 44 * @param pSpinlock Where to store the spinlock handle. 45 * @param fFlags Creation flags, see RTSPINLOCK_FLAGS_XXX. 46 * @param pszName Spinlock name, for debugging purposes. String lifetime 47 * must be the same as the lock as it won't be copied. 105 48 */ 106 RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock); 49 RTDECL(int) RTSpinlockCreate(PRTSPINLOCK pSpinlock, uint32_t fFlags, const char *pszName); 50 51 /** @name RTSPINLOCK_FLAGS_XXX 52 * @{ */ 53 /** Disable interrupts when taking the spinlock, making it interrupt safe 54 * (sans NMI of course). 55 * 56 * This is generally the safest option, though it isn't really required unless 57 * the data being protect is also accessed from interrupt handler context. */ 58 #define RTSPINLOCK_FLAGS_INTERRUPT_SAFE RT_BIT(1) 59 /** No need to disable interrupts, the protect code/data is not used by 60 * interrupt handlers. */ 61 #define RTSPINLOCK_FLAGS_INTERRUPT_UNSAFE RT_BIT(2) 62 /** @} */ 107 63 108 64 /** … … 116 72 /** 117 73 * Acquires the spinlock. 118 * Interrupts are disabled upon return.119 74 * 120 75 * @param Spinlock The spinlock to acquire. 121 76 * @param pTmp Where to save the state. 122 77 */ 123 RTDECL(void) RTSpinlockAcquire NoInts(RTSPINLOCK Spinlock, PRTSPINLOCKTMP pTmp);78 RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock); 124 79 125 80 /** … … 129 84 * @param pTmp The state to restore. (This better be the same as for the RTSpinlockAcquire() call!) 130 85 */ 131 RTDECL(void) RTSpinlockRelease NoInts(RTSPINLOCK Spinlock, PRTSPINLOCKTMP pTmp);86 RTDECL(void) RTSpinlockRelease(RTSPINLOCK Spinlock); 132 87 133 /** 134 * Acquires the spinlock. 135 * 136 * @param Spinlock The spinlock to acquire. 137 * @param pTmp Where to save the state. 138 */ 139 RTDECL(void) RTSpinlockAcquire(RTSPINLOCK Spinlock, PRTSPINLOCKTMP pTmp); 140 141 /** 142 * Releases the spinlock. 143 * 144 * @param Spinlock The spinlock to acquire. 145 * @param pTmp The state to restore. (This better be the same as for the RTSpinlockAcquire() call!) 146 */ 147 RTDECL(void) RTSpinlockRelease(RTSPINLOCK Spinlock, PRTSPINLOCKTMP pTmp); 88 /* Temporarily, only for checking the spinlock creation flags. */ 89 RTDECL(void) RTSpinlockReleaseNoInts(RTSPINLOCK Spinlock); 148 90 149 91
Note:
See TracChangeset
for help on using the changeset viewer.