File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -523,23 +523,21 @@ pub unsafe extern "C" fn start_trap_rust(trap_frame: *const TrapFrame) {
523523 fn _dispatch_interrupt ( code : usize ) ;
524524 }
525525
526- let cause = xcause:: read ( ) ;
527- let code = cause. code ( ) ;
528-
529- if cause. is_exception ( ) {
530- let trap_frame = & * trap_frame;
531- if code < __EXCEPTIONS. len ( ) {
532- let h = & __EXCEPTIONS[ code] ;
533- if let Some ( handler) = h {
534- handler ( trap_frame) ;
526+ match xcause:: read ( ) . cause ( ) {
527+ xcause:: Trap :: Interrupt ( code) => _dispatch_interrupt ( code) ,
528+ xcause:: Trap :: Exception ( code) => {
529+ let trap_frame = & * trap_frame;
530+ if code < __EXCEPTIONS. len ( ) {
531+ let h = & __EXCEPTIONS[ code] ;
532+ if let Some ( handler) = h {
533+ handler ( trap_frame) ;
534+ } else {
535+ ExceptionHandler ( trap_frame) ;
536+ }
535537 } else {
536538 ExceptionHandler ( trap_frame) ;
537539 }
538- } else {
539- ExceptionHandler ( trap_frame) ;
540540 }
541- } else {
542- _dispatch_interrupt ( code) ;
543541 }
544542}
545543
You can’t perform that action at this time.
0 commit comments