Skip to content

Commit

Permalink
Rollup merge of rust-lang#55450 - japaric:msp430, r=alexcrichton
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kennytm authored Oct 30, 2018
2 parents 62f4316 + f67b4e0 commit 8c85817
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/liballoc/collections/vec_deque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ use vec::Vec;

const INITIAL_CAPACITY: usize = 7; // 2^3 - 1
const MINIMUM_CAPACITY: usize = 1; // 2 - 1
#[cfg(target_pointer_width = "16")]
const MAXIMUM_ZST_CAPACITY: usize = 1 << (16 - 1); // Largest possible power of two
#[cfg(target_pointer_width = "32")]
const MAXIMUM_ZST_CAPACITY: usize = 1 << (32 - 1); // Largest possible power of two
#[cfg(target_pointer_width = "64")]
Expand Down
9 changes: 7 additions & 2 deletions src/librustc_target/spec/msp430_none_elf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ pub fn target() -> TargetResult {
no_integrated_as: true,

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

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

0 comments on commit 8c85817

Please sign in to comment.