VirtualBox

Changeset 96090 in vbox for trunk/include/iprt/asm.h


Ignore:
Timestamp:
Aug 7, 2022 2:17:15 AM (2 years ago)
Author:
vboxsync
Message:

iprt/asm.h: Changed ASMBitClearRange and ASMBitSetRange to take the range parameters as size_t rather than in32_t. bugref:10261

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/asm.h

    r95075 r96090  
    68266826 * @param   iBitEnd     The first bit not to clear.
    68276827 */
    6828 DECLINLINE(void) ASMBitClearRange(volatile void RT_FAR *pvBitmap, int32_t iBitStart, int32_t iBitEnd) RT_NOTHROW_DEF
     6828DECLINLINE(void) ASMBitClearRange(volatile void RT_FAR *pvBitmap, size_t iBitStart, size_t iBitEnd) RT_NOTHROW_DEF
    68296829{
    68306830    if (iBitStart < iBitEnd)
    68316831    {
    6832         volatile uint32_t RT_FAR *pu32 = (volatile uint32_t RT_FAR *)pvBitmap + (iBitStart >> 5);
    6833         int32_t iStart = 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;
    68356835        if (iStart == iEnd)
    68366836            *pu32 &= RT_H2LE_U32(((UINT32_C(1) << (iBitStart & 31)) - 1) | ~((UINT32_C(1) << (iBitEnd & 31)) - 1));
     
    68476847            /* whole dwords. */
    68486848            if (iBitStart != iEnd)
    6849                 ASMMemZero32(pu32, ((uint32_t)iEnd - (uint32_t)iBitStart) >> 3);
     6849                ASMMemZero32(pu32, (iEnd - iBitStart) >> 3);
    68506850
    68516851            /* bits in last dword. */
     
    68676867 * @param   iBitEnd     The first bit not to set.
    68686868 */
    6869 DECLINLINE(void) ASMBitSetRange(volatile void RT_FAR *pvBitmap, int32_t iBitStart, int32_t iBitEnd) RT_NOTHROW_DEF
     6869DECLINLINE(void) ASMBitSetRange(volatile void RT_FAR *pvBitmap, size_t iBitStart, size_t iBitEnd) RT_NOTHROW_DEF
    68706870{
    68716871    if (iBitStart < iBitEnd)
    68726872    {
    6873         volatile uint32_t RT_FAR *pu32 = (volatile uint32_t RT_FAR *)pvBitmap + (iBitStart >> 5);
    6874         int32_t iStart = 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;
    68766876        if (iStart == iEnd)
    68776877            *pu32 |= RT_H2LE_U32(((UINT32_C(1) << (iBitEnd - iBitStart)) - 1) << (iBitStart & 31));
     
    68886888            /* whole dword. */
    68896889            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));
    68916891
    68926892            /* bits in last dword. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette