]> Cypherpunks repositories - gostls13.git/commitdiff
runtime, syscall: update openbsd for changes to syskill
authorJoel Sing <joel@sing.id.au>
Wed, 7 Dec 2016 13:22:09 +0000 (00:22 +1100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Mon, 12 Dec 2016 01:30:39 +0000 (01:30 +0000)
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/34093
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
api/except.txt
src/runtime/sys_openbsd_386.s
src/runtime/sys_openbsd_amd64.s
src/runtime/sys_openbsd_arm.s
src/syscall/zsysnum_openbsd_386.go
src/syscall/zsysnum_openbsd_amd64.go
src/syscall/zsysnum_openbsd_arm.go

index 2062cbf0da36a9832a17a6bc15a771aae01dbd0d..857ebb5d7d25cc5bb9572f4703afec2c14f1cfa6 100644 (file)
@@ -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
index e96939508869c643aae36029c80c673cbdf7f0ad..997c07fe17c893acc0037d6669088fd283db2867 100644 (file)
@@ -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
 
index 01d6bd8e8538f84e4955e8856e5c6e8738b690c0..6ca5a81d2a2f74e134e088636ef3dd1a8cb81939 100644 (file)
@@ -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
 
index e0f775d0eb5985532c7fb39470b2d1796301c98a..f573a028a0030a7d5f38b289fe83066e8797a91f 100644 (file)
@@ -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
 
index c19f6de649d8c922c3cb13a735d3f923129bc76d..c172534aebb579bc561750f00c8604c59a058dc9 100644 (file)
@@ -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); }
index 86e04cd47e3a93fba0ee564f1a62e10eb5fb6591..356c18737516d546deaaf397c5498cbd55932e34 100644 (file)
@@ -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); }
index 38b43caba673bc6910a854929ebfec1d1675fe6c..3e6b984a85fe1ad5cafc4c5b5922fcc37cc9d1f9 100644 (file)
@@ -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); }