File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,10 @@ const START_INFO: &StartInfo = &StartInfo {
2323 sys_print : |bytes| {
2424 println ! ( "{}" , core:: str :: from_utf8( bytes) . unwrap( ) ) ;
2525 } ,
26+ sys_panic : || {
27+ error ! ( "server panicked" ) ;
28+ crate :: scheduler:: return_to_user ( ) ;
29+ } ,
2630} ;
2731
2832fn load_elf ( elf_file : & [ u8 ] ) {
Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ use core::sync::atomic::Ordering;
1010pub mod print;
1111
1212pub mod start;
13- mod supercall;
1413
1514#[ cfg( not( feature = "kernel" ) ) ]
1615mod panic;
Original file line number Diff line number Diff line change 1+ use crate :: start:: start_info;
2+
13#[ cfg( target_os = "none" ) ]
24#[ panic_handler]
35fn panic ( info : & core:: panic:: PanicInfo ) -> ! {
4- error ! ( "server panic: {info:?}" ) ;
6+ error ! ( "server panic: {info}" ) ;
7+ ( start_info ( ) . sys_panic ) ( ) ;
58 loop { }
69}
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ static START_INFO: AtomicUsize = AtomicUsize::new(0);
55
66pub struct StartInfo {
77 pub sys_print : extern "Rust" fn ( bytes : & [ u8 ] ) ,
8+ pub sys_panic : extern "Rust" fn ( ) ,
89}
910
1011pub fn start_info ( ) -> & ' static StartInfo {
You can’t perform that action at this time.
0 commit comments