Commit f91ddaab authored by Joel Sing's avatar Joel Sing Committed by Brad Fitzpatrick

runtime, syscall: update openbsd for changes to syskill

Change the openbsd runtime to use the current sys_kill and sys_thrkill
system calls.

Prior to OpenBSD 5.9 the sys_kill system call could be used with both
processes and threads. In OpenBSD 5.9 this functionality was split into
a sys_kill system call for processes (with a new syscall number) and a
sys_thrkill system call for threads. The original/legacy system call was
retained in OpenBSD 5.9 and OpenBSD 6.0, however has been removed and
will not exist in the upcoming OpenBSD 6.1 release.

Note: This change is needed to make Go work on OpenBSD 6.1 (to be
released in May 2017) and should be included in the Go 1.8 release.
This change also drops support for OpenBSD 5.8, which is already an
unsupported OpenBSD release.

Change-Id: I525ed9b57c66c0c6f438dfa32feb29c7eefc72b0
Reviewed-on: https://go-review.googlesource.com/34093Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent cbcc1db4
......@@ -338,3 +338,7 @@ pkg unicode, const Version = "6.2.0"
pkg unicode, const Version = "6.3.0"
pkg unicode, const Version = "7.0.0"
pkg unicode, const Version = "8.0.0"
pkg syscall (openbsd-386), const SYS_KILL = 37
pkg syscall (openbsd-386-cgo), const SYS_KILL = 37
pkg syscall (openbsd-amd64), const SYS_KILL = 37
pkg syscall (openbsd-amd64-cgo), const SYS_KILL = 37
......@@ -79,14 +79,15 @@ TEXT runtime·usleep(SB),NOSPLIT,$24
INT $0x80
RET
TEXT runtime·raise(SB),NOSPLIT,$12
TEXT runtime·raise(SB),NOSPLIT,$16
MOVL $299, AX // sys_getthrid
INT $0x80
MOVL $0, 0(SP)
MOVL AX, 4(SP) // arg 1 - pid
MOVL AX, 4(SP) // arg 1 - tid
MOVL sig+0(FP), AX
MOVL AX, 8(SP) // arg 2 - signum
MOVL $37, AX // sys_kill
MOVL $0, 12(SP) // arg 3 - tcb
MOVL $119, AX // sys_thrkill
INT $0x80
RET
......@@ -97,7 +98,7 @@ TEXT runtime·raiseproc(SB),NOSPLIT,$12
MOVL AX, 4(SP) // arg 1 - pid
MOVL sig+0(FP), AX
MOVL AX, 8(SP) // arg 2 - signum
MOVL $37, AX // sys_kill
MOVL $122, AX // sys_kill
INT $0x80
RET
......
......@@ -156,9 +156,10 @@ TEXT runtime·usleep(SB),NOSPLIT,$16
TEXT runtime·raise(SB),NOSPLIT,$16
MOVL $299, AX // sys_getthrid
SYSCALL
MOVQ AX, DI // arg 1 - pid
MOVQ AX, DI // arg 1 - tid
MOVL sig+0(FP), SI // arg 2 - signum
MOVL $37, AX // sys_kill
MOVQ $0, DX // arg 3 - tcb
MOVL $119, AX // sys_thrkill
SYSCALL
RET
......@@ -167,7 +168,7 @@ TEXT runtime·raiseproc(SB),NOSPLIT,$16
SYSCALL
MOVQ AX, DI // arg 1 - pid
MOVL sig+0(FP), SI // arg 2 - signum
MOVL $37, AX // sys_kill
MOVL $122, AX // sys_kill
SYSCALL
RET
......
......@@ -87,9 +87,10 @@ TEXT runtime·usleep(SB),NOSPLIT,$16
TEXT runtime·raise(SB),NOSPLIT,$12
MOVW $0x12B, R12
SWI $0 // sys_getthrid
// arg 1 - pid, already in R0
// arg 1 - tid, already in R0
MOVW sig+0(FP), R1 // arg 2 - signum
MOVW $37, R12 // sys_kill
MOVW $0, R2 // arg 3 - tcb
MOVW $119, R12 // sys_thrkill
SWI $0
RET
......@@ -98,7 +99,7 @@ TEXT runtime·raiseproc(SB),NOSPLIT,$12
SWI $0 // sys_getpid
// arg 1 - pid, already in R0
MOVW sig+0(FP), R1 // arg 2 - signum
MOVW $37, R12 // sys_kill
MOVW $122, R12 // sys_kill
SWI $0
RET
......
......@@ -41,7 +41,6 @@ const (
SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); }
SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); }
SYS_SYNC = 36 // { void sys_sync(void); }
SYS_KILL = 37 // { int sys_kill(int pid, int signum); }
SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); }
SYS_GETPPID = 39 // { pid_t sys_getppid(void); }
SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); }
......@@ -113,6 +112,7 @@ const (
SYS_READV = 120 // { ssize_t sys_readv(int fd, \
SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \
SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
SYS_KILL = 122 // { int sys_kill(int pid, int signum); }
SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); }
SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
SYS_SETREGID = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }
......
......@@ -41,7 +41,6 @@ const (
SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); }
SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); }
SYS_SYNC = 36 // { void sys_sync(void); }
SYS_KILL = 37 // { int sys_kill(int pid, int signum); }
SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); }
SYS_GETPPID = 39 // { pid_t sys_getppid(void); }
SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); }
......@@ -112,6 +111,7 @@ const (
SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \
SYS_READV = 120 // { ssize_t sys_readv(int fd, \
SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \
SYS_KILL = 122 // { int sys_kill(int pid, int signum); }
SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); }
SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
......
......@@ -42,7 +42,6 @@ const (
SYS_CHFLAGS = 34 // { int sys_chflags(const char *path, u_int flags); }
SYS_FCHFLAGS = 35 // { int sys_fchflags(int fd, u_int flags); }
SYS_SYNC = 36 // { void sys_sync(void); }
SYS_KILL = 37 // { int sys_kill(int pid, int signum); }
SYS_STAT = 38 // { int sys_stat(const char *path, struct stat *ub); }
SYS_GETPPID = 39 // { pid_t sys_getppid(void); }
SYS_LSTAT = 40 // { int sys_lstat(const char *path, struct stat *ub); }
......@@ -118,6 +117,7 @@ const (
SYS_GETSOCKOPT = 118 // { int sys_getsockopt(int s, int level, int name, \
SYS_READV = 120 // { ssize_t sys_readv(int fd, \
SYS_WRITEV = 121 // { ssize_t sys_writev(int fd, \
SYS_KILL = 122 // { int sys_kill(int pid, int signum); }
SYS_FCHOWN = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
SYS_FCHMOD = 124 // { int sys_fchmod(int fd, mode_t mode); }
SYS_SETREUID = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment