Skip to content

Commit

Permalink
armv4t: Change all mov to movs
Browse files Browse the repository at this point in the history
This fixes compilation for pre-ARMv6 in thumb mode.
  • Loading branch information
jasonwhite committed Mar 16, 2024
1 parent 493e376 commit c7bf159
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions src/syscall/arm_thumb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ use crate::arch::arm::Sysno;
pub unsafe fn syscall0(n: Sysno) -> usize {
let mut ret: usize;
asm!(
"mov {temp}, r7",
"mov r7, {n}",
"movs {temp}, r7",
"movs r7, {n}",
"svc 0",
"mov r7, {temp}",
"movs r7, {temp}",
n = in(reg) n as usize,
temp = out(reg) _,
lateout("r0") ret,
options(nostack, preserves_flags)
options(nostack)
);
ret
}
Expand All @@ -48,14 +48,14 @@ pub unsafe fn syscall0(n: Sysno) -> usize {
pub unsafe fn syscall1(n: Sysno, arg1: usize) -> usize {
let mut ret: usize;
asm!(
"mov {temp}, r7",
"mov r7, {n}",
"movs {temp}, r7",
"movs r7, {n}",
"svc 0",
"mov r7, {temp}",
"movs r7, {temp}",
n = in(reg) n as usize,
temp = out(reg) _,
inlateout("r0") arg1 => ret,
options(nostack, preserves_flags)
options(nostack)
);
ret
}
Expand All @@ -70,15 +70,15 @@ pub unsafe fn syscall1(n: Sysno, arg1: usize) -> usize {
pub unsafe fn syscall2(n: Sysno, arg1: usize, arg2: usize) -> usize {
let mut ret: usize;
asm!(
"mov {temp}, r7",
"mov r7, {n}",
"movs {temp}, r7",
"movs r7, {n}",
"svc 0",
"mov r7, {temp}",
"movs r7, {temp}",
n = in(reg) n as usize,
temp = out(reg) _,
inlateout("r0") arg1 => ret,
in("r1") arg2,
options(nostack, preserves_flags)
options(nostack)
);
ret
}
Expand All @@ -98,16 +98,16 @@ pub unsafe fn syscall3(
) -> usize {
let mut ret: usize;
asm!(
"mov {temp}, r7",
"mov r7, {n}",
"movs {temp}, r7",
"movs r7, {n}",
"svc 0",
"mov r7, {temp}",
"movs r7, {temp}",
n = in(reg) n as usize,
temp = out(reg) _,
inlateout("r0") arg1 => ret,
in("r1") arg2,
in("r2") arg3,
options(nostack, preserves_flags)
options(nostack)
);
ret
}
Expand All @@ -128,17 +128,17 @@ pub unsafe fn syscall4(
) -> usize {
let mut ret: usize;
asm!(
"mov {temp}, r7",
"mov r7, {n}",
"movs {temp}, r7",
"movs r7, {n}",
"svc 0",
"mov r7, {temp}",
"movs r7, {temp}",
n = in(reg) n as usize,
temp = out(reg) _,
inlateout("r0") arg1 => ret,
in("r1") arg2,
in("r2") arg3,
in("r3") arg4,
options(nostack, preserves_flags)
options(nostack)
);
ret
}
Expand All @@ -160,18 +160,18 @@ pub unsafe fn syscall5(
) -> usize {
let mut ret: usize;
asm!(
"mov {temp}, r7",
"mov r7, {n}",
"movs {temp}, r7",
"movs r7, {n}",
"svc 0",
"mov r7, {temp}",
"movs r7, {temp}",
n = in(reg) n as usize,
temp = out(reg) _,
inlateout("r0") arg1 => ret,
in("r1") arg2,
in("r2") arg3,
in("r3") arg4,
in("r4") arg5,
options(nostack, preserves_flags)
options(nostack)
);
ret
}
Expand Down

0 comments on commit c7bf159

Please sign in to comment.