1
0
mirror of https://github.com/golang/go synced 2024-11-22 00:04:41 -07:00

proper syscall convention for arm

R=rsc
http://go/go-review/1015009
This commit is contained in:
Kai Backman 2009-10-25 11:51:16 -07:00
parent 68d5c51287
commit 6f91ba1b0f
3 changed files with 6 additions and 11 deletions

View File

@ -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

View File

@ -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

View File

@ -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);