Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions runtime/src/syscalls_impl_arm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ unsafe impl RawSyscalls for crate::TockSyscalls {
// Safety: This matches the invariants required by the documentation on
// RawSyscalls::yield1
// the use of `clobber_abi` allows us this to run on both Thumb-1 and Thumb-2
// see https://doc.rust-lang.org/nightly/reference/inline-assembly.html#abi-clobbers
unsafe {
asm!("svc 0",
inlateout("r0") r0 => _, // a1
Expand All @@ -17,7 +18,7 @@ unsafe impl RawSyscalls for crate::TockSyscalls {
// r13 is the stack pointer and must be restored by the callee.
// r15 is the program counter.

clobber_abi("C"), // a2, a3, a4, ip (r12), lr (r14)
clobber_abi("aapcs"), // r[0-3], r12, r14, s[0-15], d[0-7], d[16-31]
);
}
}
Expand All @@ -26,6 +27,7 @@ unsafe impl RawSyscalls for crate::TockSyscalls {
// Safety: This matches the invariants required by the documentation on
// RawSyscalls::yield2
// the use of `clobber_abi` allows us this to run on both Thumb-1 and Thumb-2
// see https://doc.rust-lang.org/nightly/reference/inline-assembly.html#abi-clobbers
unsafe {
asm!("svc 0",
inlateout("r0") r0 => _, // a1
Expand All @@ -38,7 +40,7 @@ unsafe impl RawSyscalls for crate::TockSyscalls {
// r13 is the stack pointer and must be restored by the callee.
// r15 is the program counter.

clobber_abi("C"), // a3, a4, ip (r12), lr (r14)
clobber_abi("aapcs"), // r[0-3], r12, r14, s[0-15], d[0-7], d[16-31]
);
}
}
Expand Down