Skip to content

Commit 3a9ba44

Browse files
committed
Auto merge of #219 - Amanieu:sync_val_compare_and_swap, r=alexcrichton
Fix argument order for __sync_val_compare_and_swap Fixes rust-lang/rust#46822 (comment)
2 parents 000d06a + e8ea848 commit 3a9ba44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/arm_linux.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ unsafe fn atomic_rmw<T, F: Fn(u32) -> u32>(ptr: *mut T, f: F) -> u32 {
7171
}
7272

7373
// Generic atomic compare-exchange operation
74-
unsafe fn atomic_cmpxchg<T>(oldval: u32, newval: u32, ptr: *mut T) -> u32 {
74+
unsafe fn atomic_cmpxchg<T>(ptr: *mut T, oldval: u32, newval: u32) -> u32 {
7575
let aligned_ptr = align_ptr(ptr);
7676
let (shift, mask) = get_shift_mask(ptr);
7777

@@ -99,8 +99,8 @@ macro_rules! atomic_rmw {
9999
macro_rules! atomic_cmpxchg {
100100
($name:ident, $ty:ty) => {
101101
#[cfg_attr(not(feature = "mangled-names"), no_mangle)]
102-
pub unsafe extern "C" fn $name(oldval: $ty, newval: $ty, ptr: *mut $ty) -> $ty {
103-
atomic_cmpxchg(oldval as u32, newval as u32, ptr) as $ty
102+
pub unsafe extern "C" fn $name(ptr: *mut $ty, oldval: $ty, newval: $ty) -> $ty {
103+
atomic_cmpxchg(ptr, oldval as u32, newval as u32) as $ty
104104
}
105105
}
106106
}

0 commit comments

Comments
 (0)