File tree 1 file changed +11
-13
lines changed
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) {
523
523
fn _dispatch_interrupt ( code : usize ) ;
524
524
}
525
525
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
+ }
535
537
} else {
536
538
ExceptionHandler ( trap_frame) ;
537
539
}
538
- } else {
539
- ExceptionHandler ( trap_frame) ;
540
540
}
541
- } else {
542
- _dispatch_interrupt ( code) ;
543
541
}
544
542
}
545
543
You can’t perform that action at this time.
0 commit comments