Skip to content

Commit 3acafb3

Browse files
committed
Enter Unprivileged needs an extern "C" fn
The function pointer is branched to by assembly, so we're relying on a certain ABI.
1 parent 0fe6c4c commit 3acafb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cortex-m/src/asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ pub unsafe fn semihosting_syscall(nr: u32, arg: u32) -> u32 {
194194
/// it, you may wish to set the `PSPLIM` register to guard against this.
195195
#[cfg(cortex_m)]
196196
#[inline(always)]
197-
pub unsafe fn enter_unprivileged(psp: *const u32, entry: fn() -> !) -> ! {
197+
pub unsafe fn enter_unprivileged(psp: *const u32, entry: extern "C" fn() -> !) -> ! {
198198
unsafe {
199199
core::arch::asm!(
200200
"mrs {tmp}, CONTROL",

0 commit comments

Comments
 (0)