Changeset 96090 in vbox for trunk/include/iprt/asm.h
- Timestamp:
- Aug 7, 2022 2:17:15 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/asm.h
r95075 r96090 6826 6826 * @param iBitEnd The first bit not to clear. 6827 6827 */ 6828 DECLINLINE(void) ASMBitClearRange(volatile void RT_FAR *pvBitmap, int32_t iBitStart, int32_t iBitEnd) RT_NOTHROW_DEF6828 DECLINLINE(void) ASMBitClearRange(volatile void RT_FAR *pvBitmap, size_t iBitStart, size_t iBitEnd) RT_NOTHROW_DEF 6829 6829 { 6830 6830 if (iBitStart < iBitEnd) 6831 6831 { 6832 volatile uint32_t RT_FAR *pu32= (volatile uint32_t RT_FAR *)pvBitmap + (iBitStart >> 5);6833 int32_tiStart = iBitStart & ~31;6834 int32_t iEnd = iBitEnd& ~31;6832 uint32_t volatile RT_FAR *pu32 = (volatile uint32_t RT_FAR *)pvBitmap + (iBitStart >> 5); 6833 size_t iStart = iBitStart & ~31; 6834 size_t iEnd = iBitEnd & ~31; 6835 6835 if (iStart == iEnd) 6836 6836 *pu32 &= RT_H2LE_U32(((UINT32_C(1) << (iBitStart & 31)) - 1) | ~((UINT32_C(1) << (iBitEnd & 31)) - 1)); … … 6847 6847 /* whole dwords. */ 6848 6848 if (iBitStart != iEnd) 6849 ASMMemZero32(pu32, ( (uint32_t)iEnd - (uint32_t)iBitStart) >> 3);6849 ASMMemZero32(pu32, (iEnd - iBitStart) >> 3); 6850 6850 6851 6851 /* bits in last dword. */ … … 6867 6867 * @param iBitEnd The first bit not to set. 6868 6868 */ 6869 DECLINLINE(void) ASMBitSetRange(volatile void RT_FAR *pvBitmap, int32_t iBitStart, int32_t iBitEnd) RT_NOTHROW_DEF6869 DECLINLINE(void) ASMBitSetRange(volatile void RT_FAR *pvBitmap, size_t iBitStart, size_t iBitEnd) RT_NOTHROW_DEF 6870 6870 { 6871 6871 if (iBitStart < iBitEnd) 6872 6872 { 6873 volatile uint32_t RT_FAR *pu32= (volatile uint32_t RT_FAR *)pvBitmap + (iBitStart >> 5);6874 int32_tiStart = iBitStart & ~31;6875 int32_t iEnd = iBitEnd& ~31;6873 uint32_t volatile RT_FAR *pu32 = (volatile uint32_t RT_FAR *)pvBitmap + (iBitStart >> 5); 6874 size_t iStart = iBitStart & ~31; 6875 size_t iEnd = iBitEnd & ~31; 6876 6876 if (iStart == iEnd) 6877 6877 *pu32 |= RT_H2LE_U32(((UINT32_C(1) << (iBitEnd - iBitStart)) - 1) << (iBitStart & 31)); … … 6888 6888 /* whole dword. */ 6889 6889 if (iBitStart != iEnd) 6890 ASMMemFill32(pu32, ( (uint32_t)iEnd - (uint32_t)iBitStart) >> 3, ~UINT32_C(0));6890 ASMMemFill32(pu32, (iEnd - iBitStart) >> 3, ~UINT32_C(0)); 6891 6891 6892 6892 /* bits in last dword. */
Note:
See TracChangeset
for help on using the changeset viewer.