mirror of
https://github.com/golang/go
synced 2024-11-12 09:50:21 -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)
|
||||
|
||||
TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0
|
||||
MOVW 4(FP), R1
|
||||
MOVW 8(FP), R2
|
||||
MOVW 12(FP), R3
|
||||
MOVW addr+0(FP), R0
|
||||
MOVW mode+4(FP), R1
|
||||
MOVW val+8(FP), R2
|
||||
MOVW ptr2+12(FP), R3
|
||||
ADD $20, R13 // arg 5 is passed on stack
|
||||
MOVW $SYS__umtx_op, R7
|
||||
SWI $0
|
||||
@ -53,8 +53,8 @@ TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
|
||||
RET
|
||||
|
||||
TEXT runtime·thr_new(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0
|
||||
MOVW 4(FP), R1
|
||||
MOVW param+0(FP), R0
|
||||
MOVW size+4(FP), R1
|
||||
MOVW $SYS_thr_new, R7
|
||||
SWI $0
|
||||
RET
|
||||
@ -72,7 +72,7 @@ TEXT runtime·thr_start(SB),NOSPLIT,$0
|
||||
|
||||
// Exit the entire program (like C exit)
|
||||
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
|
||||
SWI $0
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
@ -80,7 +80,7 @@ TEXT runtime·exit(SB),NOSPLIT,$-8
|
||||
RET
|
||||
|
||||
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
|
||||
SWI $0
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
@ -88,42 +88,42 @@ TEXT runtime·exit1(SB),NOSPLIT,$-8
|
||||
RET
|
||||
|
||||
TEXT runtime·open(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0 // arg 1 name
|
||||
MOVW 4(FP), R1 // arg 2 mode
|
||||
MOVW 8(FP), R2 // arg 3 perm
|
||||
MOVW name+0(FP), R0 // arg 1 name
|
||||
MOVW mode+4(FP), R1 // arg 2 mode
|
||||
MOVW perm+8(FP), R2 // arg 3 perm
|
||||
MOVW $SYS_open, R7
|
||||
SWI $0
|
||||
MOVW R0, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·read(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0 // arg 1 fd
|
||||
MOVW 4(FP), R1 // arg 2 buf
|
||||
MOVW 8(FP), R2 // arg 3 count
|
||||
MOVW fd+0(FP), R0 // arg 1 fd
|
||||
MOVW p+4(FP), R1 // arg 2 buf
|
||||
MOVW n+8(FP), R2 // arg 3 count
|
||||
MOVW $SYS_read, R7
|
||||
SWI $0
|
||||
MOVW R0, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·write(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0 // arg 1 fd
|
||||
MOVW 4(FP), R1 // arg 2 buf
|
||||
MOVW 8(FP), R2 // arg 3 count
|
||||
MOVW fd+0(FP), R0 // arg 1 fd
|
||||
MOVW p+4(FP), R1 // arg 2 buf
|
||||
MOVW n+8(FP), R2 // arg 3 count
|
||||
MOVW $SYS_write, R7
|
||||
SWI $0
|
||||
MOVW R0, ret+12(FP)
|
||||
RET
|
||||
|
||||
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
|
||||
SWI $0
|
||||
MOVW R0, ret+4(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·getrlimit(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0
|
||||
MOVW 4(FP), R1
|
||||
MOVW kind+0(FP), R0
|
||||
MOVW limit+4(FP), R1
|
||||
MOVW $SYS_getrlimit, R7
|
||||
SWI $0
|
||||
MOVW R0, ret+8(FP)
|
||||
@ -142,9 +142,9 @@ TEXT runtime·raise(SB),NOSPLIT,$8
|
||||
RET
|
||||
|
||||
TEXT runtime·setitimer(SB), NOSPLIT, $-8
|
||||
MOVW 0(FP), R0
|
||||
MOVW 4(FP), R1
|
||||
MOVW 8(FP), R2
|
||||
MOVW mode+0(FP), R0
|
||||
MOVW new+4(FP), R1
|
||||
MOVW old+8(FP), R2
|
||||
MOVW $SYS_setitimer, R7
|
||||
SWI $0
|
||||
RET
|
||||
@ -160,9 +160,9 @@ TEXT time·now(SB), NOSPLIT, $32
|
||||
MOVW 12(R13), R1 // sec.high
|
||||
MOVW 16(R13), R2 // nsec
|
||||
|
||||
MOVW R0, 0(FP)
|
||||
MOVW R1, 4(FP)
|
||||
MOVW R2, 8(FP)
|
||||
MOVW R0, sec_lo+0(FP)
|
||||
MOVW R1, sec_hi+4(FP)
|
||||
MOVW R2, nsec+8(FP)
|
||||
RET
|
||||
|
||||
// int64 nanotime(void) so really
|
||||
@ -190,9 +190,9 @@ TEXT runtime·nanotime(SB), NOSPLIT, $32
|
||||
RET
|
||||
|
||||
TEXT runtime·sigaction(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0 // arg 1 sig
|
||||
MOVW 4(FP), R1 // arg 2 act
|
||||
MOVW 8(FP), R2 // arg 3 oact
|
||||
MOVW sig+0(FP), R0 // arg 1 sig
|
||||
MOVW new+4(FP), R1 // arg 2 act
|
||||
MOVW old+8(FP), R2 // arg 3 oact
|
||||
MOVW $SYS_sigaction, R7
|
||||
SWI $0
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
@ -235,15 +235,15 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$24
|
||||
RET
|
||||
|
||||
TEXT runtime·mmap(SB),NOSPLIT,$16
|
||||
MOVW 0(FP), R0 // arg 1 addr
|
||||
MOVW 4(FP), R1 // arg 2 len
|
||||
MOVW 8(FP), R2 // arg 3 prot
|
||||
MOVW 12(FP), R3 // arg 4 flags
|
||||
MOVW addr+0(FP), R0 // arg 1 addr
|
||||
MOVW n+4(FP), R1 // arg 2 len
|
||||
MOVW prot+8(FP), R2 // arg 3 prot
|
||||
MOVW flags+12(FP), R3 // arg 4 flags
|
||||
// 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
|
||||
MOVW 16(FP), R4 // arg 5
|
||||
MOVW fd+16(FP), R4 // arg 5
|
||||
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.
|
||||
MOVW R5, 12(R13)
|
||||
MOVW $0, R6 // higher 32-bit for arg 6
|
||||
@ -257,8 +257,8 @@ TEXT runtime·mmap(SB),NOSPLIT,$16
|
||||
RET
|
||||
|
||||
TEXT runtime·munmap(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 addr
|
||||
MOVW 4(FP), R1 // arg 2 len
|
||||
MOVW addr+0(FP), R0 // arg 1 addr
|
||||
MOVW n+4(FP), R1 // arg 2 len
|
||||
MOVW $SYS_munmap, R7
|
||||
SWI $0
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
@ -266,9 +266,9 @@ TEXT runtime·munmap(SB),NOSPLIT,$0
|
||||
RET
|
||||
|
||||
TEXT runtime·madvise(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 addr
|
||||
MOVW 4(FP), R1 // arg 2 len
|
||||
MOVW 8(FP), R2 // arg 3 flags
|
||||
MOVW addr+0(FP), R0 // arg 1 addr
|
||||
MOVW n+4(FP), R1 // arg 2 len
|
||||
MOVW flags+8(FP), R2 // arg 3 flags
|
||||
MOVW $SYS_madvise, R7
|
||||
SWI $0
|
||||
// ignore failure - maybe pages are locked
|
||||
@ -304,10 +304,10 @@ TEXT runtime·usleep(SB),NOSPLIT,$16
|
||||
RET
|
||||
|
||||
TEXT runtime·sysctl(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 - name
|
||||
MOVW 4(FP), R1 // arg 2 - namelen
|
||||
MOVW 8(FP), R2 // arg 3 - old
|
||||
MOVW 12(FP), R3 // arg 4 - oldlenp
|
||||
MOVW mib+0(FP), R0 // arg 1 - name
|
||||
MOVW miblen+4(FP), R1 // arg 2 - namelen
|
||||
MOVW out+8(FP), R2 // arg 3 - old
|
||||
MOVW size+12(FP), R3 // arg 4 - oldlenp
|
||||
// arg 5 (newp) and arg 6 (newlen) are passed on stack
|
||||
ADD $20, R13
|
||||
MOVW $SYS___sysctl, R7
|
||||
@ -324,8 +324,8 @@ TEXT runtime·osyield(SB),NOSPLIT,$-4
|
||||
|
||||
TEXT runtime·sigprocmask(SB),NOSPLIT,$0
|
||||
MOVW $3, R0 // arg 1 - how (SIG_SETMASK)
|
||||
MOVW 0(FP), R1 // arg 2 - set
|
||||
MOVW 4(FP), R2 // arg 3 - oset
|
||||
MOVW new+0(FP), R1 // arg 2 - set
|
||||
MOVW old+4(FP), R2 // arg 3 - oset
|
||||
MOVW $SYS_sigprocmask, R7
|
||||
SWI $0
|
||||
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)
|
||||
TEXT runtime·kevent(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // kq
|
||||
MOVW 4(FP), R1 // changelist
|
||||
MOVW 8(FP), R2 // nchanges
|
||||
MOVW 12(FP), R3 // eventlist
|
||||
MOVW kq+0(FP), R0 // kq
|
||||
MOVW ch+4(FP), R1 // changelist
|
||||
MOVW nch+8(FP), R2 // nchanges
|
||||
MOVW ev+12(FP), R3 // eventlist
|
||||
ADD $20, R13 // pass arg 5 and 6 on stack
|
||||
MOVW $SYS_kevent, R7
|
||||
SWI $0
|
||||
@ -356,7 +356,7 @@ TEXT runtime·kevent(SB),NOSPLIT,$0
|
||||
|
||||
// void runtime·closeonexec(int32 fd)
|
||||
TEXT runtime·closeonexec(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // fd
|
||||
MOVW fd+0(FP), R0 // fd
|
||||
MOVW $2, R1 // F_SETFD
|
||||
MOVW $1, R2 // FD_CLOEXEC
|
||||
MOVW $SYS_fcntl, R7
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
// Exit the entire program (like C exit)
|
||||
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
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
MOVW.CS R8, (R8)
|
||||
@ -25,31 +25,31 @@ TEXT runtime·exit1(SB),NOSPLIT,$-4
|
||||
RET
|
||||
|
||||
TEXT runtime·open(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0
|
||||
MOVW 4(FP), R1
|
||||
MOVW 8(FP), R2
|
||||
MOVW name+0(FP), R0
|
||||
MOVW mode+4(FP), R1
|
||||
MOVW perm+8(FP), R2
|
||||
SWI $0xa00005
|
||||
MOVW R0, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·close(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0
|
||||
MOVW fd+0(FP), R0
|
||||
SWI $0xa00006
|
||||
MOVW R0, ret+4(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·read(SB),NOSPLIT,$-8
|
||||
MOVW 0(FP), R0
|
||||
MOVW 4(FP), R1
|
||||
MOVW 8(FP), R2
|
||||
MOVW fd+0(FP), R0
|
||||
MOVW p+4(FP), R1
|
||||
MOVW n+8(FP), R2
|
||||
SWI $0xa00003
|
||||
MOVW R0, ret+12(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·write(SB),NOSPLIT,$-4
|
||||
MOVW 0(FP), R0 // arg 1 - fd
|
||||
MOVW 4(FP), R1 // arg 2 - buf
|
||||
MOVW 8(FP), R2 // arg 3 - nbyte
|
||||
MOVW fd+0(FP), R0 // arg 1 - fd
|
||||
MOVW p+4(FP), R1 // arg 2 - buf
|
||||
MOVW n+8(FP), R2 // arg 3 - nbyte
|
||||
SWI $0xa00004 // sys_write
|
||||
MOVW R0, ret+12(FP)
|
||||
RET
|
||||
@ -68,17 +68,17 @@ TEXT runtime·osyield(SB),NOSPLIT,$0
|
||||
RET
|
||||
|
||||
TEXT runtime·lwp_park(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 - abstime
|
||||
MOVW 4(FP), R1 // arg 2 - unpark
|
||||
MOVW 8(FP), R2 // arg 3 - hint
|
||||
MOVW 12(FP), R3 // arg 4 - unparkhint
|
||||
MOVW abstime+0(FP), R0 // arg 1 - abstime
|
||||
MOVW unpark+4(FP), R1 // arg 2 - unpark
|
||||
MOVW hint+8(FP), R2 // arg 3 - hint
|
||||
MOVW unparkhint+12(FP), R3 // arg 4 - unparkhint
|
||||
SWI $0xa001b2 // sys__lwp_park
|
||||
MOVW R0, ret+16(FP)
|
||||
RET
|
||||
|
||||
TEXT runtime·lwp_unpark(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 - lwp
|
||||
MOVW 4(FP), R1 // arg 2 - hint
|
||||
MOVW lwp+0(FP), R0 // arg 1 - lwp
|
||||
MOVW hint+4(FP), R1 // arg 2 - hint
|
||||
SWI $0xa00141 // sys__lwp_unpark
|
||||
MOVW R0, ret+8(FP)
|
||||
RET
|
||||
@ -124,9 +124,9 @@ TEXT runtime·raise(SB),NOSPLIT,$16
|
||||
RET
|
||||
|
||||
TEXT runtime·setitimer(SB),NOSPLIT,$-4
|
||||
MOVW 0(FP), R0 // arg 1 - which
|
||||
MOVW 4(FP), R1 // arg 2 - itv
|
||||
MOVW 8(FP), R2 // arg 3 - oitv
|
||||
MOVW mode+0(FP), R0 // arg 1 - which
|
||||
MOVW new+4(FP), R1 // arg 2 - itv
|
||||
MOVW old+8(FP), R2 // arg 3 - oitv
|
||||
SWI $0xa001a9 // sys_setitimer
|
||||
RET
|
||||
|
||||
@ -140,9 +140,9 @@ TEXT time·now(SB), NOSPLIT, $32
|
||||
MOVW 12(R13), R1 // sec.high
|
||||
MOVW 16(R13), R2 // nsec
|
||||
|
||||
MOVW R0, 0(FP)
|
||||
MOVW R1, 4(FP)
|
||||
MOVW R2, 8(FP)
|
||||
MOVW R0, sec_lo+0(FP)
|
||||
MOVW R1, sec_hi+4(FP)
|
||||
MOVW R2, nsec+8(FP)
|
||||
RET
|
||||
|
||||
// int64 nanotime(void) so really
|
||||
@ -167,16 +167,16 @@ TEXT runtime·nanotime(SB), NOSPLIT, $32
|
||||
RET
|
||||
|
||||
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
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
MOVW.CS R8, (R8)
|
||||
RET
|
||||
|
||||
TEXT runtime·sigprocmask(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 - how
|
||||
MOVW 4(FP), R1 // arg 2 - set
|
||||
MOVW 8(FP), R2 // arg 3 - oset
|
||||
MOVW mode+0(FP), R0 // arg 1 - how
|
||||
MOVW new+4(FP), R1 // arg 2 - set
|
||||
MOVW old+8(FP), R2 // arg 3 - oset
|
||||
SWI $0xa00125 // sys_sigprocmask
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
MOVW.CS R8, (R8)
|
||||
@ -193,9 +193,9 @@ TEXT runtime·sigreturn_tramp(SB),NOSPLIT,$-4
|
||||
B -2(PC) // continue exit
|
||||
|
||||
TEXT runtime·sigaction(SB),NOSPLIT,$4
|
||||
MOVW 0(FP), R0 // arg 1 - signum
|
||||
MOVW 4(FP), R1 // arg 2 - nsa
|
||||
MOVW 8(FP), R2 // arg 3 - osa
|
||||
MOVW sig+0(FP), R0 // arg 1 - signum
|
||||
MOVW new+4(FP), R1 // arg 2 - nsa
|
||||
MOVW old+8(FP), R2 // arg 3 - osa
|
||||
MOVW $runtime·sigreturn_tramp(SB), R3 // arg 4 - tramp
|
||||
MOVW $2, R4 // arg 5 - vers
|
||||
MOVW R4, 4(R13)
|
||||
@ -242,15 +242,15 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$24
|
||||
RET
|
||||
|
||||
TEXT runtime·mmap(SB),NOSPLIT,$12
|
||||
MOVW 0(FP), R0 // arg 1 - addr
|
||||
MOVW 4(FP), R1 // arg 2 - len
|
||||
MOVW 8(FP), R2 // arg 3 - prot
|
||||
MOVW 12(FP), R3 // arg 4 - flags
|
||||
MOVW addr+0(FP), R0 // arg 1 - addr
|
||||
MOVW n+4(FP), R1 // arg 2 - len
|
||||
MOVW prot+8(FP), R2 // arg 3 - prot
|
||||
MOVW flags+12(FP), R3 // arg 4 - flags
|
||||
// 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
|
||||
MOVW 16(FP), R4 // arg 5
|
||||
MOVW fd+16(FP), R4 // arg 5
|
||||
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 $0, R6 // higher 32-bit for arg 6
|
||||
MOVW R6, 12(R13)
|
||||
@ -261,37 +261,37 @@ TEXT runtime·mmap(SB),NOSPLIT,$12
|
||||
RET
|
||||
|
||||
TEXT runtime·munmap(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 - addr
|
||||
MOVW 4(FP), R1 // arg 2 - len
|
||||
MOVW addr+0(FP), R0 // arg 1 - addr
|
||||
MOVW n+4(FP), R1 // arg 2 - len
|
||||
SWI $0xa00049 // sys_munmap
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
MOVW.CS R8, (R8)
|
||||
RET
|
||||
|
||||
TEXT runtime·madvise(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // arg 1 - addr
|
||||
MOVW 4(FP), R1 // arg 2 - len
|
||||
MOVW 8(FP), R2 // arg 3 - behav
|
||||
MOVW addr+0(FP), R0 // arg 1 - addr
|
||||
MOVW n+4(FP), R1 // arg 2 - len
|
||||
MOVW flags+8(FP), R2 // arg 3 - behav
|
||||
SWI $0xa0004b // sys_madvise
|
||||
// ignore failure - maybe pages are locked
|
||||
RET
|
||||
|
||||
TEXT runtime·sigaltstack(SB),NOSPLIT,$-4
|
||||
MOVW 0(FP), R0 // arg 1 - nss
|
||||
MOVW 4(FP), R1 // arg 2 - oss
|
||||
MOVW new+0(FP), R0 // arg 1 - nss
|
||||
MOVW old+4(FP), R1 // arg 2 - oss
|
||||
SWI $0xa00119 // sys___sigaltstack14
|
||||
MOVW.CS $0, R8 // crash on syscall failure
|
||||
MOVW.CS R8, (R8)
|
||||
RET
|
||||
|
||||
TEXT runtime·sysctl(SB),NOSPLIT,$8
|
||||
MOVW 0(FP), R0 // arg 1 - name
|
||||
MOVW 4(FP), R1 // arg 2 - namelen
|
||||
MOVW 8(FP), R2 // arg 3 - oldp
|
||||
MOVW 12(FP), R3 // arg 4 - oldlenp
|
||||
MOVW 16(FP), R4 // arg 5 - newp
|
||||
MOVW mib+0(FP), R0 // arg 1 - name
|
||||
MOVW miblen+4(FP), R1 // arg 2 - namelen
|
||||
MOVW out+8(FP), R2 // arg 3 - oldp
|
||||
MOVW size+12(FP), R3 // arg 4 - oldlenp
|
||||
MOVW dst+16(FP), R4 // arg 5 - newp
|
||||
MOVW R4, 4(R13)
|
||||
MOVW 20(FP), R4 // arg 6 - newlen
|
||||
MOVW ndst+20(FP), R4 // arg 6 - newlen
|
||||
MOVW R4, 8(R13)
|
||||
ADD $4, R13 // pass arg 5 and 6 on stack
|
||||
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)
|
||||
TEXT runtime·kevent(SB),NOSPLIT,$8
|
||||
MOVW 0(FP), R0 // kq
|
||||
MOVW 4(FP), R1 // changelist
|
||||
MOVW 8(FP), R2 // nchanges
|
||||
MOVW 12(FP), R3 // eventlist
|
||||
MOVW 16(FP), R4 // nevents
|
||||
MOVW kq+0(FP), R0 // kq
|
||||
MOVW ch+4(FP), R1 // changelist
|
||||
MOVW nch+8(FP), R2 // nchanges
|
||||
MOVW ev+12(FP), R3 // eventlist
|
||||
MOVW nev+16(FP), R4 // nevents
|
||||
MOVW R4, 4(R13)
|
||||
MOVW 20(FP), R4 // timeout
|
||||
MOVW ts+20(FP), R4 // timeout
|
||||
MOVW R4, 8(R13)
|
||||
ADD $4, R13 // pass arg 5 and 6 on stack
|
||||
SWI $0xa001b3 // sys___kevent50
|
||||
@ -325,7 +325,7 @@ TEXT runtime·kevent(SB),NOSPLIT,$8
|
||||
|
||||
// void runtime·closeonexec(int32 fd)
|
||||
TEXT runtime·closeonexec(SB),NOSPLIT,$0
|
||||
MOVW 0(FP), R0 // fd
|
||||
MOVW fd+0(FP), R0 // fd
|
||||
MOVW $2, R1 // F_SETFD
|
||||
MOVW $1, R2 // FD_CLOEXEC
|
||||
SWI $0xa0005c // sys_fcntl
|
||||
|
@ -15,116 +15,116 @@
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R7 // syscall number
|
||||
MOVW 4(FP), R0 // a1
|
||||
MOVW 8(FP), R1 // a2
|
||||
MOVW 12(FP), R2 // a3
|
||||
MOVW trap+0(FP), R7 // syscall number
|
||||
MOVW a1+4(FP), R0 // a1
|
||||
MOVW a2+8(FP), R1 // a2
|
||||
MOVW a3+12(FP), R2 // a3
|
||||
SWI $0 // syscall
|
||||
MOVW $0, R2
|
||||
BCS error
|
||||
MOVW R0, 16(FP) // r1
|
||||
MOVW R1, 20(FP) // r2
|
||||
MOVW R2, 24(FP) // errno
|
||||
MOVW R0, r1+16(FP) // r1
|
||||
MOVW R1, r2+20(FP) // r2
|
||||
MOVW R2, err+24(FP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
error:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 16(FP) // r1
|
||||
MOVW R2, 20(FP) // r2
|
||||
MOVW R0, 24(FP) // errno
|
||||
MOVW R3, r1+16(FP) // r1
|
||||
MOVW R2, r2+20(FP) // r2
|
||||
MOVW R0, err+24(FP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R7 // syscall number
|
||||
MOVW 4(FP), R0 // a1
|
||||
MOVW 8(FP), R1 // a2
|
||||
MOVW 12(FP), R2 // a3
|
||||
MOVW 16(FP), R3 // a4
|
||||
MOVW trap+0(FP), R7 // syscall number
|
||||
MOVW a1+4(FP), R0 // a1
|
||||
MOVW a2+8(FP), R1 // a2
|
||||
MOVW a3+12(FP), R2 // a3
|
||||
MOVW a4+16(FP), R3 // a4
|
||||
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
|
||||
MOVW R4, R13
|
||||
MOVW $0, R2
|
||||
BCS error6
|
||||
MOVW R0, 28(FP) // r1
|
||||
MOVW R1, 32(FP) // r2
|
||||
MOVW R2, 36(FP) // errno
|
||||
MOVW R0, r1+28(FP) // r1
|
||||
MOVW R1, r2+32(FP) // r2
|
||||
MOVW R2, err+36(FP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
error6:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 28(FP) // r1
|
||||
MOVW R2, 32(FP) // r2
|
||||
MOVW R0, 36(FP) // errno
|
||||
MOVW R3, r1+28(FP) // r1
|
||||
MOVW R2, r2+32(FP) // r2
|
||||
MOVW R0, err+36(FP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R7 // syscall number
|
||||
MOVW 4(FP), R0 // a1
|
||||
MOVW 8(FP), R1 // a2
|
||||
MOVW 12(FP), R2 // a3
|
||||
MOVW 16(FP), R3 // a4
|
||||
MOVW num+0(FP), R7 // syscall number
|
||||
MOVW a1+4(FP), R0 // a1
|
||||
MOVW a2+8(FP), R1 // a2
|
||||
MOVW a3+12(FP), R2 // a3
|
||||
MOVW a4+16(FP), R3 // a4
|
||||
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
|
||||
MOVW R4, R13
|
||||
MOVW $0, R2
|
||||
BCS error9
|
||||
MOVW R0, 40(FP) // r1
|
||||
MOVW R1, 44(FP) // r2
|
||||
MOVW R2, 48(FP) // errno
|
||||
MOVW R0, r1+40(FP) // r1
|
||||
MOVW R1, r2+44(FP) // r2
|
||||
MOVW R2, err+48(FP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
error9:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 40(FP) // r1
|
||||
MOVW R2, 44(FP) // r2
|
||||
MOVW R0, 48(FP) // errno
|
||||
MOVW R3, r1+40(FP) // r1
|
||||
MOVW R2, r2+44(FP) // r2
|
||||
MOVW R0, err+48(FP) // errno
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVW 0(FP), R7 // syscall number
|
||||
MOVW 4(FP), R0 // a1
|
||||
MOVW 8(FP), R1 // a2
|
||||
MOVW 12(FP), R2 // a3
|
||||
MOVW trap+0(FP), R7 // syscall number
|
||||
MOVW a1+4(FP), R0 // a1
|
||||
MOVW a2+8(FP), R1 // a2
|
||||
MOVW a3+12(FP), R2 // a3
|
||||
SWI $0 // syscall
|
||||
MOVW $0, R2
|
||||
BCS errorr
|
||||
MOVW R0, 16(FP) // r1
|
||||
MOVW R1, 20(FP) // r2
|
||||
MOVW R2, 24(FP) // errno
|
||||
MOVW R0, r1+16(FP) // r1
|
||||
MOVW R1, r2+20(FP) // r2
|
||||
MOVW R2, err+24(FP) // errno
|
||||
RET
|
||||
errorr:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 16(FP) // r1
|
||||
MOVW R2, 20(FP) // r2
|
||||
MOVW R0, 24(FP) // errno
|
||||
MOVW R3, r1+16(FP) // r1
|
||||
MOVW R2, r2+20(FP) // r2
|
||||
MOVW R0, err+24(FP) // errno
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVW 0(FP), R7 // syscall number
|
||||
MOVW 4(FP), R0 // a1
|
||||
MOVW 8(FP), R1 // a2
|
||||
MOVW 12(FP), R2 // a3
|
||||
MOVW 16(FP), R3 // a4
|
||||
MOVW trap+0(FP), R7 // syscall number
|
||||
MOVW a1+4(FP), R0 // a1
|
||||
MOVW a2+8(FP), R1 // a2
|
||||
MOVW a3+12(FP), R2 // a3
|
||||
MOVW a4+16(FP), R3 // a4
|
||||
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
|
||||
MOVW R4, R13
|
||||
MOVW $0, R2
|
||||
BCS errorr6
|
||||
MOVW R0, 28(FP) // r1
|
||||
MOVW R1, 32(FP) // r2
|
||||
MOVW R2, 36(FP) // errno
|
||||
MOVW R0, r1+28(FP) // r1
|
||||
MOVW R1, r2+32(FP) // r2
|
||||
MOVW R2, err+36(FP) // errno
|
||||
RET
|
||||
errorr6:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 28(FP) // r1
|
||||
MOVW R2, 32(FP) // r2
|
||||
MOVW R0, 36(FP) // errno
|
||||
MOVW R3, r1+28(FP) // r1
|
||||
MOVW R2, r2+32(FP) // r2
|
||||
MOVW R0, err+36(FP) // errno
|
||||
RET
|
||||
|
@ -15,113 +15,113 @@
|
||||
|
||||
TEXT ·Syscall(SB),NOSPLIT,$0-28
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
MOVW 12(FP), R3 // a3
|
||||
MOVW trap+0(FP), R0 // sigcall num
|
||||
MOVW a1+4(FP), R1 // a1
|
||||
MOVW a2+8(FP), R2 // a2
|
||||
MOVW a3+12(FP), R3 // a3
|
||||
SWI $0 // syscall
|
||||
MOVW $0, R2
|
||||
BCS error
|
||||
MOVW R0, 16(FP) // r1
|
||||
MOVW R1, 20(FP) // r2
|
||||
MOVW R2, 24(FP) // err
|
||||
MOVW R0, r1+16(FP) // r1
|
||||
MOVW R1, r2+20(FP) // r2
|
||||
MOVW R2, err+24(FP) // err
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
error:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 16(FP) // r1
|
||||
MOVW R2, 20(FP) // r2
|
||||
MOVW R0, 24(FP) // err
|
||||
MOVW R3, r1+16(FP) // r1
|
||||
MOVW R2, r2+20(FP) // r2
|
||||
MOVW R0, err+24(FP) // err
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall6(SB),NOSPLIT,$0-40
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
MOVW 12(FP), R3 // a3
|
||||
MOVW trap+0(FP), R0 // sigcall num
|
||||
MOVW a1+4(FP), R1 // a1
|
||||
MOVW a2+8(FP), R2 // a2
|
||||
MOVW a3+12(FP), R3 // a3
|
||||
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
|
||||
MOVW R4, R13
|
||||
MOVW $0, R2
|
||||
BCS error6
|
||||
MOVW R0, 28(FP) // r1
|
||||
MOVW R1, 32(FP) // r2
|
||||
MOVW R2, 36(FP) // err
|
||||
MOVW R0, r1+28(FP) // r1
|
||||
MOVW R1, r2+32(FP) // r2
|
||||
MOVW R2, err+36(FP) // err
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
error6:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 28(FP) // r1
|
||||
MOVW R2, 32(FP) // r2
|
||||
MOVW R0, 36(FP) // err
|
||||
MOVW R3, r1+28(FP) // r1
|
||||
MOVW R2, r2+32(FP) // r2
|
||||
MOVW R0, err+36(FP) // err
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·Syscall9(SB),NOSPLIT,$0-52
|
||||
BL runtime·entersyscall(SB)
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
MOVW 12(FP), R3 // a3
|
||||
MOVW trap+0(FP), R0 // sigcall num
|
||||
MOVW a1+4(FP), R1 // a1
|
||||
MOVW a2+8(FP), R2 // a2
|
||||
MOVW a3+12(FP), R3 // a3
|
||||
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
|
||||
MOVW R4, R13
|
||||
MOVW $0, R2
|
||||
BCS error9
|
||||
MOVW R0, 40(FP) // r1
|
||||
MOVW R1, 44(FP) // r2
|
||||
MOVW R2, 48(FP) // err
|
||||
MOVW R0, r1+40(FP) // r1
|
||||
MOVW R1, r2+44(FP) // r2
|
||||
MOVW R2, err+48(FP) // err
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
error9:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 40(FP) // r1
|
||||
MOVW R2, 44(FP) // r2
|
||||
MOVW R0, 48(FP) // err
|
||||
MOVW R3, r1+40(FP) // r1
|
||||
MOVW R2, r2+44(FP) // r2
|
||||
MOVW R0, err+48(FP) // err
|
||||
BL runtime·exitsyscall(SB)
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall(SB),NOSPLIT,$0-28
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
MOVW 12(FP), R3 // a3
|
||||
MOVW trap+0(FP), R0 // sigcall num
|
||||
MOVW a1+4(FP), R1 // a1
|
||||
MOVW a2+8(FP), R2 // a2
|
||||
MOVW a3+12(FP), R3 // a3
|
||||
SWI $0 // syscall
|
||||
MOVW $0, R2
|
||||
BCS errorr
|
||||
MOVW R0, 16(FP) // r1
|
||||
MOVW R1, 20(FP) // r2
|
||||
MOVW R2, 24(FP) // err
|
||||
MOVW R0, r1+16(FP) // r1
|
||||
MOVW R1, r2+20(FP) // r2
|
||||
MOVW R2, err+24(FP) // err
|
||||
RET
|
||||
errorr:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 16(FP) // r1
|
||||
MOVW R2, 20(FP) // r2
|
||||
MOVW R0, 24(FP) // err
|
||||
MOVW R3, r1+16(FP) // r1
|
||||
MOVW R2, r2+20(FP) // r2
|
||||
MOVW R0, err+24(FP) // err
|
||||
RET
|
||||
|
||||
TEXT ·RawSyscall6(SB),NOSPLIT,$0-40
|
||||
MOVW 0(FP), R0 // sigcall num
|
||||
MOVW 4(FP), R1 // a1
|
||||
MOVW 8(FP), R2 // a2
|
||||
MOVW 12(FP), R3 // a3
|
||||
MOVW trap+0(FP), R0 // sigcall num
|
||||
MOVW a1+4(FP), R1 // a1
|
||||
MOVW a2+8(FP), R2 // a2
|
||||
MOVW a3+12(FP), R3 // a3
|
||||
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
|
||||
MOVW R4, R13
|
||||
MOVW $0, R2
|
||||
BCS errorr6
|
||||
MOVW R0, 28(FP) // r1
|
||||
MOVW R1, 32(FP) // r2
|
||||
MOVW R2, 36(FP) // err
|
||||
MOVW R0, r1+28(FP) // r1
|
||||
MOVW R1, r2+32(FP) // r2
|
||||
MOVW R2, err+36(FP) // err
|
||||
RET
|
||||
errorr6:
|
||||
MOVW $-1, R3
|
||||
MOVW R3, 28(FP) // r1
|
||||
MOVW R2, 32(FP) // r2
|
||||
MOVW R0, 36(FP) // err
|
||||
MOVW R3, r1+28(FP) // r1
|
||||
MOVW R2, r2+32(FP) // r2
|
||||
MOVW R0, err+36(FP) // err
|
||||
RET
|
||||
|
Loading…
Reference in New Issue
Block a user