]> git.saurik.com Git - apple/xnu.git/blobdiff - libkern/gen/OSAtomicOperations.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / libkern / gen / OSAtomicOperations.c
index 8408c83a43b4db0395f926c0b4c3e41b2d3d1be7..ba66fc09be04218f175626d844c48b811d3ca17b 100644 (file)
@@ -59,14 +59,14 @@ enum {
 Boolean
 OSCompareAndSwap8(UInt8 oldValue, UInt8 newValue, volatile UInt8 *address)
 {
-       return os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
+       return (Boolean)os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
 }
 
 #undef OSCompareAndSwap16
 Boolean
 OSCompareAndSwap16(UInt16 oldValue, UInt16 newValue, volatile UInt16 *address)
 {
-       return os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
+       return (Boolean)os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
 }
 
 #undef OSCompareAndSwap
@@ -74,7 +74,7 @@ Boolean
 OSCompareAndSwap(UInt32 oldValue, UInt32 newValue, volatile UInt32 *address)
 {
        ALIGN_TEST(address, UInt32);
-       return os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
+       return (Boolean)os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
 }
 
 #undef OSCompareAndSwap64
@@ -89,26 +89,26 @@ OSCompareAndSwap64(UInt64 oldValue, UInt64 newValue, volatile UInt64 *address)
        _Atomic UInt64 *aligned_addr = (_Atomic UInt64 *)(uintptr_t)address;
 
        ALIGN_TEST(address, UInt64);
-       return os_atomic_cmpxchg(aligned_addr, oldValue, newValue, acq_rel);
+       return (Boolean)os_atomic_cmpxchg(aligned_addr, oldValue, newValue, acq_rel);
 }
 
 #undef OSCompareAndSwapPtr
 Boolean
 OSCompareAndSwapPtr(void *oldValue, void *newValue, void * volatile *address)
 {
-       return os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
+       return (Boolean)os_atomic_cmpxchg(address, oldValue, newValue, acq_rel);
 }
 
 SInt8
 OSAddAtomic8(SInt32 amount, volatile SInt8 *address)
 {
-       return os_atomic_add_orig(address, amount, relaxed);
+       return os_atomic_add_orig(address, (SInt8)amount, relaxed);
 }
 
 SInt16
 OSAddAtomic16(SInt32 amount, volatile SInt16 *address)
 {
-       return os_atomic_add_orig(address, amount, relaxed);
+       return os_atomic_add_orig(address, (SInt16)amount, relaxed);
 }
 
 #undef OSAddAtomic
@@ -222,19 +222,19 @@ OSDecrementAtomic8(volatile SInt8 * value)
 UInt8
 OSBitAndAtomic8(UInt32 mask, volatile UInt8 * value)
 {
-       return os_atomic_and_orig(value, mask, relaxed);
+       return os_atomic_and_orig(value, (UInt8)mask, relaxed);
 }
 
 UInt8
 OSBitOrAtomic8(UInt32 mask, volatile UInt8 * value)
 {
-       return os_atomic_or_orig(value, mask, relaxed);
+       return os_atomic_or_orig(value, (UInt8)mask, relaxed);
 }
 
 UInt8
 OSBitXorAtomic8(UInt32 mask, volatile UInt8 * value)
 {
-       return os_atomic_xor_orig(value, mask, relaxed);
+       return os_atomic_xor_orig(value, (UInt8)mask, relaxed);
 }
 
 SInt16
@@ -252,17 +252,17 @@ OSDecrementAtomic16(volatile SInt16 * value)
 UInt16
 OSBitAndAtomic16(UInt32 mask, volatile UInt16 * value)
 {
-       return os_atomic_and_orig(value, mask, relaxed);
+       return os_atomic_and_orig(value, (UInt16)mask, relaxed);
 }
 
 UInt16
 OSBitOrAtomic16(UInt32 mask, volatile UInt16 * value)
 {
-       return os_atomic_or_orig(value, mask, relaxed);
+       return os_atomic_or_orig(value, (UInt16)mask, relaxed);
 }
 
 UInt16
 OSBitXorAtomic16(UInt32 mask, volatile UInt16 * value)
 {
-       return os_atomic_xor_orig(value, mask, relaxed);
+       return os_atomic_xor_orig(value, (UInt16)mask, relaxed);
 }