Skip to content

Commit 685d0a5

Browse files
authored
Merge pull request #535 from jyn514/linux-outlined-atomics
2 parents 417a45a + 7ffddb3 commit 685d0a5

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed
File renamed without changes.

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ pub mod mem;
5858
#[cfg(target_arch = "arm")]
5959
pub mod arm;
6060

61-
#[cfg(all(target_arch = "aarch64", not(feature = "no-asm"),))]
62-
pub mod aarch64;
61+
#[cfg(all(target_arch = "aarch64", target_os = "linux", not(feature = "no-asm"),))]
62+
pub mod aarch64_linux;
6363

6464
#[cfg(all(
6565
kernel_user_helpers,

testcrate/tests/lse.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ mod cas {
1717
testcrate::fuzz_2(10000, |expected: super::int_ty!($bytes), new| {
1818
let mut target = expected.wrapping_add(10);
1919
assert_eq!(
20-
unsafe { compiler_builtins::aarch64::$name::$name(expected, new, &mut target) },
20+
unsafe {
21+
compiler_builtins::aarch64_linux::$name::$name(expected, new, &mut target)
22+
},
2123
expected.wrapping_add(10),
2224
"return value should always be the previous value",
2325
);
@@ -29,7 +31,9 @@ mod cas {
2931

3032
target = expected;
3133
assert_eq!(
32-
unsafe { compiler_builtins::aarch64::$name::$name(expected, new, &mut target) },
34+
unsafe {
35+
compiler_builtins::aarch64_linux::$name::$name(expected, new, &mut target)
36+
},
3337
expected
3438
);
3539
assert_eq!(target, new, "should have updated target");
@@ -49,7 +53,7 @@ mod swap {
4953
testcrate::fuzz_2(10000, |left: super::int_ty!($bytes), mut right| {
5054
let orig_right = right;
5155
assert_eq!(
52-
unsafe { compiler_builtins::aarch64::$name::$name(left, &mut right) },
56+
unsafe { compiler_builtins::aarch64_linux::$name::$name(left, &mut right) },
5357
orig_right
5458
);
5559
assert_eq!(left, right);
@@ -69,7 +73,7 @@ macro_rules! test_op {
6973
let mut target = old;
7074
let op: fn(super::int_ty!($bytes), super::int_ty!($bytes)) -> _ = $($op)*;
7175
let expected = op(old, val);
72-
assert_eq!(old, unsafe { compiler_builtins::aarch64::$name::$name(val, &mut target) }, "{} should return original value", stringify!($name));
76+
assert_eq!(old, unsafe { compiler_builtins::aarch64_linux::$name::$name(val, &mut target) }, "{} should return original value", stringify!($name));
7377
assert_eq!(expected, target, "{} should store to target", stringify!($name));
7478
});
7579
}

0 commit comments

Comments
 (0)