Skip to content

Commit 5bc0936

Browse files
authored
Rollup merge of rust-lang#90690 - solid-rs:fix-kmc-solid-asm-const, r=Mark-Simulacrum
kmc-solid: Avoid the use of `asm_const` This PR removes the use of [the now-separated-out `asm_const` compiler feature][1] in `std::sys::solid` to fix the [`*-kmc-solid_*`](https://doc.rust-lang.org/nightly/rustc/platform-support/kmc-solid.html) Tier 3 targets. [1]: rust-lang#90348
2 parents 8b09ba6 + f170770 commit 5bc0936

File tree

1 file changed

+6
-7
lines changed
  • library/std/src/sys/solid/abi

1 file changed

+6
-7
lines changed

library/std/src/sys/solid/abi/mod.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,15 @@ mod fs;
44
pub mod sockets;
55
pub use self::fs::*;
66

7-
pub const SOLID_BP_PROGRAM_EXITED: usize = 15;
8-
pub const SOLID_BP_CSABORT: usize = 16;
9-
107
#[inline(always)]
118
pub fn breakpoint_program_exited(tid: usize) {
129
unsafe {
1310
match () {
11+
// SOLID_BP_PROGRAM_EXITED = 15
1412
#[cfg(target_arch = "arm")]
15-
() => asm!("bkpt #{}", const SOLID_BP_PROGRAM_EXITED, in("r0") tid),
13+
() => asm!("bkpt #15", in("r0") tid),
1614
#[cfg(target_arch = "aarch64")]
17-
() => asm!("hlt #{}", const SOLID_BP_PROGRAM_EXITED, in("x0") tid),
15+
() => asm!("hlt #15", in("x0") tid),
1816
}
1917
}
2018
}
@@ -23,10 +21,11 @@ pub fn breakpoint_program_exited(tid: usize) {
2321
pub fn breakpoint_abort() {
2422
unsafe {
2523
match () {
24+
// SOLID_BP_CSABORT = 16
2625
#[cfg(target_arch = "arm")]
27-
() => asm!("bkpt #{}", const SOLID_BP_CSABORT),
26+
() => asm!("bkpt #16"),
2827
#[cfg(target_arch = "aarch64")]
29-
() => asm!("hlt #{}", const SOLID_BP_CSABORT),
28+
() => asm!("hlt #16"),
3029
}
3130
}
3231
}

0 commit comments

Comments
 (0)