File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,8 @@ pub const DEFAULT_HANDLERS: Handlers = Handlers {
153
153
// pointer (MSP), that way it points to the stacked registers
154
154
#[ naked]
155
155
pub extern "C" fn default_handler < T > ( _token : T )
156
- where T : Context
156
+ where
157
+ T : Context ,
157
158
{
158
159
// This is the actual exception handler. `_sf` is a pointer to the previous
159
160
// stack frame
@@ -167,16 +168,18 @@ pub extern "C" fn default_handler<T>(_token: T)
167
168
match ( ) {
168
169
#[ cfg( target_arch = "arm" ) ]
169
170
( ) => {
170
- // "trampoline" to get to the real exception handler.
171
- asm ! ( "mrs r0, MSP
171
+ unsafe {
172
+ // "trampoline" to get to the real exception handler.
173
+ asm ! ( "mrs r0, MSP
172
174
ldr r1, [r0, #20]
173
175
b $0"
174
- :
175
- : "i" ( handler as extern "C" fn ( & StackedRegisters ) -> !)
176
- :
177
- : "volatile" ) ;
176
+ :
177
+ : "i" ( handler as extern "C" fn ( & StackedRegisters ) -> !)
178
+ :
179
+ : "volatile" ) ;
178
180
179
- :: core:: intrinsics:: unreachable ( )
181
+ :: core:: intrinsics:: unreachable ( )
182
+ }
180
183
}
181
184
#[ cfg( not( target_arch = "arm" ) ) ]
182
185
( ) => { }
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ impl<T> Mutex<T> {
21
21
}
22
22
23
23
/// Mutably borrows the data for the duration of the critical section
24
- pub fn borrow_mut < ' cs > ( & self , _ctxt : & ' cs mut CriticalSection ) -> & ' cs mut T {
24
+ pub fn borrow_mut < ' cs > (
25
+ & self ,
26
+ _ctxt : & ' cs mut CriticalSection ,
27
+ ) -> & ' cs mut T {
25
28
unsafe { & mut * self . inner . get ( ) }
26
29
}
27
30
}
You can’t perform that action at this time.
0 commit comments