mirror of
https://github.com/golang/go
synced 2024-11-13 19:20:31 -07:00
[dev.cc] runtime, syscall: add names to FP offsets in freebsd, netbsd arm assembly
Makes them compatible with the new asm. Applied mechanically from vet diagnostics. Manual edits: the names for arguments in time·now(SB) in runtime/sys_*_arm.s. Change-Id: Ib295390d9509d306afc67714e3f50dc832256625 Reviewed-on: https://go-review.googlesource.com/5576 Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Rob Pike <r@golang.org>
This commit is contained in:
parent
53d4123fbc
commit
c72a21189b
@ -40,10 +40,10 @@
|
|||||||
#define SYS_mmap (SYS_BASE + 477)
|
#define SYS_mmap (SYS_BASE + 477)
|
||||||
|
|
||||||
TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
|
TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0
|
MOVW addr+0(FP), R0
|
||||||
MOVW 4(FP), R1
|
MOVW mode+4(FP), R1
|
||||||
MOVW 8(FP), R2
|
MOVW val+8(FP), R2
|
||||||
MOVW 12(FP), R3
|
MOVW ptr2+12(FP), R3
|
||||||
ADD $20, R13 // arg 5 is passed on stack
|
ADD $20, R13 // arg 5 is passed on stack
|
||||||
MOVW $SYS__umtx_op, R7
|
MOVW $SYS__umtx_op, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
@ -53,8 +53,8 @@ TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·thr_new(SB),NOSPLIT,$0
|
TEXT runtime·thr_new(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0
|
MOVW param+0(FP), R0
|
||||||
MOVW 4(FP), R1
|
MOVW size+4(FP), R1
|
||||||
MOVW $SYS_thr_new, R7
|
MOVW $SYS_thr_new, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
RET
|
RET
|
||||||
@ -72,7 +72,7 @@ TEXT runtime·thr_start(SB),NOSPLIT,$0
|
|||||||
|
|
||||||
// Exit the entire program (like C exit)
|
// Exit the entire program (like C exit)
|
||||||
TEXT runtime·exit(SB),NOSPLIT,$-8
|
TEXT runtime·exit(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0 // arg 1 exit status
|
MOVW code+0(FP), R0 // arg 1 exit status
|
||||||
MOVW $SYS_exit, R7
|
MOVW $SYS_exit, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
@ -80,7 +80,7 @@ TEXT runtime·exit(SB),NOSPLIT,$-8
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·exit1(SB),NOSPLIT,$-8
|
TEXT runtime·exit1(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0 // arg 1 exit status
|
MOVW code+0(FP), R0 // arg 1 exit status
|
||||||
MOVW $SYS_thr_exit, R7
|
MOVW $SYS_thr_exit, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
@ -88,42 +88,42 @@ TEXT runtime·exit1(SB),NOSPLIT,$-8
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·open(SB),NOSPLIT,$-8
|
TEXT runtime·open(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0 // arg 1 name
|
MOVW name+0(FP), R0 // arg 1 name
|
||||||
MOVW 4(FP), R1 // arg 2 mode
|
MOVW mode+4(FP), R1 // arg 2 mode
|
||||||
MOVW 8(FP), R2 // arg 3 perm
|
MOVW perm+8(FP), R2 // arg 3 perm
|
||||||
MOVW $SYS_open, R7
|
MOVW $SYS_open, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW R0, ret+12(FP)
|
MOVW R0, ret+12(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·read(SB),NOSPLIT,$-8
|
TEXT runtime·read(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0 // arg 1 fd
|
MOVW fd+0(FP), R0 // arg 1 fd
|
||||||
MOVW 4(FP), R1 // arg 2 buf
|
MOVW p+4(FP), R1 // arg 2 buf
|
||||||
MOVW 8(FP), R2 // arg 3 count
|
MOVW n+8(FP), R2 // arg 3 count
|
||||||
MOVW $SYS_read, R7
|
MOVW $SYS_read, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW R0, ret+12(FP)
|
MOVW R0, ret+12(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·write(SB),NOSPLIT,$-8
|
TEXT runtime·write(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0 // arg 1 fd
|
MOVW fd+0(FP), R0 // arg 1 fd
|
||||||
MOVW 4(FP), R1 // arg 2 buf
|
MOVW p+4(FP), R1 // arg 2 buf
|
||||||
MOVW 8(FP), R2 // arg 3 count
|
MOVW n+8(FP), R2 // arg 3 count
|
||||||
MOVW $SYS_write, R7
|
MOVW $SYS_write, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW R0, ret+12(FP)
|
MOVW R0, ret+12(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·close(SB),NOSPLIT,$-8
|
TEXT runtime·close(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0 // arg 1 fd
|
MOVW fd+0(FP), R0 // arg 1 fd
|
||||||
MOVW $SYS_close, R7
|
MOVW $SYS_close, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW R0, ret+4(FP)
|
MOVW R0, ret+4(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·getrlimit(SB),NOSPLIT,$-8
|
TEXT runtime·getrlimit(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0
|
MOVW kind+0(FP), R0
|
||||||
MOVW 4(FP), R1
|
MOVW limit+4(FP), R1
|
||||||
MOVW $SYS_getrlimit, R7
|
MOVW $SYS_getrlimit, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW R0, ret+8(FP)
|
MOVW R0, ret+8(FP)
|
||||||
@ -142,9 +142,9 @@ TEXT runtime·raise(SB),NOSPLIT,$8
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·setitimer(SB), NOSPLIT, $-8
|
TEXT runtime·setitimer(SB), NOSPLIT, $-8
|
||||||
MOVW 0(FP), R0
|
MOVW mode+0(FP), R0
|
||||||
MOVW 4(FP), R1
|
MOVW new+4(FP), R1
|
||||||
MOVW 8(FP), R2
|
MOVW old+8(FP), R2
|
||||||
MOVW $SYS_setitimer, R7
|
MOVW $SYS_setitimer, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
RET
|
RET
|
||||||
@ -160,9 +160,9 @@ TEXT time·now(SB), NOSPLIT, $32
|
|||||||
MOVW 12(R13), R1 // sec.high
|
MOVW 12(R13), R1 // sec.high
|
||||||
MOVW 16(R13), R2 // nsec
|
MOVW 16(R13), R2 // nsec
|
||||||
|
|
||||||
MOVW R0, 0(FP)
|
MOVW R0, sec_lo+0(FP)
|
||||||
MOVW R1, 4(FP)
|
MOVW R1, sec_hi+4(FP)
|
||||||
MOVW R2, 8(FP)
|
MOVW R2, nsec+8(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// int64 nanotime(void) so really
|
// int64 nanotime(void) so really
|
||||||
@ -190,9 +190,9 @@ TEXT runtime·nanotime(SB), NOSPLIT, $32
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·sigaction(SB),NOSPLIT,$-8
|
TEXT runtime·sigaction(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0 // arg 1 sig
|
MOVW sig+0(FP), R0 // arg 1 sig
|
||||||
MOVW 4(FP), R1 // arg 2 act
|
MOVW new+4(FP), R1 // arg 2 act
|
||||||
MOVW 8(FP), R2 // arg 3 oact
|
MOVW old+8(FP), R2 // arg 3 oact
|
||||||
MOVW $SYS_sigaction, R7
|
MOVW $SYS_sigaction, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
@ -235,15 +235,15 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$24
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·mmap(SB),NOSPLIT,$16
|
TEXT runtime·mmap(SB),NOSPLIT,$16
|
||||||
MOVW 0(FP), R0 // arg 1 addr
|
MOVW addr+0(FP), R0 // arg 1 addr
|
||||||
MOVW 4(FP), R1 // arg 2 len
|
MOVW n+4(FP), R1 // arg 2 len
|
||||||
MOVW 8(FP), R2 // arg 3 prot
|
MOVW prot+8(FP), R2 // arg 3 prot
|
||||||
MOVW 12(FP), R3 // arg 4 flags
|
MOVW flags+12(FP), R3 // arg 4 flags
|
||||||
// arg 5 (fid) and arg6 (offset_lo, offset_hi) are passed on stack
|
// arg 5 (fid) and arg6 (offset_lo, offset_hi) are passed on stack
|
||||||
// note the C runtime only passes the 32-bit offset_lo to us
|
// note the C runtime only passes the 32-bit offset_lo to us
|
||||||
MOVW 16(FP), R4 // arg 5
|
MOVW fd+16(FP), R4 // arg 5
|
||||||
MOVW R4, 4(R13)
|
MOVW R4, 4(R13)
|
||||||
MOVW 20(FP), R5 // arg 6 lower 32-bit
|
MOVW off+20(FP), R5 // arg 6 lower 32-bit
|
||||||
// the word at 8(R13) is skipped due to 64-bit argument alignment.
|
// the word at 8(R13) is skipped due to 64-bit argument alignment.
|
||||||
MOVW R5, 12(R13)
|
MOVW R5, 12(R13)
|
||||||
MOVW $0, R6 // higher 32-bit for arg 6
|
MOVW $0, R6 // higher 32-bit for arg 6
|
||||||
@ -257,8 +257,8 @@ TEXT runtime·mmap(SB),NOSPLIT,$16
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·munmap(SB),NOSPLIT,$0
|
TEXT runtime·munmap(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 addr
|
MOVW addr+0(FP), R0 // arg 1 addr
|
||||||
MOVW 4(FP), R1 // arg 2 len
|
MOVW n+4(FP), R1 // arg 2 len
|
||||||
MOVW $SYS_munmap, R7
|
MOVW $SYS_munmap, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
@ -266,9 +266,9 @@ TEXT runtime·munmap(SB),NOSPLIT,$0
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·madvise(SB),NOSPLIT,$0
|
TEXT runtime·madvise(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 addr
|
MOVW addr+0(FP), R0 // arg 1 addr
|
||||||
MOVW 4(FP), R1 // arg 2 len
|
MOVW n+4(FP), R1 // arg 2 len
|
||||||
MOVW 8(FP), R2 // arg 3 flags
|
MOVW flags+8(FP), R2 // arg 3 flags
|
||||||
MOVW $SYS_madvise, R7
|
MOVW $SYS_madvise, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
// ignore failure - maybe pages are locked
|
// ignore failure - maybe pages are locked
|
||||||
@ -304,10 +304,10 @@ TEXT runtime·usleep(SB),NOSPLIT,$16
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·sysctl(SB),NOSPLIT,$0
|
TEXT runtime·sysctl(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 - name
|
MOVW mib+0(FP), R0 // arg 1 - name
|
||||||
MOVW 4(FP), R1 // arg 2 - namelen
|
MOVW miblen+4(FP), R1 // arg 2 - namelen
|
||||||
MOVW 8(FP), R2 // arg 3 - old
|
MOVW out+8(FP), R2 // arg 3 - old
|
||||||
MOVW 12(FP), R3 // arg 4 - oldlenp
|
MOVW size+12(FP), R3 // arg 4 - oldlenp
|
||||||
// arg 5 (newp) and arg 6 (newlen) are passed on stack
|
// arg 5 (newp) and arg 6 (newlen) are passed on stack
|
||||||
ADD $20, R13
|
ADD $20, R13
|
||||||
MOVW $SYS___sysctl, R7
|
MOVW $SYS___sysctl, R7
|
||||||
@ -324,8 +324,8 @@ TEXT runtime·osyield(SB),NOSPLIT,$-4
|
|||||||
|
|
||||||
TEXT runtime·sigprocmask(SB),NOSPLIT,$0
|
TEXT runtime·sigprocmask(SB),NOSPLIT,$0
|
||||||
MOVW $3, R0 // arg 1 - how (SIG_SETMASK)
|
MOVW $3, R0 // arg 1 - how (SIG_SETMASK)
|
||||||
MOVW 0(FP), R1 // arg 2 - set
|
MOVW new+0(FP), R1 // arg 2 - set
|
||||||
MOVW 4(FP), R2 // arg 3 - oset
|
MOVW old+4(FP), R2 // arg 3 - oset
|
||||||
MOVW $SYS_sigprocmask, R7
|
MOVW $SYS_sigprocmask, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
@ -342,10 +342,10 @@ TEXT runtime·kqueue(SB),NOSPLIT,$0
|
|||||||
|
|
||||||
// int32 runtime·kevent(int kq, Kevent *changelist, int nchanges, Kevent *eventlist, int nevents, Timespec *timeout)
|
// int32 runtime·kevent(int kq, Kevent *changelist, int nchanges, Kevent *eventlist, int nevents, Timespec *timeout)
|
||||||
TEXT runtime·kevent(SB),NOSPLIT,$0
|
TEXT runtime·kevent(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // kq
|
MOVW kq+0(FP), R0 // kq
|
||||||
MOVW 4(FP), R1 // changelist
|
MOVW ch+4(FP), R1 // changelist
|
||||||
MOVW 8(FP), R2 // nchanges
|
MOVW nch+8(FP), R2 // nchanges
|
||||||
MOVW 12(FP), R3 // eventlist
|
MOVW ev+12(FP), R3 // eventlist
|
||||||
ADD $20, R13 // pass arg 5 and 6 on stack
|
ADD $20, R13 // pass arg 5 and 6 on stack
|
||||||
MOVW $SYS_kevent, R7
|
MOVW $SYS_kevent, R7
|
||||||
SWI $0
|
SWI $0
|
||||||
@ -356,7 +356,7 @@ TEXT runtime·kevent(SB),NOSPLIT,$0
|
|||||||
|
|
||||||
// void runtime·closeonexec(int32 fd)
|
// void runtime·closeonexec(int32 fd)
|
||||||
TEXT runtime·closeonexec(SB),NOSPLIT,$0
|
TEXT runtime·closeonexec(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // fd
|
MOVW fd+0(FP), R0 // fd
|
||||||
MOVW $2, R1 // F_SETFD
|
MOVW $2, R1 // F_SETFD
|
||||||
MOVW $1, R2 // FD_CLOEXEC
|
MOVW $1, R2 // FD_CLOEXEC
|
||||||
MOVW $SYS_fcntl, R7
|
MOVW $SYS_fcntl, R7
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
// Exit the entire program (like C exit)
|
// Exit the entire program (like C exit)
|
||||||
TEXT runtime·exit(SB),NOSPLIT,$-4
|
TEXT runtime·exit(SB),NOSPLIT,$-4
|
||||||
MOVW 0(FP), R0 // arg 1 exit status
|
MOVW code+0(FP), R0 // arg 1 exit status
|
||||||
SWI $0xa00001
|
SWI $0xa00001
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
MOVW.CS R8, (R8)
|
MOVW.CS R8, (R8)
|
||||||
@ -25,31 +25,31 @@ TEXT runtime·exit1(SB),NOSPLIT,$-4
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·open(SB),NOSPLIT,$-8
|
TEXT runtime·open(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0
|
MOVW name+0(FP), R0
|
||||||
MOVW 4(FP), R1
|
MOVW mode+4(FP), R1
|
||||||
MOVW 8(FP), R2
|
MOVW perm+8(FP), R2
|
||||||
SWI $0xa00005
|
SWI $0xa00005
|
||||||
MOVW R0, ret+12(FP)
|
MOVW R0, ret+12(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·close(SB),NOSPLIT,$-8
|
TEXT runtime·close(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0
|
MOVW fd+0(FP), R0
|
||||||
SWI $0xa00006
|
SWI $0xa00006
|
||||||
MOVW R0, ret+4(FP)
|
MOVW R0, ret+4(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·read(SB),NOSPLIT,$-8
|
TEXT runtime·read(SB),NOSPLIT,$-8
|
||||||
MOVW 0(FP), R0
|
MOVW fd+0(FP), R0
|
||||||
MOVW 4(FP), R1
|
MOVW p+4(FP), R1
|
||||||
MOVW 8(FP), R2
|
MOVW n+8(FP), R2
|
||||||
SWI $0xa00003
|
SWI $0xa00003
|
||||||
MOVW R0, ret+12(FP)
|
MOVW R0, ret+12(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·write(SB),NOSPLIT,$-4
|
TEXT runtime·write(SB),NOSPLIT,$-4
|
||||||
MOVW 0(FP), R0 // arg 1 - fd
|
MOVW fd+0(FP), R0 // arg 1 - fd
|
||||||
MOVW 4(FP), R1 // arg 2 - buf
|
MOVW p+4(FP), R1 // arg 2 - buf
|
||||||
MOVW 8(FP), R2 // arg 3 - nbyte
|
MOVW n+8(FP), R2 // arg 3 - nbyte
|
||||||
SWI $0xa00004 // sys_write
|
SWI $0xa00004 // sys_write
|
||||||
MOVW R0, ret+12(FP)
|
MOVW R0, ret+12(FP)
|
||||||
RET
|
RET
|
||||||
@ -68,17 +68,17 @@ TEXT runtime·osyield(SB),NOSPLIT,$0
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·lwp_park(SB),NOSPLIT,$0
|
TEXT runtime·lwp_park(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 - abstime
|
MOVW abstime+0(FP), R0 // arg 1 - abstime
|
||||||
MOVW 4(FP), R1 // arg 2 - unpark
|
MOVW unpark+4(FP), R1 // arg 2 - unpark
|
||||||
MOVW 8(FP), R2 // arg 3 - hint
|
MOVW hint+8(FP), R2 // arg 3 - hint
|
||||||
MOVW 12(FP), R3 // arg 4 - unparkhint
|
MOVW unparkhint+12(FP), R3 // arg 4 - unparkhint
|
||||||
SWI $0xa001b2 // sys__lwp_park
|
SWI $0xa001b2 // sys__lwp_park
|
||||||
MOVW R0, ret+16(FP)
|
MOVW R0, ret+16(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·lwp_unpark(SB),NOSPLIT,$0
|
TEXT runtime·lwp_unpark(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 - lwp
|
MOVW lwp+0(FP), R0 // arg 1 - lwp
|
||||||
MOVW 4(FP), R1 // arg 2 - hint
|
MOVW hint+4(FP), R1 // arg 2 - hint
|
||||||
SWI $0xa00141 // sys__lwp_unpark
|
SWI $0xa00141 // sys__lwp_unpark
|
||||||
MOVW R0, ret+8(FP)
|
MOVW R0, ret+8(FP)
|
||||||
RET
|
RET
|
||||||
@ -124,9 +124,9 @@ TEXT runtime·raise(SB),NOSPLIT,$16
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·setitimer(SB),NOSPLIT,$-4
|
TEXT runtime·setitimer(SB),NOSPLIT,$-4
|
||||||
MOVW 0(FP), R0 // arg 1 - which
|
MOVW mode+0(FP), R0 // arg 1 - which
|
||||||
MOVW 4(FP), R1 // arg 2 - itv
|
MOVW new+4(FP), R1 // arg 2 - itv
|
||||||
MOVW 8(FP), R2 // arg 3 - oitv
|
MOVW old+8(FP), R2 // arg 3 - oitv
|
||||||
SWI $0xa001a9 // sys_setitimer
|
SWI $0xa001a9 // sys_setitimer
|
||||||
RET
|
RET
|
||||||
|
|
||||||
@ -140,9 +140,9 @@ TEXT time·now(SB), NOSPLIT, $32
|
|||||||
MOVW 12(R13), R1 // sec.high
|
MOVW 12(R13), R1 // sec.high
|
||||||
MOVW 16(R13), R2 // nsec
|
MOVW 16(R13), R2 // nsec
|
||||||
|
|
||||||
MOVW R0, 0(FP)
|
MOVW R0, sec_lo+0(FP)
|
||||||
MOVW R1, 4(FP)
|
MOVW R1, sec_hi+4(FP)
|
||||||
MOVW R2, 8(FP)
|
MOVW R2, nsec+8(FP)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
// int64 nanotime(void) so really
|
// int64 nanotime(void) so really
|
||||||
@ -167,16 +167,16 @@ TEXT runtime·nanotime(SB), NOSPLIT, $32
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·getcontext(SB),NOSPLIT,$-4
|
TEXT runtime·getcontext(SB),NOSPLIT,$-4
|
||||||
MOVW 0(FP), R0 // arg 1 - context
|
MOVW ctxt+0(FP), R0 // arg 1 - context
|
||||||
SWI $0xa00133 // sys_getcontext
|
SWI $0xa00133 // sys_getcontext
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
MOVW.CS R8, (R8)
|
MOVW.CS R8, (R8)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·sigprocmask(SB),NOSPLIT,$0
|
TEXT runtime·sigprocmask(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 - how
|
MOVW mode+0(FP), R0 // arg 1 - how
|
||||||
MOVW 4(FP), R1 // arg 2 - set
|
MOVW new+4(FP), R1 // arg 2 - set
|
||||||
MOVW 8(FP), R2 // arg 3 - oset
|
MOVW old+8(FP), R2 // arg 3 - oset
|
||||||
SWI $0xa00125 // sys_sigprocmask
|
SWI $0xa00125 // sys_sigprocmask
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
MOVW.CS R8, (R8)
|
MOVW.CS R8, (R8)
|
||||||
@ -193,9 +193,9 @@ TEXT runtime·sigreturn_tramp(SB),NOSPLIT,$-4
|
|||||||
B -2(PC) // continue exit
|
B -2(PC) // continue exit
|
||||||
|
|
||||||
TEXT runtime·sigaction(SB),NOSPLIT,$4
|
TEXT runtime·sigaction(SB),NOSPLIT,$4
|
||||||
MOVW 0(FP), R0 // arg 1 - signum
|
MOVW sig+0(FP), R0 // arg 1 - signum
|
||||||
MOVW 4(FP), R1 // arg 2 - nsa
|
MOVW new+4(FP), R1 // arg 2 - nsa
|
||||||
MOVW 8(FP), R2 // arg 3 - osa
|
MOVW old+8(FP), R2 // arg 3 - osa
|
||||||
MOVW $runtime·sigreturn_tramp(SB), R3 // arg 4 - tramp
|
MOVW $runtime·sigreturn_tramp(SB), R3 // arg 4 - tramp
|
||||||
MOVW $2, R4 // arg 5 - vers
|
MOVW $2, R4 // arg 5 - vers
|
||||||
MOVW R4, 4(R13)
|
MOVW R4, 4(R13)
|
||||||
@ -242,15 +242,15 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$24
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·mmap(SB),NOSPLIT,$12
|
TEXT runtime·mmap(SB),NOSPLIT,$12
|
||||||
MOVW 0(FP), R0 // arg 1 - addr
|
MOVW addr+0(FP), R0 // arg 1 - addr
|
||||||
MOVW 4(FP), R1 // arg 2 - len
|
MOVW n+4(FP), R1 // arg 2 - len
|
||||||
MOVW 8(FP), R2 // arg 3 - prot
|
MOVW prot+8(FP), R2 // arg 3 - prot
|
||||||
MOVW 12(FP), R3 // arg 4 - flags
|
MOVW flags+12(FP), R3 // arg 4 - flags
|
||||||
// arg 5 (fid) and arg6 (offset_lo, offset_hi) are passed on stack
|
// arg 5 (fid) and arg6 (offset_lo, offset_hi) are passed on stack
|
||||||
// note the C runtime only passes the 32-bit offset_lo to us
|
// note the C runtime only passes the 32-bit offset_lo to us
|
||||||
MOVW 16(FP), R4 // arg 5
|
MOVW fd+16(FP), R4 // arg 5
|
||||||
MOVW R4, 4(R13)
|
MOVW R4, 4(R13)
|
||||||
MOVW 20(FP), R5 // arg 6 lower 32-bit
|
MOVW off+20(FP), R5 // arg 6 lower 32-bit
|
||||||
MOVW R5, 8(R13)
|
MOVW R5, 8(R13)
|
||||||
MOVW $0, R6 // higher 32-bit for arg 6
|
MOVW $0, R6 // higher 32-bit for arg 6
|
||||||
MOVW R6, 12(R13)
|
MOVW R6, 12(R13)
|
||||||
@ -261,37 +261,37 @@ TEXT runtime·mmap(SB),NOSPLIT,$12
|
|||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·munmap(SB),NOSPLIT,$0
|
TEXT runtime·munmap(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 - addr
|
MOVW addr+0(FP), R0 // arg 1 - addr
|
||||||
MOVW 4(FP), R1 // arg 2 - len
|
MOVW n+4(FP), R1 // arg 2 - len
|
||||||
SWI $0xa00049 // sys_munmap
|
SWI $0xa00049 // sys_munmap
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
MOVW.CS R8, (R8)
|
MOVW.CS R8, (R8)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·madvise(SB),NOSPLIT,$0
|
TEXT runtime·madvise(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // arg 1 - addr
|
MOVW addr+0(FP), R0 // arg 1 - addr
|
||||||
MOVW 4(FP), R1 // arg 2 - len
|
MOVW n+4(FP), R1 // arg 2 - len
|
||||||
MOVW 8(FP), R2 // arg 3 - behav
|
MOVW flags+8(FP), R2 // arg 3 - behav
|
||||||
SWI $0xa0004b // sys_madvise
|
SWI $0xa0004b // sys_madvise
|
||||||
// ignore failure - maybe pages are locked
|
// ignore failure - maybe pages are locked
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·sigaltstack(SB),NOSPLIT,$-4
|
TEXT runtime·sigaltstack(SB),NOSPLIT,$-4
|
||||||
MOVW 0(FP), R0 // arg 1 - nss
|
MOVW new+0(FP), R0 // arg 1 - nss
|
||||||
MOVW 4(FP), R1 // arg 2 - oss
|
MOVW old+4(FP), R1 // arg 2 - oss
|
||||||
SWI $0xa00119 // sys___sigaltstack14
|
SWI $0xa00119 // sys___sigaltstack14
|
||||||
MOVW.CS $0, R8 // crash on syscall failure
|
MOVW.CS $0, R8 // crash on syscall failure
|
||||||
MOVW.CS R8, (R8)
|
MOVW.CS R8, (R8)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT runtime·sysctl(SB),NOSPLIT,$8
|
TEXT runtime·sysctl(SB),NOSPLIT,$8
|
||||||
MOVW 0(FP), R0 // arg 1 - name
|
MOVW mib+0(FP), R0 // arg 1 - name
|
||||||
MOVW 4(FP), R1 // arg 2 - namelen
|
MOVW miblen+4(FP), R1 // arg 2 - namelen
|
||||||
MOVW 8(FP), R2 // arg 3 - oldp
|
MOVW out+8(FP), R2 // arg 3 - oldp
|
||||||
MOVW 12(FP), R3 // arg 4 - oldlenp
|
MOVW size+12(FP), R3 // arg 4 - oldlenp
|
||||||
MOVW 16(FP), R4 // arg 5 - newp
|
MOVW dst+16(FP), R4 // arg 5 - newp
|
||||||
MOVW R4, 4(R13)
|
MOVW R4, 4(R13)
|
||||||
MOVW 20(FP), R4 // arg 6 - newlen
|
MOVW ndst+20(FP), R4 // arg 6 - newlen
|
||||||
MOVW R4, 8(R13)
|
MOVW R4, 8(R13)
|
||||||
ADD $4, R13 // pass arg 5 and 6 on stack
|
ADD $4, R13 // pass arg 5 and 6 on stack
|
||||||
SWI $0xa000ca // sys___sysctl
|
SWI $0xa000ca // sys___sysctl
|
||||||
@ -308,13 +308,13 @@ TEXT runtime·kqueue(SB),NOSPLIT,$0
|
|||||||
|
|
||||||
// int32 runtime·kevent(int kq, Kevent *changelist, int nchanges, Kevent *eventlist, int nevents, Timespec *timeout)
|
// int32 runtime·kevent(int kq, Kevent *changelist, int nchanges, Kevent *eventlist, int nevents, Timespec *timeout)
|
||||||
TEXT runtime·kevent(SB),NOSPLIT,$8
|
TEXT runtime·kevent(SB),NOSPLIT,$8
|
||||||
MOVW 0(FP), R0 // kq
|
MOVW kq+0(FP), R0 // kq
|
||||||
MOVW 4(FP), R1 // changelist
|
MOVW ch+4(FP), R1 // changelist
|
||||||
MOVW 8(FP), R2 // nchanges
|
MOVW nch+8(FP), R2 // nchanges
|
||||||
MOVW 12(FP), R3 // eventlist
|
MOVW ev+12(FP), R3 // eventlist
|
||||||
MOVW 16(FP), R4 // nevents
|
MOVW nev+16(FP), R4 // nevents
|
||||||
MOVW R4, 4(R13)
|
MOVW R4, 4(R13)
|
||||||
MOVW 20(FP), R4 // timeout
|
MOVW ts+20(FP), R4 // timeout
|
||||||
MOVW R4, 8(R13)
|
MOVW R4, 8(R13)
|
||||||
ADD $4, R13 // pass arg 5 and 6 on stack
|
ADD $4, R13 // pass arg 5 and 6 on stack
|
||||||
SWI $0xa001b3 // sys___kevent50
|
SWI $0xa001b3 // sys___kevent50
|
||||||
@ -325,7 +325,7 @@ TEXT runtime·kevent(SB),NOSPLIT,$8
|
|||||||
|
|
||||||
// void runtime·closeonexec(int32 fd)
|
// void runtime·closeonexec(int32 fd)
|
||||||
TEXT runtime·closeonexec(SB),NOSPLIT,$0
|
TEXT runtime·closeonexec(SB),NOSPLIT,$0
|
||||||
MOVW 0(FP), R0 // fd
|
MOVW fd+0(FP), R0 // fd
|
||||||
MOVW $2, R1 // F_SETFD
|
MOVW $2, R1 // F_SETFD
|
||||||
MOVW $1, R2 // FD_CLOEXEC
|
MOVW $1, R2 // FD_CLOEXEC
|
||||||
SWI $0xa0005c // sys_fcntl
|
SWI $0xa0005c // sys_fcntl
|
||||||
|
@ -15,116 +15,116 @@
|
|||||||
|
|
||||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||||
BL runtime·entersyscall(SB)
|
BL runtime·entersyscall(SB)
|
||||||
MOVW 0(FP), R7 // syscall number
|
MOVW trap+0(FP), R7 // syscall number
|
||||||
MOVW 4(FP), R0 // a1
|
MOVW a1+4(FP), R0 // a1
|
||||||
MOVW 8(FP), R1 // a2
|
MOVW a2+8(FP), R1 // a2
|
||||||
MOVW 12(FP), R2 // a3
|
MOVW a3+12(FP), R2 // a3
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS error
|
BCS error
|
||||||
MOVW R0, 16(FP) // r1
|
MOVW R0, r1+16(FP) // r1
|
||||||
MOVW R1, 20(FP) // r2
|
MOVW R1, r2+20(FP) // r2
|
||||||
MOVW R2, 24(FP) // errno
|
MOVW R2, err+24(FP) // errno
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
error:
|
error:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 16(FP) // r1
|
MOVW R3, r1+16(FP) // r1
|
||||||
MOVW R2, 20(FP) // r2
|
MOVW R2, r2+20(FP) // r2
|
||||||
MOVW R0, 24(FP) // errno
|
MOVW R0, err+24(FP) // errno
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||||
BL runtime·entersyscall(SB)
|
BL runtime·entersyscall(SB)
|
||||||
MOVW 0(FP), R7 // syscall number
|
MOVW trap+0(FP), R7 // syscall number
|
||||||
MOVW 4(FP), R0 // a1
|
MOVW a1+4(FP), R0 // a1
|
||||||
MOVW 8(FP), R1 // a2
|
MOVW a2+8(FP), R1 // a2
|
||||||
MOVW 12(FP), R2 // a3
|
MOVW a3+12(FP), R2 // a3
|
||||||
MOVW 16(FP), R3 // a4
|
MOVW a4+16(FP), R3 // a4
|
||||||
MOVW R13, R4
|
MOVW R13, R4
|
||||||
MOVW $20(FP), R13 // a5 to a6 are passed on stack
|
MOVW $a5+20(FP), R13 // a5 to a6 are passed on stack
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW R4, R13
|
MOVW R4, R13
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS error6
|
BCS error6
|
||||||
MOVW R0, 28(FP) // r1
|
MOVW R0, r1+28(FP) // r1
|
||||||
MOVW R1, 32(FP) // r2
|
MOVW R1, r2+32(FP) // r2
|
||||||
MOVW R2, 36(FP) // errno
|
MOVW R2, err+36(FP) // errno
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
error6:
|
error6:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 28(FP) // r1
|
MOVW R3, r1+28(FP) // r1
|
||||||
MOVW R2, 32(FP) // r2
|
MOVW R2, r2+32(FP) // r2
|
||||||
MOVW R0, 36(FP) // errno
|
MOVW R0, err+36(FP) // errno
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||||
BL runtime·entersyscall(SB)
|
BL runtime·entersyscall(SB)
|
||||||
MOVW 0(FP), R7 // syscall number
|
MOVW num+0(FP), R7 // syscall number
|
||||||
MOVW 4(FP), R0 // a1
|
MOVW a1+4(FP), R0 // a1
|
||||||
MOVW 8(FP), R1 // a2
|
MOVW a2+8(FP), R1 // a2
|
||||||
MOVW 12(FP), R2 // a3
|
MOVW a3+12(FP), R2 // a3
|
||||||
MOVW 16(FP), R3 // a4
|
MOVW a4+16(FP), R3 // a4
|
||||||
MOVW R13, R4
|
MOVW R13, R4
|
||||||
MOVW $20(FP), R13 // a5 to a9 are passed on stack
|
MOVW $a5+20(FP), R13 // a5 to a9 are passed on stack
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW R4, R13
|
MOVW R4, R13
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS error9
|
BCS error9
|
||||||
MOVW R0, 40(FP) // r1
|
MOVW R0, r1+40(FP) // r1
|
||||||
MOVW R1, 44(FP) // r2
|
MOVW R1, r2+44(FP) // r2
|
||||||
MOVW R2, 48(FP) // errno
|
MOVW R2, err+48(FP) // errno
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
error9:
|
error9:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 40(FP) // r1
|
MOVW R3, r1+40(FP) // r1
|
||||||
MOVW R2, 44(FP) // r2
|
MOVW R2, r2+44(FP) // r2
|
||||||
MOVW R0, 48(FP) // errno
|
MOVW R0, err+48(FP) // errno
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||||
MOVW 0(FP), R7 // syscall number
|
MOVW trap+0(FP), R7 // syscall number
|
||||||
MOVW 4(FP), R0 // a1
|
MOVW a1+4(FP), R0 // a1
|
||||||
MOVW 8(FP), R1 // a2
|
MOVW a2+8(FP), R1 // a2
|
||||||
MOVW 12(FP), R2 // a3
|
MOVW a3+12(FP), R2 // a3
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS errorr
|
BCS errorr
|
||||||
MOVW R0, 16(FP) // r1
|
MOVW R0, r1+16(FP) // r1
|
||||||
MOVW R1, 20(FP) // r2
|
MOVW R1, r2+20(FP) // r2
|
||||||
MOVW R2, 24(FP) // errno
|
MOVW R2, err+24(FP) // errno
|
||||||
RET
|
RET
|
||||||
errorr:
|
errorr:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 16(FP) // r1
|
MOVW R3, r1+16(FP) // r1
|
||||||
MOVW R2, 20(FP) // r2
|
MOVW R2, r2+20(FP) // r2
|
||||||
MOVW R0, 24(FP) // errno
|
MOVW R0, err+24(FP) // errno
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||||
MOVW 0(FP), R7 // syscall number
|
MOVW trap+0(FP), R7 // syscall number
|
||||||
MOVW 4(FP), R0 // a1
|
MOVW a1+4(FP), R0 // a1
|
||||||
MOVW 8(FP), R1 // a2
|
MOVW a2+8(FP), R1 // a2
|
||||||
MOVW 12(FP), R2 // a3
|
MOVW a3+12(FP), R2 // a3
|
||||||
MOVW 16(FP), R3 // a4
|
MOVW a4+16(FP), R3 // a4
|
||||||
MOVW R13, R4
|
MOVW R13, R4
|
||||||
MOVW $20(FP), R13 // a5 to a6 are passed on stack
|
MOVW $a5+20(FP), R13 // a5 to a6 are passed on stack
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW R4, R13
|
MOVW R4, R13
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS errorr6
|
BCS errorr6
|
||||||
MOVW R0, 28(FP) // r1
|
MOVW R0, r1+28(FP) // r1
|
||||||
MOVW R1, 32(FP) // r2
|
MOVW R1, r2+32(FP) // r2
|
||||||
MOVW R2, 36(FP) // errno
|
MOVW R2, err+36(FP) // errno
|
||||||
RET
|
RET
|
||||||
errorr6:
|
errorr6:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 28(FP) // r1
|
MOVW R3, r1+28(FP) // r1
|
||||||
MOVW R2, 32(FP) // r2
|
MOVW R2, r2+32(FP) // r2
|
||||||
MOVW R0, 36(FP) // errno
|
MOVW R0, err+36(FP) // errno
|
||||||
RET
|
RET
|
||||||
|
@ -15,113 +15,113 @@
|
|||||||
|
|
||||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||||
BL runtime·entersyscall(SB)
|
BL runtime·entersyscall(SB)
|
||||||
MOVW 0(FP), R0 // sigcall num
|
MOVW trap+0(FP), R0 // sigcall num
|
||||||
MOVW 4(FP), R1 // a1
|
MOVW a1+4(FP), R1 // a1
|
||||||
MOVW 8(FP), R2 // a2
|
MOVW a2+8(FP), R2 // a2
|
||||||
MOVW 12(FP), R3 // a3
|
MOVW a3+12(FP), R3 // a3
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS error
|
BCS error
|
||||||
MOVW R0, 16(FP) // r1
|
MOVW R0, r1+16(FP) // r1
|
||||||
MOVW R1, 20(FP) // r2
|
MOVW R1, r2+20(FP) // r2
|
||||||
MOVW R2, 24(FP) // err
|
MOVW R2, err+24(FP) // err
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
error:
|
error:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 16(FP) // r1
|
MOVW R3, r1+16(FP) // r1
|
||||||
MOVW R2, 20(FP) // r2
|
MOVW R2, r2+20(FP) // r2
|
||||||
MOVW R0, 24(FP) // err
|
MOVW R0, err+24(FP) // err
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||||
BL runtime·entersyscall(SB)
|
BL runtime·entersyscall(SB)
|
||||||
MOVW 0(FP), R0 // sigcall num
|
MOVW trap+0(FP), R0 // sigcall num
|
||||||
MOVW 4(FP), R1 // a1
|
MOVW a1+4(FP), R1 // a1
|
||||||
MOVW 8(FP), R2 // a2
|
MOVW a2+8(FP), R2 // a2
|
||||||
MOVW 12(FP), R3 // a3
|
MOVW a3+12(FP), R3 // a3
|
||||||
MOVW R13, R4
|
MOVW R13, R4
|
||||||
MOVW $16(FP), R13 // a4 to a6 are passed on stack
|
MOVW $a4+16(FP), R13 // a4 to a6 are passed on stack
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW R4, R13
|
MOVW R4, R13
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS error6
|
BCS error6
|
||||||
MOVW R0, 28(FP) // r1
|
MOVW R0, r1+28(FP) // r1
|
||||||
MOVW R1, 32(FP) // r2
|
MOVW R1, r2+32(FP) // r2
|
||||||
MOVW R2, 36(FP) // err
|
MOVW R2, err+36(FP) // err
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
error6:
|
error6:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 28(FP) // r1
|
MOVW R3, r1+28(FP) // r1
|
||||||
MOVW R2, 32(FP) // r2
|
MOVW R2, r2+32(FP) // r2
|
||||||
MOVW R0, 36(FP) // err
|
MOVW R0, err+36(FP) // err
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||||
BL runtime·entersyscall(SB)
|
BL runtime·entersyscall(SB)
|
||||||
MOVW 0(FP), R0 // sigcall num
|
MOVW trap+0(FP), R0 // sigcall num
|
||||||
MOVW 4(FP), R1 // a1
|
MOVW a1+4(FP), R1 // a1
|
||||||
MOVW 8(FP), R2 // a2
|
MOVW a2+8(FP), R2 // a2
|
||||||
MOVW 12(FP), R3 // a3
|
MOVW a3+12(FP), R3 // a3
|
||||||
MOVW R13, R4
|
MOVW R13, R4
|
||||||
MOVW $16(FP), R13 // a4 to a9 are passed on stack
|
MOVW $a4+16(FP), R13 // a4 to a9 are passed on stack
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW R4, R13
|
MOVW R4, R13
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS error9
|
BCS error9
|
||||||
MOVW R0, 40(FP) // r1
|
MOVW R0, r1+40(FP) // r1
|
||||||
MOVW R1, 44(FP) // r2
|
MOVW R1, r2+44(FP) // r2
|
||||||
MOVW R2, 48(FP) // err
|
MOVW R2, err+48(FP) // err
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
error9:
|
error9:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 40(FP) // r1
|
MOVW R3, r1+40(FP) // r1
|
||||||
MOVW R2, 44(FP) // r2
|
MOVW R2, r2+44(FP) // r2
|
||||||
MOVW R0, 48(FP) // err
|
MOVW R0, err+48(FP) // err
|
||||||
BL runtime·exitsyscall(SB)
|
BL runtime·exitsyscall(SB)
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||||
MOVW 0(FP), R0 // sigcall num
|
MOVW trap+0(FP), R0 // sigcall num
|
||||||
MOVW 4(FP), R1 // a1
|
MOVW a1+4(FP), R1 // a1
|
||||||
MOVW 8(FP), R2 // a2
|
MOVW a2+8(FP), R2 // a2
|
||||||
MOVW 12(FP), R3 // a3
|
MOVW a3+12(FP), R3 // a3
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS errorr
|
BCS errorr
|
||||||
MOVW R0, 16(FP) // r1
|
MOVW R0, r1+16(FP) // r1
|
||||||
MOVW R1, 20(FP) // r2
|
MOVW R1, r2+20(FP) // r2
|
||||||
MOVW R2, 24(FP) // err
|
MOVW R2, err+24(FP) // err
|
||||||
RET
|
RET
|
||||||
errorr:
|
errorr:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 16(FP) // r1
|
MOVW R3, r1+16(FP) // r1
|
||||||
MOVW R2, 20(FP) // r2
|
MOVW R2, r2+20(FP) // r2
|
||||||
MOVW R0, 24(FP) // err
|
MOVW R0, err+24(FP) // err
|
||||||
RET
|
RET
|
||||||
|
|
||||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||||
MOVW 0(FP), R0 // sigcall num
|
MOVW trap+0(FP), R0 // sigcall num
|
||||||
MOVW 4(FP), R1 // a1
|
MOVW a1+4(FP), R1 // a1
|
||||||
MOVW 8(FP), R2 // a2
|
MOVW a2+8(FP), R2 // a2
|
||||||
MOVW 12(FP), R3 // a3
|
MOVW a3+12(FP), R3 // a3
|
||||||
MOVW R13, R4
|
MOVW R13, R4
|
||||||
MOVW $16(FP), R13 // a4 to a9 are passed on stack
|
MOVW $a4+16(FP), R13 // a4 to a9 are passed on stack
|
||||||
SWI $0 // syscall
|
SWI $0 // syscall
|
||||||
MOVW R4, R13
|
MOVW R4, R13
|
||||||
MOVW $0, R2
|
MOVW $0, R2
|
||||||
BCS errorr6
|
BCS errorr6
|
||||||
MOVW R0, 28(FP) // r1
|
MOVW R0, r1+28(FP) // r1
|
||||||
MOVW R1, 32(FP) // r2
|
MOVW R1, r2+32(FP) // r2
|
||||||
MOVW R2, 36(FP) // err
|
MOVW R2, err+36(FP) // err
|
||||||
RET
|
RET
|
||||||
errorr6:
|
errorr6:
|
||||||
MOVW $-1, R3
|
MOVW $-1, R3
|
||||||
MOVW R3, 28(FP) // r1
|
MOVW R3, r1+28(FP) // r1
|
||||||
MOVW R2, 32(FP) // r2
|
MOVW R2, r2+32(FP) // r2
|
||||||
MOVW R0, 36(FP) // err
|
MOVW R0, err+36(FP) // err
|
||||||
RET
|
RET
|
||||||
|
Loading…
Reference in New Issue
Block a user