This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +6
-47
lines changed Expand file tree Collapse file tree 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
3838 abort ( ) ;
3939
4040 cfg_if:: cfg_if! {
41- if #[ cfg( unix) ] {
41+ if #[ cfg( any ( unix, target_os = "solid_asp3" ) ) ] {
4242 unsafe fn abort( ) -> ! {
4343 libc:: abort( ) ;
4444 }
4545 } else if #[ cfg( any( target_os = "hermit" ,
46- target_os = "solid_asp3" ,
4746 all( target_vendor = "fortanix" , target_env = "sgx" )
4847 ) ) ] {
4948 unsafe fn abort( ) -> ! {
Original file line number Diff line number Diff line change 44pub mod sockets;
55pub use self :: fs:: * ;
66
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-
337// `solid_types.h`
348pub use super :: itron:: abi:: { ER , ER_ID , E_TMOUT , ID } ;
359
Original file line number Diff line number Diff line change @@ -74,20 +74,9 @@ pub fn decode_error_kind(code: i32) -> crate::io::ErrorKind {
7474 error:: decode_error_kind ( code)
7575}
7676
77- #[ inline( always ) ]
77+ #[ inline]
7878pub 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 ( ) }
9180}
9281
9382pub 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};
1111use crate :: sys_common:: rwlock:: StaticRwLock ;
1212use crate :: vec;
1313
14- use super :: { abi , error, itron, memchr} ;
14+ use super :: { error, itron, memchr} ;
1515
1616// `solid` directly maps `errno`s to μITRON error codes.
1717impl itron:: error:: ItronError {
@@ -184,11 +184,8 @@ pub fn home_dir() -> Option<PathBuf> {
184184 None
185185}
186186
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) ;
192189}
193190
194191pub fn getpid ( ) -> u32 {
You can’t perform that action at this time.
0 commit comments