@@ -127,15 +127,17 @@ pub unsafe fn write(bits: usize) {
127
127
#[ inline]
128
128
pub unsafe fn set ( cause : Trap ) {
129
129
let bits = match cause {
130
- Trap :: Interrupt ( i) => ( match i {
131
- Interrupt :: UserSoft => 0 ,
132
- Interrupt :: SupervisorSoft => 1 ,
133
- Interrupt :: UserTimer => 4 ,
134
- Interrupt :: SupervisorTimer => 5 ,
135
- Interrupt :: UserExternal => 8 ,
136
- Interrupt :: SupervisorExternal => 9 ,
137
- Interrupt :: Unknown => panic ! ( "unknown interrupt" ) ,
138
- } | ( 1 << ( size_of :: < usize > ( ) * 8 - 1 ) ) ) , // interrupt bit is 1
130
+ Trap :: Interrupt ( i) => {
131
+ ( match i {
132
+ Interrupt :: UserSoft => 0 ,
133
+ Interrupt :: SupervisorSoft => 1 ,
134
+ Interrupt :: UserTimer => 4 ,
135
+ Interrupt :: SupervisorTimer => 5 ,
136
+ Interrupt :: UserExternal => 8 ,
137
+ Interrupt :: SupervisorExternal => 9 ,
138
+ Interrupt :: Unknown => panic ! ( "unknown interrupt" ) ,
139
+ } | ( 1 << ( size_of :: < usize > ( ) * 8 - 1 ) ) )
140
+ } // interrupt bit is 1
139
141
Trap :: Exception ( e) => match e {
140
142
Exception :: InstructionMisaligned => 0 ,
141
143
Exception :: InstructionFault => 1 ,
@@ -149,7 +151,7 @@ pub unsafe fn set(cause: Trap) {
149
151
Exception :: LoadPageFault => 13 ,
150
152
Exception :: StorePageFault => 15 ,
151
153
Exception :: Unknown => panic ! ( "unknown exception" ) ,
152
- } // interrupt bit is 0
154
+ } , // interrupt bit is 0
153
155
} ;
154
156
_write ( bits) ;
155
157
}
0 commit comments