Skip to content

Commit 8c85817

Browse files
authored
Rollup merge of rust-lang#55450 - japaric:msp430, r=alexcrichton
msp430: remove the whole Atomic* API PR rust-lang#51953 enabled the Atomic*.{load,store} API on MSP430. Unfortunately, the LLVM backend doesn't currently support those atomic operations, so this commit removes the API and leaves instructions on how and when to enable it in the future. the second fixes compiling liballoc for msp430 closes rust-lang#54511 r? @alexcrichton cc @chernomor @awygle @cr1901 @pftbest
2 parents 62f4316 + f67b4e0 commit 8c85817

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/liballoc/collections/vec_deque.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ use vec::Vec;
3636

3737
const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
3838
const MINIMUM_CAPACITY: usize = 1; // 2 - 1
39+
#[cfg(target_pointer_width = "16")]
40+
const MAXIMUM_ZST_CAPACITY: usize = 1 << (16 - 1); // Largest possible power of two
3941
#[cfg(target_pointer_width = "32")]
4042
const MAXIMUM_ZST_CAPACITY: usize = 1 << (32 - 1); // Largest possible power of two
4143
#[cfg(target_pointer_width = "64")]

src/librustc_target/spec/msp430_none_elf.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ pub fn target() -> TargetResult {
3535
no_integrated_as: true,
3636

3737
// There are no atomic CAS instructions available in the MSP430
38-
// instruction set
39-
max_atomic_width: Some(16),
38+
// instruction set, and the LLVM backend doesn't currently support
39+
// compiler fences so the Atomic* API is missing on this target.
40+
// When the LLVM backend gains support for compile fences uncomment
41+
// the `singlethread: true` line and set `max_atomic_width` to
42+
// `Some(16)`.
43+
max_atomic_width: Some(0),
4044
atomic_cas: false,
45+
// singlethread: true,
4146

4247
// Because these devices have very little resources having an
4348
// unwinder is too onerous so we default to "abort" because the

0 commit comments

Comments
 (0)