diff --git a/src/pkg/runtime/linux/arm/sys.s b/src/pkg/runtime/linux/arm/sys.s index 4eb38f1ce8..2d45955815 100644 --- a/src/pkg/runtime/linux/arm/sys.s +++ b/src/pkg/runtime/linux/arm/sys.s @@ -18,8 +18,8 @@ TEXT write(SB),7,$0 SWI $SYS_write RET -TEXT exit(SB),7,$0 - // Exit value already in R0 +TEXT exit(SB),7,$-4 + MOVW 0(FP), R0 SWI $SYS_exit TEXT runtime·mmap(SB),7,$0 diff --git a/src/pkg/syscall/asm_linux_arm.s b/src/pkg/syscall/asm_linux_arm.s index 50ee69d86d..dc030c5cec 100644 --- a/src/pkg/syscall/asm_linux_arm.s +++ b/src/pkg/syscall/asm_linux_arm.s @@ -6,9 +6,6 @@ // System calls for arm, Linux // -#define SYS_BASE 0x00900000 -#define SYS_syscall (SYS_BASE+113); - // TODO(kaib): handle error returns // func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr); @@ -19,7 +16,7 @@ TEXT syscall·Syscall(SB),7,$0 MOVW 8(SP), R0 MOVW 12(SP), R1 MOVW 16(SP), R2 - SWI $SYS_syscall + SWI $0 MOVW R0, 20(SP) // r1 MOVW R1, 24(SP) // r2 MOVW $0, R0 @@ -38,7 +35,7 @@ TEXT syscall·Syscall6(SB),7,$0 MOVW 20(SP), R3 MOVW 24(SP), R4 MOVW 28(SP), R5 - SWI $SYS_syscall + SWI $0 MOVW R0, 32(SP) // r1 MOVW R1, 36(SP) // r2 MOVW $0, R0 @@ -52,7 +49,7 @@ TEXT syscall·RawSyscall(SB),7,$0 MOVW 8(SP), R0 MOVW 12(SP), R1 MOVW 16(SP), R2 - SWI $SYS_syscall + SWI $0 MOVW R0, 20(SP) // r1 MOVW R1, 24(SP) // r2 MOVW $0, R0 diff --git a/src/pkg/syscall/zsysnum_linux_arm.go b/src/pkg/syscall/zsysnum_linux_arm.go index 48dc56ed16..0debe23986 100644 --- a/src/pkg/syscall/zsysnum_linux_arm.go +++ b/src/pkg/syscall/zsysnum_linux_arm.go @@ -3,9 +3,7 @@ package syscall const ( - SYS_SYSCALL_BASE = 0x900000; - // for thumb and eabi - //SYS_SYSCALL_BASE = 0; + SYS_SYSCALL_BASE = 0; SYS_RESTART_SYSCALL = (SYS_SYSCALL_BASE + 0); SYS_EXIT = (SYS_SYSCALL_BASE + 1);