Skip to content

Commit 5a7aa03

Browse files
committed
Revert "Use asm-based atomic load/store on thumbv6m"
This reverts commit a864da7. rust-lang/rust#99595 has been reverted, so this is no longer needed.
1 parent fc94f2a commit 5a7aa03

File tree

8 files changed

+5
-332
lines changed

8 files changed

+5
-332
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Portable atomic types including support for 128-bit atomics, atomic float, etc.
1313
- Provide `AtomicI128` and `AtomicU128`.
1414
- Provide `AtomicF32` and `AtomicF64`. (optional)
1515
<!-- - Provide generic `Atomic<T>` type. (optional) -->
16-
- Provide atomic load/store for targets where atomic is not available at all in the standard library. (thumbv6m, riscv without A-extension, msp430, avr)
16+
- Provide atomic load/store for targets where atomic is not available at all in the standard library. (riscv without A-extension, msp430, avr)
1717
- Provide atomic CAS for targets where atomic CAS is not available in the standard library. (thumbv6m, riscv without A-extension, msp430, avr) (optional, [single-core only](#optional-cfg))
1818
- Make features that require newer compilers, such as [fetch_max](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_max), [fetch_min](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_min), [fetch_update](https://doc.rust-lang.org/nightly/std/sync/atomic/struct.AtomicPtr.html#method.fetch_update), and [stronger CAS failure ordering](https://github.com/rust-lang/rust/pull/98383) available on Rust 1.34+.
1919

no_atomic.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,4 @@ const NO_ATOMIC: &[&str] = &[
6969
"riscv32i-unknown-none-elf",
7070
"riscv32im-unknown-none-elf",
7171
"riscv32imc-unknown-none-elf",
72-
"thumbv6m-none-eabi",
7372
];

src/imp/arm.rs

Lines changed: 0 additions & 288 deletions
This file was deleted.

src/imp/interrupt/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
// CAS together with atomic load/store. The load/store will not be
1717
// called while interrupts are disabled, and since the load/store is
1818
// atomic, it is not affected by interrupts even if interrupts are enabled.
19-
#[cfg(portable_atomic_armv6m)]
20-
use super::arm as atomic;
2119
#[cfg(target_arch = "msp430")]
2220
use super::msp430 as atomic;
2321
#[cfg(any(target_arch = "riscv32", target_arch = "riscv64"))]
2422
use super::riscv as atomic;
23+
#[cfg(target_arch = "arm")]
24+
use core::sync::atomic;
2525

2626
#[cfg_attr(portable_atomic_armv6m, path = "armv6m.rs")]
2727
#[cfg_attr(target_arch = "avr", path = "avr.rs")]

src/imp/mod.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@ mod s390x;
3939
#[cfg(target_arch = "msp430")]
4040
mod msp430;
4141

42-
#[cfg(any(not(portable_atomic_no_asm), portable_atomic_nightly))]
43-
#[cfg(portable_atomic_armv6m)]
44-
mod arm;
45-
#[cfg(not(any(not(portable_atomic_no_asm), portable_atomic_nightly)))]
46-
#[cfg(portable_atomic_armv6m)]
47-
#[path = "core_atomic.rs"]
48-
mod arm;
49-
5042
#[cfg_attr(portable_atomic_no_cfg_target_has_atomic, cfg(any(test, portable_atomic_no_atomic_cas)))]
5143
#[cfg_attr(
5244
not(portable_atomic_no_cfg_target_has_atomic),
@@ -132,12 +124,6 @@ mod interrupt;
132124
pub(crate) use self::core_atomic::{
133125
AtomicBool, AtomicI16, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16, AtomicU8, AtomicUsize,
134126
};
135-
// armv6m
136-
#[cfg(not(portable_atomic_unsafe_assume_single_core))]
137-
#[cfg(portable_atomic_armv6m)]
138-
pub(crate) use self::arm::{
139-
AtomicBool, AtomicI16, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16, AtomicU8, AtomicUsize,
140-
};
141127
// msp430
142128
#[cfg(not(portable_atomic_unsafe_assume_single_core))]
143129
#[cfg(target_arch = "msp430")]
@@ -189,10 +175,6 @@ pub(crate) use self::interrupt::{
189175
))
190176
)]
191177
pub(crate) use self::core_atomic::{AtomicI32, AtomicU32};
192-
// armv6m
193-
#[cfg(not(portable_atomic_unsafe_assume_single_core))]
194-
#[cfg(portable_atomic_armv6m)]
195-
pub(crate) use self::arm::{AtomicI32, AtomicU32};
196178
// riscv32 without A-extension
197179
#[cfg(not(portable_atomic_unsafe_assume_single_core))]
198180
#[cfg(target_arch = "riscv32")]

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Portable atomic types including support for 128-bit atomics, atomic float, etc.
55
- Provide `AtomicI128` and `AtomicU128`.
66
- Provide `AtomicF32` and `AtomicF64`. (optional)
77
<!-- - Provide generic `Atomic<T>` type. (optional) -->
8-
- Provide atomic load/store for targets where atomic is not available at all in the standard library. (thumbv6m, riscv without A-extension, msp430, avr)
8+
- Provide atomic load/store for targets where atomic is not available at all in the standard library. (riscv without A-extension, msp430, avr)
99
- Provide atomic CAS for targets where atomic CAS is not available in the standard library. (thumbv6m, riscv without A-extension, msp430, avr) (optional, [single-core only](#optional-cfg))
1010
- Make features that require newer compilers, such as [fetch_max](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_max), [fetch_min](https://doc.rust-lang.org/std/sync/atomic/struct.AtomicUsize.html#method.fetch_min), [fetch_update](https://doc.rust-lang.org/nightly/std/sync/atomic/struct.AtomicPtr.html#method.fetch_update), and [stronger CAS failure ordering](https://github.com/rust-lang/rust/pull/98383) available on Rust 1.34+.
1111

target-specs/thumbv6m-none-eabi.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

tools/no_atomic.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ file="no_atomic.rs"
1313

1414
no_atomic_cas=()
1515
no_atomic_64=()
16-
no_atomic=(
17-
"thumbv6m-none-eabi" # https://github.com/rust-lang/rust/pull/99595
18-
)
16+
no_atomic=()
1917
for target in $(rustc --print target-list); do
2018
target_spec=$(rustc --print target-spec-json -Z unstable-options --target "${target}")
2119
res=$(jq <<<"${target_spec}" -r 'select(."atomic-cas" == false)')

0 commit comments

Comments
 (0)