Skip to content

Commit f170770

Browse files
committed
kmc-solid: Avoid the use of asm_const
1 parent 43192ca commit f170770

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)