Changeset 71916 in vbox for trunk/src/VBox/Runtime/common
- Timestamp:
- Apr 19, 2018 10:05:28 AM (7 years ago)
- Location:
- trunk/src/VBox/Runtime/common
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/asm/asm-fake.cpp
r71522 r71916 5 5 6 6 /* 7 * Copyright (C) 2010-201 7Oracle Corporation7 * Copyright (C) 2010-2018 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 139 139 } 140 140 141 RTDECL(uint32_t) ASMAtomicUoIncU32(uint32_t volatile *pu32) 142 { 143 return *pu32 += 1; 144 } 145 141 146 RTDECL(uint32_t) ASMAtomicDecU32(uint32_t volatile *pu32) 142 147 { … … 144 149 } 145 150 151 RTDECL(uint32_t) ASMAtomicUoDecU32(uint32_t volatile *pu32) 152 { 153 return *pu32 -= 1; 154 } 155 146 156 RTDECL(uint64_t) ASMAtomicIncU64(uint64_t volatile *pu64) 147 157 { … … 159 169 } 160 170 171 RTDECL(void) ASMAtomicUoOrU32(uint32_t volatile *pu32, uint32_t u32) 172 { 173 *pu32 |= u32; 174 } 175 161 176 RTDECL(void) ASMAtomicAndU32(uint32_t volatile *pu32, uint32_t u32) 177 { 178 *pu32 &= u32; 179 } 180 181 RTDECL(void) ASMAtomicUoAndU32(uint32_t volatile *pu32, uint32_t u32) 162 182 { 163 183 *pu32 &= u32; … … 455 475 uint32_t iBit; 456 476 for (iBit = 0; iBit < 64; iBit++) 477 if (u32 & RT_BIT_64(iBit)) 478 return iBit + 1; 479 return 0; 480 } 481 482 RTDECL(unsigned) ASMBitLastSetU64(uint64_t u64) 483 { 484 int32_t iBit = 64; 485 while (iBit-- > 0) 457 486 if (u64 & RT_BIT_64(iBit)) 458 487 return iBit + 1;
Note:
See TracChangeset
for help on using the changeset viewer.