mirror of
https://github.com/golang/go
synced 2024-11-22 05:04:40 -07:00
runtime: fix syscalls for netbsd
Use correct syscall numbers and arguments for NetBSD. Provide a trampoline for signal returns (using signal API 3). R=golang-dev, rsc CC=golang-dev https://golang.org/cl/6209048
This commit is contained in:
parent
38445ca089
commit
5374ded1f3
@ -128,8 +128,27 @@ TEXT runtime·nanotime(SB),7,$32
|
||||
MOVL DX, 4(DI)
|
||||
RET
|
||||
|
||||
TEXT runtime·sigaction(SB),7,$-4
|
||||
MOVL $46, AX // sys_sigaction
|
||||
TEXT runtime·sigreturn_tramp(SB),7,$0
|
||||
LEAL 140(SP), AX // Load address of ucontext
|
||||
MOVL AX, 4(SP)
|
||||
MOVL $308, AX // sys_setcontext
|
||||
INT $0x80
|
||||
MOVL $-1, 4(SP) // Something failed...
|
||||
MOVL $1, AX // sys_exit
|
||||
INT $0x80
|
||||
|
||||
TEXT runtime·sigaction(SB),7,$24
|
||||
LEAL arg0+0(FP), SI
|
||||
LEAL 4(SP), DI
|
||||
CLD
|
||||
MOVSL // arg 1 - sig
|
||||
MOVSL // arg 2 - act
|
||||
MOVSL // arg 3 - oact
|
||||
LEAL runtime·sigreturn_tramp(SB), AX
|
||||
STOSL // arg 4 - tramp
|
||||
MOVL $3, AX
|
||||
STOSL // arg 5 - vers
|
||||
MOVL $340, AX // sys___sigaction_sigtramp
|
||||
INT $0x80
|
||||
JAE 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
@ -259,7 +278,7 @@ TEXT runtime·rfork_thread(SB),7,$8
|
||||
RET
|
||||
|
||||
TEXT runtime·sigaltstack(SB),7,$-8
|
||||
MOVL $288, AX // sys_sigaltstack
|
||||
MOVL $281, AX // sys___sigaltstack14
|
||||
MOVL new+4(SP), BX
|
||||
MOVL old+8(SP), CX
|
||||
INT $0x80
|
||||
@ -281,7 +300,7 @@ TEXT runtime·settls(SB),7,$16
|
||||
ADDL $8, CX
|
||||
MOVL CX, 0(CX)
|
||||
MOVL $0, 0(SP) // syscall gap
|
||||
MOVL $9, 4(SP) // I386_SET_GSBASE (machine/sysarch.h)
|
||||
MOVL $16, 4(SP) // X86_SET_GSBASE (x86/sysarch.h)
|
||||
MOVL CX, 8(SP) // pointer to base
|
||||
MOVL $165, AX // sys_sysarch
|
||||
INT $0x80
|
||||
|
@ -163,11 +163,23 @@ TEXT runtime·nanotime(SB),7,$32
|
||||
ADDQ DX, AX
|
||||
RET
|
||||
|
||||
TEXT runtime·sigreturn_tramp(SB),7,$-8
|
||||
MOVQ R15, DI // Load address of ucontext
|
||||
MOVQ $308, AX // sys_setcontext
|
||||
SYSCALL
|
||||
MOVQ $-1, DI // Something failed...
|
||||
MOVL $1, AX // sys_exit
|
||||
SYSCALL
|
||||
|
||||
TEXT runtime·sigaction(SB),7,$-8
|
||||
MOVL 8(SP), DI // arg 1 - signum
|
||||
MOVQ 16(SP), SI // arg 2 - nsa
|
||||
MOVQ 24(SP), DX // arg 3 - osa
|
||||
MOVL $46, AX
|
||||
// arg 4 - tramp
|
||||
LEAQ runtime·sigreturn_tramp(SB), R10
|
||||
MOVQ $3, R8 // arg 5 - version
|
||||
MOVL $340, AX // sys___sigaction_sigtramp
|
||||
|
||||
SYSCALL
|
||||
JCC 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
@ -232,7 +244,7 @@ TEXT runtime·munmap(SB),7,$0
|
||||
TEXT runtime·sigaltstack(SB),7,$-8
|
||||
MOVQ new+8(SP), DI // arg 1 - nss
|
||||
MOVQ old+16(SP), SI // arg 2 - oss
|
||||
MOVQ $288, AX // sys_sigaltstack
|
||||
MOVQ $281, AX // sys___sigaltstack14
|
||||
SYSCALL
|
||||
JCC 2(PC)
|
||||
MOVL $0xf1, 0xf1 // crash
|
||||
@ -244,7 +256,7 @@ TEXT runtime·settls(SB),7,$8
|
||||
ADDQ $16, DI
|
||||
MOVQ DI, 0(SP)
|
||||
MOVQ SP, SI
|
||||
MOVQ $12, DI // AMD64_SET_FSBASE (machine/sysarch.h)
|
||||
MOVQ $17, DI // X86_64_SET_FSBASE (x86/sysarch.h)
|
||||
MOVQ $165, AX // sys_sysarch
|
||||
SYSCALL
|
||||
JCC 2(PC)
|
||||
|
Loading…
Reference in New Issue
Block a user