Skip to content

Commit

Permalink
runtime: switch FreeBSD to use the non-COMPAT_FREEBSD11 version of th…
Browse files Browse the repository at this point in the history
…e kevent syscall

Update #53280

Change-Id: I1c8d4510fbe8bdfe9a41575bde54ea2fbf6b67e9
Reviewed-on: https://go-review.googlesource.com/c/go/+/413174
Reviewed-by: Dmitri Goutnik <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
Run-TryBot: Yuval Pavel Zholkover <[email protected]>
  • Loading branch information
paulzhol authored and mengzhuo committed Sep 16, 2022
1 parent d8220ac commit e0e1ce9
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 24 deletions.
12 changes: 7 additions & 5 deletions src/runtime/defs_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ package runtime

/*
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <signal.h>
#include <errno.h>
#define _WANT_FREEBSD11_KEVENT 1
#include <sys/event.h>
#include <sys/mman.h>
#include <sys/ucontext.h>
Expand All @@ -45,9 +46,10 @@ const (
)

const (
EINTR = C.EINTR
EFAULT = C.EFAULT
EAGAIN = C.EAGAIN
EINTR = C.EINTR
EFAULT = C.EFAULT
EAGAIN = C.EAGAIN
ETIMEDOUT = C.ETIMEDOUT

O_NONBLOCK = C.O_NONBLOCK
O_CLOEXEC = C.O_CLOEXEC
Expand Down Expand Up @@ -155,7 +157,7 @@ type Itimerval C.struct_itimerval

type Umtx_time C.struct__umtx_time

type Kevent C.struct_kevent_freebsd11
type KeventT C.struct_kevent

type bintime C.struct_bintime
type vdsoTimehands C.struct_vdso_timehands
Expand Down
8 changes: 5 additions & 3 deletions src/runtime/defs_freebsd_386.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/runtime/defs_freebsd_amd64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions src/runtime/defs_freebsd_arm.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/runtime/defs_freebsd_arm64.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/runtime/sys_freebsd_386.s
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#define SYS_sched_yield 331
#define SYS_sigprocmask 340
#define SYS_kqueue 362
#define SYS_kevent 363
#define SYS_sigaction 416
#define SYS_sigreturn 417
#define SYS_thr_exit 431
Expand All @@ -45,6 +44,7 @@
#define SYS_mmap 477
#define SYS_cpuset_getaffinity 487
#define SYS_pipe2 542
#define SYS_kevent 560

TEXT runtime·sys_umtx_op(SB),NOSPLIT,$-4
MOVL $SYS__umtx_op, AX
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/sys_freebsd_amd64.s
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#define SYS_sched_yield 331
#define SYS_sigprocmask 340
#define SYS_kqueue 362
#define SYS_kevent 363
#define SYS_sigaction 416
#define SYS_thr_exit 431
#define SYS_thr_self 432
Expand All @@ -46,6 +45,7 @@
#define SYS_mmap 477
#define SYS_cpuset_getaffinity 487
#define SYS_pipe2 542
#define SYS_kevent 560

TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
MOVQ addr+0(FP), DI
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/sys_freebsd_arm.s
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#define SYS_sched_yield (SYS_BASE + 331)
#define SYS_sigprocmask (SYS_BASE + 340)
#define SYS_kqueue (SYS_BASE + 362)
#define SYS_kevent (SYS_BASE + 363)
#define SYS_sigaction (SYS_BASE + 416)
#define SYS_thr_exit (SYS_BASE + 431)
#define SYS_thr_self (SYS_BASE + 432)
Expand All @@ -41,6 +40,7 @@
#define SYS_mmap (SYS_BASE + 477)
#define SYS_cpuset_getaffinity (SYS_BASE + 487)
#define SYS_pipe2 (SYS_BASE + 542)
#define SYS_kevent (SYS_BASE + 560)

TEXT runtime·sys_umtx_op(SB),NOSPLIT,$0
MOVW addr+0(FP), R0
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/sys_freebsd_arm64.s
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#define SYS_sched_yield 331
#define SYS_sigprocmask 340
#define SYS_kqueue 362
#define SYS_kevent 363
#define SYS_sigaction 416
#define SYS_thr_exit 431
#define SYS_thr_self 432
Expand All @@ -48,6 +47,7 @@
#define SYS_mmap 477
#define SYS_cpuset_getaffinity 487
#define SYS_pipe2 542
#define SYS_kevent 560

TEXT emptyfunc<>(SB),0,$0-0
RET
Expand Down

0 comments on commit e0e1ce9

Please sign in to comment.