@@ -326,11 +326,8 @@ pub fn reinitialize(task: &mut task::Task) {
326
326
// TODO: this assumes availability of an FPU.
327
327
// Use checked operations to get a reference to the exception frame.
328
328
let frame_size = core:: mem:: size_of :: < ExtendedExceptionFrame > ( ) ;
329
- let mut uslice: USlice < ExtendedExceptionFrame > = USlice :: from_raw (
330
- initial_stack as usize - frame_size,
331
- 1 ,
332
- )
333
- . unwrap ( ) ;
329
+ let mut uslice: USlice < ExtendedExceptionFrame > =
330
+ USlice :: from_raw ( initial_stack as usize - frame_size, 1 ) . unwrap ( ) ;
334
331
uassert ! ( task. can_write( & uslice) ) ;
335
332
336
333
// Before we set our frame, find the region that contains our initial stack
@@ -1090,7 +1087,7 @@ bitflags::bitflags! {
1090
1087
unsafe extern "C" fn handle_fault (
1091
1088
task : * mut task:: Task ,
1092
1089
fault_type : FaultType ,
1093
- fpsave : * mut u32
1090
+ fpsave : * mut u32 ,
1094
1091
) {
1095
1092
// To diagnose the fault, we're going to need access to the System Control
1096
1093
// Block. Pull such access from thin air.
@@ -1125,41 +1122,51 @@ unsafe extern "C" fn handle_fault(
1125
1122
// fact that the user's stack pointer is so trashed that we
1126
1123
// can't store through it. (In particular, we seem to have no
1127
1124
// way at getting at our faulted PC.)
1128
- ( FaultInfo :: StackOverflow {
1129
- address : ( * task) . save ( ) . psp ,
1130
- } , true )
1125
+ (
1126
+ FaultInfo :: StackOverflow {
1127
+ address : ( * task) . save ( ) . psp ,
1128
+ } ,
1129
+ true ,
1130
+ )
1131
1131
} else if cfsr. contains ( Cfsr :: IACCVIOL ) {
1132
1132
( FaultInfo :: IllegalText , false )
1133
1133
} else {
1134
- ( FaultInfo :: MemoryAccess {
1135
- address : if cfsr. contains ( Cfsr :: MMARVALID ) {
1136
- Some ( scb. mmfar . read ( ) )
1137
- } else {
1138
- None
1134
+ (
1135
+ FaultInfo :: MemoryAccess {
1136
+ address : if cfsr. contains ( Cfsr :: MMARVALID ) {
1137
+ Some ( scb. mmfar . read ( ) )
1138
+ } else {
1139
+ None
1140
+ } ,
1141
+ source : FaultSource :: User ,
1139
1142
} ,
1140
- source : FaultSource :: User ,
1141
- } , false )
1143
+ false ,
1144
+ )
1142
1145
}
1143
1146
}
1144
1147
1145
- FaultType :: BusFault => ( FaultInfo :: BusError {
1146
- address : if cfsr. contains ( Cfsr :: BFARVALID ) {
1147
- Some ( scb. bfar . read ( ) )
1148
- } else {
1149
- None
1148
+ FaultType :: BusFault => (
1149
+ FaultInfo :: BusError {
1150
+ address : if cfsr. contains ( Cfsr :: BFARVALID ) {
1151
+ Some ( scb. bfar . read ( ) )
1152
+ } else {
1153
+ None
1154
+ } ,
1155
+ source : FaultSource :: User ,
1150
1156
} ,
1151
- source : FaultSource :: User ,
1152
- } , false ) ,
1157
+ false ,
1158
+ ) ,
1153
1159
1154
- FaultType :: UsageFault => {
1155
- ( if cfsr. contains ( Cfsr :: DIVBYZERO ) {
1160
+ FaultType :: UsageFault => (
1161
+ if cfsr. contains ( Cfsr :: DIVBYZERO ) {
1156
1162
FaultInfo :: DivideByZero
1157
1163
} else if cfsr. contains ( Cfsr :: UNDEFINSTR ) {
1158
1164
FaultInfo :: IllegalInstruction
1159
1165
} else {
1160
1166
FaultInfo :: InvalidOperation ( cfsr. bits ( ) )
1161
- } , false )
1162
- }
1167
+ } ,
1168
+ false ,
1169
+ ) ,
1163
1170
} ;
1164
1171
1165
1172
// Because we are responsible for clearing all conditions, we write back
0 commit comments