File tree Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Expand file tree Collapse file tree 2 files changed +12
-15
lines changed Original file line number Diff line number Diff line change 2
2
fn panic ( info : & :: core:: panic:: PanicInfo ) -> ! {
3
3
use crate :: thread;
4
4
5
- let os_can_continue = crate :: thread:: InThread :: new ( )
6
- // Panics with IRQs off are fatal because we can't safely re-enable them
7
- . map ( |i| i. irq_is_enabled ( ) )
8
- // Panics in ISRs are always fatal because continuing in threads would signal to the
9
- // remaining system that the ISR terminated
10
- . unwrap_or ( false ) ;
5
+ let os_can_continue = !cfg ! ( feature = "panic_handler_crash" )
6
+ && crate :: thread:: InThread :: new ( )
7
+ // Panics with IRQs off are fatal because we can't safely re-enable them
8
+ . map ( |i| i. irq_is_enabled ( ) )
9
+ // Panics in ISRs are always fatal because continuing in threads would signal to the
10
+ // remaining system that the ISR terminated
11
+ . unwrap_or ( false ) ;
11
12
12
13
if !os_can_continue {
13
14
// We can't abort on stable -- but even if we could: Set a breakpoint and wait for the
@@ -49,15 +50,6 @@ fn panic(info: &::core::panic::PanicInfo) -> ! {
49
50
let _ = stdio. write_str ( "!\n " ) ;
50
51
}
51
52
52
- if cfg ! ( feature = "panic_handler_crash" ) {
53
- unsafe {
54
- riot_sys:: core_panic (
55
- riot_sys:: core_panic_t_PANIC_GENERAL_ERROR,
56
- cstr:: cstr!( "RUST PANIC" ) . as_ptr ( ) as _ ,
57
- )
58
- }
59
- }
60
-
61
53
// Not trying any unwinding -- this thread is just dead, won't be re-claimed, any mutexes it
62
54
// holds are just held indefinitely rather than throwing poison errors.
63
55
loop {
Original file line number Diff line number Diff line change @@ -106,6 +106,11 @@ impl KernelPID {
106
106
}
107
107
108
108
pub fn get_name ( & self ) -> Option < & str > {
109
+ // Shortcut through an otherwise unoptimizable function
110
+ if !cfg ! ( riot_develhelp) {
111
+ return None ;
112
+ }
113
+
109
114
let ptr = unsafe { raw:: thread_getname ( self . 0 ) } ;
110
115
111
116
// If the thread stops, the name might be not valid any more, but then again the getname
You can’t perform that action at this time.
0 commit comments