File tree 4 files changed +6
-47
lines changed
4 files changed +6
-47
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,11 @@ pub unsafe extern "C-unwind" fn __rust_start_panic(_payload: *mut &mut dyn BoxMe
38
38
abort ( ) ;
39
39
40
40
cfg_if:: cfg_if! {
41
- if #[ cfg( unix) ] {
41
+ if #[ cfg( any ( unix, target_os = "solid_asp3" ) ) ] {
42
42
unsafe fn abort( ) -> ! {
43
43
libc:: abort( ) ;
44
44
}
45
45
} else if #[ cfg( any( target_os = "hermit" ,
46
- target_os = "solid_asp3" ,
47
46
all( target_vendor = "fortanix" , target_env = "sgx" )
48
47
) ) ] {
49
48
unsafe fn abort( ) -> ! {
Original file line number Diff line number Diff line change 4
4
pub mod sockets;
5
5
pub use self :: fs:: * ;
6
6
7
- #[ inline( always) ]
8
- pub fn breakpoint_program_exited ( tid : usize ) {
9
- unsafe {
10
- match ( ) {
11
- // SOLID_BP_PROGRAM_EXITED = 15
12
- #[ cfg( target_arch = "arm" ) ]
13
- ( ) => core:: arch:: asm!( "bkpt #15" , in( "r0" ) tid) ,
14
- #[ cfg( target_arch = "aarch64" ) ]
15
- ( ) => core:: arch:: asm!( "hlt #15" , in( "x0" ) tid) ,
16
- }
17
- }
18
- }
19
-
20
- #[ inline( always) ]
21
- pub fn breakpoint_abort ( ) {
22
- unsafe {
23
- match ( ) {
24
- // SOLID_BP_CSABORT = 16
25
- #[ cfg( target_arch = "arm" ) ]
26
- ( ) => core:: arch:: asm!( "bkpt #16" ) ,
27
- #[ cfg( target_arch = "aarch64" ) ]
28
- ( ) => core:: arch:: asm!( "hlt #16" ) ,
29
- }
30
- }
31
- }
32
-
33
7
// `solid_types.h`
34
8
pub use super :: itron:: abi:: { ER , ER_ID , E_TMOUT , ID } ;
35
9
Original file line number Diff line number Diff line change @@ -74,20 +74,9 @@ pub fn decode_error_kind(code: i32) -> crate::io::ErrorKind {
74
74
error:: decode_error_kind ( code)
75
75
}
76
76
77
- #[ inline( always ) ]
77
+ #[ inline]
78
78
pub fn abort_internal ( ) -> ! {
79
- loop {
80
- abi:: breakpoint_abort ( ) ;
81
- }
82
- }
83
-
84
- // This function is needed by the panic runtime. The symbol is named in
85
- // pre-link args for the target specification, so keep that in sync.
86
- #[ cfg( not( test) ) ]
87
- #[ no_mangle]
88
- // NB. used by both libunwind and libpanic_abort
89
- pub extern "C" fn __rust_abort ( ) {
90
- abort_internal ( ) ;
79
+ unsafe { libc:: abort ( ) }
91
80
}
92
81
93
82
pub fn hashmap_random_keys ( ) -> ( u64 , u64 ) {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ use crate::path::{self, PathBuf};
11
11
use crate :: sys_common:: rwlock:: StaticRwLock ;
12
12
use crate :: vec;
13
13
14
- use super :: { abi , error, itron, memchr} ;
14
+ use super :: { error, itron, memchr} ;
15
15
16
16
// `solid` directly maps `errno`s to μITRON error codes.
17
17
impl itron:: error:: ItronError {
@@ -184,11 +184,8 @@ pub fn home_dir() -> Option<PathBuf> {
184
184
None
185
185
}
186
186
187
- pub fn exit ( _code : i32 ) -> ! {
188
- let tid = itron:: task:: try_current_task_id ( ) . unwrap_or ( 0 ) ;
189
- loop {
190
- abi:: breakpoint_program_exited ( tid as usize ) ;
191
- }
187
+ pub fn exit ( code : i32 ) -> ! {
188
+ rtabort ! ( "exit({}) called" , code) ;
192
189
}
193
190
194
191
pub fn getpid ( ) -> u32 {
You can’t perform that action at this time.
0 commit comments