2014-12-25 23:09:07 -07:00
|
|
|
// Copyright 2014 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
#include "textflag.h"
|
|
|
|
|
|
|
|
//
|
|
|
|
// System call support for ARM, Darwin
|
|
|
|
//
|
|
|
|
|
|
|
|
// func Syscall(syscall uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
|
2015-02-19 14:44:06 -07:00
|
|
|
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·entersyscall(SB)
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW syscall+4(SP), R12
|
|
|
|
MOVW a1+8(SP), R0
|
|
|
|
MOVW a2+12(SP), R1
|
|
|
|
MOVW a3+16(SP), R2
|
2014-12-25 23:09:07 -07:00
|
|
|
SWI $0x80
|
|
|
|
BCC ok
|
|
|
|
MOVW $-1, R1
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R1, r1+20(SP) // r1
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R2
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R2, r2+24(SP) // r2
|
|
|
|
MOVW R0, errno+28(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·exitsyscall(SB)
|
|
|
|
RET
|
|
|
|
ok:
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, r1+20(SP) // r1
|
|
|
|
MOVW R1, r2+24(SP) // r2
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R0
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, errno+28(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·exitsyscall(SB)
|
|
|
|
RET
|
|
|
|
|
|
|
|
// func RawSyscall(trap uintptr, a1, a2, a3 uintptr) (r1, r2, err uintptr)
|
2015-02-19 14:44:06 -07:00
|
|
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW syscall+4(SP), R12 // syscall entry
|
|
|
|
MOVW a1+8(SP), R0
|
|
|
|
MOVW a2+12(SP), R1
|
|
|
|
MOVW a3+16(SP), R2
|
2014-12-25 23:09:07 -07:00
|
|
|
SWI $0x80
|
|
|
|
BCC ok1
|
|
|
|
MOVW $-1, R1
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R1, r1+20(SP) // r1
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R2
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R2, r2+24(SP) // r2
|
|
|
|
MOVW R0, errno+28(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
RET
|
|
|
|
ok1:
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, r1+20(SP) // r1
|
|
|
|
MOVW R1, r2+24(SP) // r2
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R0
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, errno+28(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
RET
|
|
|
|
|
|
|
|
// func Syscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
|
2015-02-19 14:44:06 -07:00
|
|
|
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·entersyscall(SB)
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW syscall+4(SP), R12 // syscall entry
|
|
|
|
MOVW a1+8(SP), R0
|
|
|
|
MOVW a2+12(SP), R1
|
|
|
|
MOVW a3+16(SP), R2
|
|
|
|
MOVW a4+20(SP), R3
|
|
|
|
MOVW a5+24(SP), R4
|
|
|
|
MOVW a6+28(SP), R5
|
2014-12-25 23:09:07 -07:00
|
|
|
SWI $0x80
|
|
|
|
BCC ok6
|
|
|
|
MOVW $-1, R1
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R1, r1+32(SP) // r1
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R2
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R2, r2+36(SP) // r2
|
|
|
|
MOVW R0, errno+40(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·exitsyscall(SB)
|
|
|
|
RET
|
|
|
|
ok6:
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, r1+32(SP) // r1
|
|
|
|
MOVW R1, r2+36(SP) // r2
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R0
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, errno+40(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·exitsyscall(SB)
|
|
|
|
RET
|
|
|
|
|
|
|
|
// func RawSyscall6(trap uintptr, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2, err uintptr)
|
2015-02-19 14:44:06 -07:00
|
|
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW trap+4(SP), R12 // syscall entry
|
|
|
|
MOVW a1+8(SP), R0
|
|
|
|
MOVW a2+12(SP), R1
|
|
|
|
MOVW a3+16(SP), R2
|
|
|
|
MOVW a4+20(SP), R3
|
|
|
|
MOVW a5+24(SP), R4
|
|
|
|
MOVW a6+28(SP), R5
|
2014-12-25 23:09:07 -07:00
|
|
|
SWI $0x80
|
|
|
|
BCC ok2
|
|
|
|
MOVW $-1, R1
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R1, r1+32(SP) // r1
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R2
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R2, r2+36(SP) // r2
|
|
|
|
MOVW R0, errno+40(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
RET
|
|
|
|
ok2:
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, r1+32(SP) // r1
|
|
|
|
MOVW R1, r2+36(SP) // r2
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R0
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, errno+40(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
RET
|
|
|
|
|
|
|
|
// Actually Syscall7.
|
2015-02-19 14:44:06 -07:00
|
|
|
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·entersyscall(SB)
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW syscall+4(SP), R12 // syscall entry
|
|
|
|
MOVW a1+8(SP), R0
|
|
|
|
MOVW a2+12(SP), R1
|
|
|
|
MOVW a3+16(SP), R2
|
|
|
|
MOVW a4+20(SP), R3
|
|
|
|
MOVW a5+24(SP), R4
|
|
|
|
MOVW a6+28(SP), R5
|
|
|
|
MOVW a7+32(SP), R6
|
2014-12-25 23:09:07 -07:00
|
|
|
SWI $0x80
|
|
|
|
BCC ok9
|
|
|
|
MOVW $-1, R1
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R1, r1+44(SP) // r1
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R2
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R2, r2+48(SP) // r2
|
|
|
|
MOVW R0, errno+52(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·exitsyscall(SB)
|
|
|
|
RET
|
|
|
|
ok9:
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, r1+44(SP) // r1
|
|
|
|
MOVW R1, r2+48(SP) // r2
|
2014-12-25 23:09:07 -07:00
|
|
|
MOVW $0, R0
|
2015-02-19 14:09:01 -07:00
|
|
|
MOVW R0, errno+52(SP) // errno
|
2014-12-25 23:09:07 -07:00
|
|
|
BL runtime·exitsyscall(SB)
|
|
|
|
RET
|
|
|
|
|