Skip to content

Commit bb176aa

Browse files
committed
Add target_arch = "aarch64" and doc configs for each function individually
I thought it would/should have worked to put it on the top of the module then, at least the target_arch one
1 parent 213aaa9 commit bb176aa

File tree

1 file changed

+22
-8
lines changed
  • crates/core_arch/src/arm_shared

1 file changed

+22
-8
lines changed

crates/core_arch/src/arm_shared/ex.rs

+22-8
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
// Not supported: v5, v6-M
66
// NOTE: there's no dedicated CLREX instruction in v6 (<v6k); to clear the exclusive monitor users
77
// have to do a dummy STREX operation
8+
#[cfg(target_feature = "aarch64")]
89
#[cfg(any(
910
all(target_feature = "v6k", not(target_feature = "mclass")), // excludes v6-M
1011
all(target_feature = "v7", target_feature = "mclass"), // v7-M
12+
doc
1113
))]
1214
pub unsafe fn __clrex() {
1315
extern "C" {
@@ -21,9 +23,11 @@ pub unsafe fn __clrex() {
2123
/// Executes a exclusive LDR instruction for 8 bit value.
2224
// Supported: v6K, v7-M, v7-A, v7-R
2325
// Not supported: v5, v6, v6-M
24-
#[cfg(
26+
#[cfg(target_feature = "aarch64")]
27+
#[cfg(any(
2528
target_feature = "v6k", // includes v7-M but excludes v6-M
26-
)]
29+
doc
30+
))]
2731
pub unsafe fn __ldrexb(p: *const u8) -> u8 {
2832
extern "C" {
2933
#[link_name = "llvm.arm.ldrex.p0i8"]
@@ -36,9 +40,11 @@ pub unsafe fn __ldrexb(p: *const u8) -> u8 {
3640
/// Executes a exclusive LDR instruction for 16 bit value.
3741
// Supported: v6K, v7-M, v7-A, v7-R, v8
3842
// Not supported: v5, v6, v6-M
39-
#[cfg(
43+
#[cfg(target_feature = "aarch64")]
44+
#[cfg(any(
4045
target_feature = "v6k", // includes v7-M but excludes v6-M
41-
)]
46+
doc
47+
))]
4248
pub unsafe fn __ldrexh(p: *const u16) -> u16 {
4349
extern "C" {
4450
#[link_name = "llvm.arm.ldrex.p0i16"]
@@ -51,9 +57,11 @@ pub unsafe fn __ldrexh(p: *const u16) -> u16 {
5157
/// Executes a exclusive LDR instruction for 32 bit value.
5258
// Supported: v6, v7-M, v6K, v7-A, v7-R, v8
5359
// Not supported: v5, v6-M
60+
#[cfg(target_feature = "aarch64")]
5461
#[cfg(any(
5562
all(target_feature = "v6", not(target_feature = "mclass")), // excludes v6-M
5663
all(target_feature = "v7", target_feature = "mclass"), // v7-M
64+
doc
5765
))]
5866
pub unsafe fn __ldrex(p: *const u32) -> u32 {
5967
extern "C" {
@@ -69,9 +77,11 @@ pub unsafe fn __ldrex(p: *const u32) -> u32 {
6977
/// Returns `0` if the operation succeeded, or `1` if it failed
7078
// supported: v6K, v7-M, v7-A, v7-R
7179
// Not supported: v5, v6, v6-M
72-
#[cfg(
80+
#[cfg(target_feature = "aarch64")]
81+
#[cfg(any(
7382
target_feature = "v6k", // includes v7-M but excludes v6-M
74-
)]
83+
doc
84+
))]
7585
pub unsafe fn __strexb(value: u32, addr: *mut u8) -> u32 {
7686
extern "C" {
7787
#[link_name = "llvm.arm.strex.p0i8"]
@@ -86,9 +96,11 @@ pub unsafe fn __strexb(value: u32, addr: *mut u8) -> u32 {
8696
/// Returns `0` if the operation succeeded, or `1` if it failed
8797
// Supported: v6K, v7-M, v7-A, v7-R, v8
8898
// Not supported: v5, v6, v6-M
89-
#[cfg(
99+
#[cfg(target_feature = "aarch64")]
100+
#[cfg(any(
90101
target_feature = "v6k", // includes v7-M but excludes v6-M
91-
)]
102+
doc
103+
))]
92104
pub unsafe fn __strexh(value: u16, addr: *mut u16) -> u32 {
93105
extern "C" {
94106
#[link_name = "llvm.arm.strex.p0i16"]
@@ -103,9 +115,11 @@ pub unsafe fn __strexh(value: u16, addr: *mut u16) -> u32 {
103115
/// Returns `0` if the operation succeeded, or `1` if it failed
104116
// Supported: v6, v7-M, v6K, v7-A, v7-R, v8
105117
// Not supported: v5, v6-M
118+
#[cfg(target_feature = "aarch64")]
106119
#[cfg(any(
107120
all(target_feature = "v6", not(target_feature = "mclass")), // excludes v6-M
108121
all(target_feature = "v7", target_feature = "mclass"), // v7-M
122+
doc
109123
))]
110124
pub unsafe fn __strex(value: u32, addr: *mut u32) -> u32 {
111125
extern "C" {

0 commit comments

Comments
 (0)