aboutsummaryrefslogtreecommitdiff
path: root/src/runtime
diff options
context:
space:
mode:
authorJoel Sing <jsing@google.com>2015-01-18 21:02:58 +1100
committerJoel Sing <jsing@google.com>2015-03-14 10:47:19 +0000
commit3b1d6920935a5db8bd0669c44838baf3e22343ed (patch)
tree0b32056acd4036db4dc4d85d9d4c45477b6ee9a8 /src/runtime
parentfacd79e4bea28f3ca0bc5dc51c9069fcb0bd9d0f (diff)
downloadgo-3b1d6920935a5db8bd0669c44838baf3e22343ed.tar.xz
all: remove dragonfly/386 port
DragonFlyBSD dropped support for i386 in 4.0 and there is no longer a dragonfly/386 - as such, remove the Go port. Fixes #8951 Fixes #7580 Fixes #7421 Change-Id: I69022ab2262132e8f97153f14dc8c37c98527008 Reviewed-on: https://go-review.googlesource.com/7543 Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Dave Cheney <dave@cheney.net> Reviewed-by: Minux Ma <minux@golang.org> Run-TryBot: Joel Sing <jsing@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime')
-rw-r--r--src/runtime/cgo/gcc_dragonfly_386.c70
-rw-r--r--src/runtime/defs_dragonfly.go1
-rw-r--r--src/runtime/defs_dragonfly_386.go198
-rw-r--r--src/runtime/os1_dragonfly.go2
-rw-r--r--src/runtime/rt0_dragonfly_386.s16
-rw-r--r--src/runtime/runtime_test.go6
-rw-r--r--src/runtime/signal_dragonfly_386.go34
-rw-r--r--src/runtime/sys_dragonfly_386.s390
8 files changed, 1 insertions, 716 deletions
diff --git a/src/runtime/cgo/gcc_dragonfly_386.c b/src/runtime/cgo/gcc_dragonfly_386.c
deleted file mode 100644
index 074418f77d..0000000000
--- a/src/runtime/cgo/gcc_dragonfly_386.c
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#include <sys/types.h>
-#include <sys/signalvar.h>
-#include <pthread.h>
-#include <signal.h>
-#include <string.h>
-#include "libcgo.h"
-
-static void* threadentry(void*);
-static void (*setg_gcc)(void*);
-
-void
-x_cgo_init(G *g, void (*setg)(void*))
-{
- pthread_attr_t attr;
- size_t size;
-
- setg_gcc = setg;
- pthread_attr_init(&attr);
- pthread_attr_getstacksize(&attr, &size);
- g->stacklo = (uintptr)&attr - size + 4096;
- pthread_attr_destroy(&attr);
-}
-
-
-void
-_cgo_sys_thread_start(ThreadStart *ts)
-{
- pthread_attr_t attr;
- sigset_t ign, oset;
- pthread_t p;
- size_t size;
- int err;
-
- SIGFILLSET(ign);
- pthread_sigmask(SIG_SETMASK, &ign, &oset);
-
- pthread_attr_init(&attr);
- pthread_attr_getstacksize(&attr, &size);
- // Leave stacklo=0 and set stackhi=size; mstack will do the rest.
- ts->g->stackhi = size;
- err = pthread_create(&p, &attr, threadentry, ts);
-
- pthread_sigmask(SIG_SETMASK, &oset, nil);
-
- if (err != 0) {
- fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
- abort();
- }
-}
-
-static void*
-threadentry(void *v)
-{
- ThreadStart ts;
-
- ts = *(ThreadStart*)v;
- free(v);
-
- /*
- * Set specific keys.
- */
- setg_gcc((void*)ts.g);
-
- crosscall_386(ts.fn);
- return nil;
-}
diff --git a/src/runtime/defs_dragonfly.go b/src/runtime/defs_dragonfly.go
index 555b8f5951..c5ebe75bb1 100644
--- a/src/runtime/defs_dragonfly.go
+++ b/src/runtime/defs_dragonfly.go
@@ -8,7 +8,6 @@
Input to cgo.
GOARCH=amd64 go tool cgo -cdefs defs_dragonfly.go >defs_dragonfly_amd64.h
-GOARCH=386 go tool cgo -cdefs defs_dragonfly.go >defs_dragonfly_386.h
*/
package runtime
diff --git a/src/runtime/defs_dragonfly_386.go b/src/runtime/defs_dragonfly_386.go
deleted file mode 100644
index e9c6353152..0000000000
--- a/src/runtime/defs_dragonfly_386.go
+++ /dev/null
@@ -1,198 +0,0 @@
-// created by cgo -cdefs and then converted to Go
-// cgo -cdefs defs_dragonfly.go
-
-package runtime
-
-import "unsafe"
-
-const (
- _EINTR = 0x4
- _EFAULT = 0xe
- _EBUSY = 0x10
- _EAGAIN = 0x23
-
- _PROT_NONE = 0x0
- _PROT_READ = 0x1
- _PROT_WRITE = 0x2
- _PROT_EXEC = 0x4
-
- _MAP_ANON = 0x1000
- _MAP_PRIVATE = 0x2
- _MAP_FIXED = 0x10
-
- _MADV_FREE = 0x5
-
- _SA_SIGINFO = 0x40
- _SA_RESTART = 0x2
- _SA_ONSTACK = 0x1
-
- _SIGHUP = 0x1
- _SIGINT = 0x2
- _SIGQUIT = 0x3
- _SIGILL = 0x4
- _SIGTRAP = 0x5
- _SIGABRT = 0x6
- _SIGEMT = 0x7
- _SIGFPE = 0x8
- _SIGKILL = 0x9
- _SIGBUS = 0xa
- _SIGSEGV = 0xb
- _SIGSYS = 0xc
- _SIGPIPE = 0xd
- _SIGALRM = 0xe
- _SIGTERM = 0xf
- _SIGURG = 0x10
- _SIGSTOP = 0x11
- _SIGTSTP = 0x12
- _SIGCONT = 0x13
- _SIGCHLD = 0x14
- _SIGTTIN = 0x15
- _SIGTTOU = 0x16
- _SIGIO = 0x17
- _SIGXCPU = 0x18
- _SIGXFSZ = 0x19
- _SIGVTALRM = 0x1a
- _SIGPROF = 0x1b
- _SIGWINCH = 0x1c
- _SIGINFO = 0x1d
- _SIGUSR1 = 0x1e
- _SIGUSR2 = 0x1f
-
- _FPE_INTDIV = 0x2
- _FPE_INTOVF = 0x1
- _FPE_FLTDIV = 0x3
- _FPE_FLTOVF = 0x4
- _FPE_FLTUND = 0x5
- _FPE_FLTRES = 0x6
- _FPE_FLTINV = 0x7
- _FPE_FLTSUB = 0x8
-
- _BUS_ADRALN = 0x1
- _BUS_ADRERR = 0x2
- _BUS_OBJERR = 0x3
-
- _SEGV_MAPERR = 0x1
- _SEGV_ACCERR = 0x2
-
- _ITIMER_REAL = 0x0
- _ITIMER_VIRTUAL = 0x1
- _ITIMER_PROF = 0x2
-
- _EV_ADD = 0x1
- _EV_DELETE = 0x2
- _EV_CLEAR = 0x20
- _EV_ERROR = 0x4000
- _EVFILT_READ = -0x1
- _EVFILT_WRITE = -0x2
-)
-
-type rtprio struct {
- _type uint16
- prio uint16
-}
-
-type lwpparams struct {
- start_func uintptr
- arg unsafe.Pointer
- stack uintptr
- tid1 unsafe.Pointer // *int32
- tid2 unsafe.Pointer // *int32
-}
-
-type sigaltstackt struct {
- ss_sp uintptr
- ss_size uintptr
- ss_flags int32
-}
-
-type sigset struct {
- __bits [4]uint32
-}
-
-type stackt struct {
- ss_sp uintptr
- ss_size uintptr
- ss_flags int32
-}
-
-type siginfo struct {
- si_signo int32
- si_errno int32
- si_code int32
- si_pid int32
- si_uid uint32
- si_status int32
- si_addr uintptr
- si_value [4]byte
- si_band int32
- __spare__ [7]int32
-}
-
-type mcontext struct {
- mc_onstack uint32
- mc_gs uint32
- mc_fs uint32
- mc_es uint32
- mc_ds uint32
- mc_edi uint32
- mc_esi uint32
- mc_ebp uint32
- mc_isp uint32
- mc_ebx uint32
- mc_edx uint32
- mc_ecx uint32
- mc_eax uint32
- mc_xflags uint32
- mc_trapno uint32
- mc_err uint32
- mc_eip uint32
- mc_cs uint32
- mc_eflags uint32
- mc_esp uint32
- mc_ss uint32
- mc_len uint32
- mc_fpformat uint32
- mc_ownedfp uint32
- mc_fpregs [128]uint32
- __spare__ [16]uint32
-}
-
-type ucontext struct {
- uc_sigmask sigset
- uc_mcontext mcontext
- uc_link *ucontext
- uc_stack stackt
- __spare__ [8]int32
-}
-
-type timespec struct {
- tv_sec int32
- tv_nsec int32
-}
-
-func (ts *timespec) set_sec(x int64) {
- ts.tv_sec = int32(x)
-}
-
-type timeval struct {
- tv_sec int32
- tv_usec int32
-}
-
-func (tv *timeval) set_usec(x int32) {
- tv.tv_usec = x
-}
-
-type itimerval struct {
- it_interval timeval
- it_value timeval
-}
-
-type keventt struct {
- ident uint32
- filter int16
- flags uint16
- fflags uint32
- data int32
- udata *byte
-}
diff --git a/src/runtime/os1_dragonfly.go b/src/runtime/os1_dragonfly.go
index 2a67da6fda..c94b1411b0 100644
--- a/src/runtime/os1_dragonfly.go
+++ b/src/runtime/os1_dragonfly.go
@@ -87,7 +87,7 @@ func newosproc(mp *m, stk unsafe.Pointer) {
tid2: nil,
}
- mp.tls[0] = uintptr(mp.id) // so 386 asm can find it
+ mp.tls[0] = uintptr(mp.id) // XXX so 386 asm can find it
lwp_create(&params)
sigprocmask(&oset, nil)
diff --git a/src/runtime/rt0_dragonfly_386.s b/src/runtime/rt0_dragonfly_386.s
deleted file mode 100644
index 548ba796a0..0000000000
--- a/src/runtime/rt0_dragonfly_386.s
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-#include "textflag.h"
-
-TEXT _rt0_386_dragonfly(SB),NOSPLIT,$8
- MOVL 8(SP), AX
- LEAL 12(SP), BX
- MOVL AX, 0(SP)
- MOVL BX, 4(SP)
- CALL main(SB)
- INT $3
-
-TEXT main(SB),NOSPLIT,$0
- JMP runtime·rt0_go(SB)
diff --git a/src/runtime/runtime_test.go b/src/runtime/runtime_test.go
index 983442f1db..782b936548 100644
--- a/src/runtime/runtime_test.go
+++ b/src/runtime/runtime_test.go
@@ -177,12 +177,6 @@ var faultAddrs = []uint64{
}
func TestSetPanicOnFault(t *testing.T) {
- // This currently results in a fault in the signal trampoline on
- // dragonfly/386 - see issue 7421.
- if GOOS == "dragonfly" && GOARCH == "386" {
- t.Skip("skipping test on dragonfly/386")
- }
-
old := debug.SetPanicOnFault(true)
defer debug.SetPanicOnFault(old)
diff --git a/src/runtime/signal_dragonfly_386.go b/src/runtime/signal_dragonfly_386.go
deleted file mode 100644
index a0fec1309c..0000000000
--- a/src/runtime/signal_dragonfly_386.go
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2013 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package runtime
-
-import "unsafe"
-
-type sigctxt struct {
- info *siginfo
- ctxt unsafe.Pointer
-}
-
-func (c *sigctxt) regs() *mcontext { return &(*ucontext)(c.ctxt).uc_mcontext }
-func (c *sigctxt) eax() uint32 { return c.regs().mc_eax }
-func (c *sigctxt) ebx() uint32 { return c.regs().mc_ebx }
-func (c *sigctxt) ecx() uint32 { return c.regs().mc_ecx }
-func (c *sigctxt) edx() uint32 { return c.regs().mc_edx }
-func (c *sigctxt) edi() uint32 { return c.regs().mc_edi }
-func (c *sigctxt) esi() uint32 { return c.regs().mc_esi }
-func (c *sigctxt) ebp() uint32 { return c.regs().mc_ebp }
-func (c *sigctxt) esp() uint32 { return c.regs().mc_esp }
-func (c *sigctxt) eip() uint32 { return c.regs().mc_eip }
-func (c *sigctxt) eflags() uint32 { return c.regs().mc_eflags }
-func (c *sigctxt) cs() uint32 { return uint32(c.regs().mc_cs) }
-func (c *sigctxt) fs() uint32 { return uint32(c.regs().mc_fs) }
-func (c *sigctxt) gs() uint32 { return uint32(c.regs().mc_gs) }
-func (c *sigctxt) sigcode() uint32 { return uint32(c.info.si_code) }
-func (c *sigctxt) sigaddr() uint32 { return uint32(c.info.si_addr) }
-
-func (c *sigctxt) set_eip(x uint32) { c.regs().mc_eip = x }
-func (c *sigctxt) set_esp(x uint32) { c.regs().mc_esp = x }
-func (c *sigctxt) set_sigcode(x uint32) { c.info.si_code = int32(x) }
-func (c *sigctxt) set_sigaddr(x uint32) { c.info.si_addr = uintptr(x) }
diff --git a/src/runtime/sys_dragonfly_386.s b/src/runtime/sys_dragonfly_386.s
deleted file mode 100644
index afb2ec1f5b..0000000000
--- a/src/runtime/sys_dragonfly_386.s
+++ /dev/null
@@ -1,390 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-//
-// System calls and other sys.stuff for 386, FreeBSD
-// /usr/src/sys/kern/syscalls.master for syscall numbers.
-//
-
-#include "go_asm.h"
-#include "go_tls.h"
-#include "textflag.h"
-
-TEXT runtime·sys_umtx_sleep(SB),NOSPLIT,$-4
- MOVL $469, AX // umtx_sleep
- INT $0x80
- JAE 2(PC)
- NEGL AX
- MOVL AX, ret+12(FP)
- RET
-
-TEXT runtime·sys_umtx_wakeup(SB),NOSPLIT,$-4
- MOVL $470, AX // umtx_wakeup
- INT $0x80
- JAE 2(PC)
- NEGL AX
- MOVL AX, ret+8(FP)
- RET
-
-TEXT runtime·lwp_create(SB),NOSPLIT,$-4
- MOVL $495, AX // lwp_create
- INT $0x80
- MOVL AX, ret+4(FP)
- RET
-
-TEXT runtime·lwp_start(SB),NOSPLIT,$0
-
- // Set GS to point at m->tls.
- MOVL mm+0(FP), BX
- MOVL m_g0(BX), DX
- LEAL m_tls(BX), BP
- PUSHAL
- PUSHL BP
- CALL runtime·settls(SB)
- POPL AX
- POPAL
-
- // Now segment is established. Initialize m, g.
- get_tls(CX)
- MOVL BX, g_m(DX)
- MOVL DX, g(CX)
-
- CALL runtime·stackcheck(SB) // smashes AX, CX
- MOVL 0(DX), DX // paranoia; check they are not nil
- MOVL 0(BX), BX
-
- // More paranoia; check that stack splitting code works.
- PUSHAL
- CALL runtime·emptyfunc(SB)
- POPAL
-
- CALL runtime·mstart(SB)
-
- CALL runtime·exit1(SB)
- MOVL $0x1234, 0x1005
- RET
-
-// Exit the entire program (like C exit)
-TEXT runtime·exit(SB),NOSPLIT,$-4
- MOVL $1, AX
- INT $0x80
- MOVL $0xf1, 0xf1 // crash
- RET
-
-TEXT runtime·exit1(SB),NOSPLIT,$16
- MOVL $0, 0(SP) // syscall gap
- MOVL $0x10000, 4(SP) // arg 1 - how (EXTEXIT_LWP)
- MOVL $0, 8(SP) // arg 2 - status
- MOVL $0, 12(SP) // arg 3 - addr
- MOVL $494, AX
- INT $0x80
- JAE 2(PC)
- MOVL $0xf1, 0xf1 // crash
- RET
-
-TEXT runtime·open(SB),NOSPLIT,$-4
- MOVL $5, AX
- INT $0x80
- JAE 2(PC)
- MOVL $-1, AX
- MOVL AX, ret+12(FP)
- RET
-
-TEXT runtime·close(SB),NOSPLIT,$-4
- MOVL $6, AX
- INT $0x80
- JAE 2(PC)
- MOVL $-1, AX
- MOVL AX, ret+4(FP)
- RET
-
-TEXT runtime·read(SB),NOSPLIT,$-4
- MOVL $3, AX
- INT $0x80
- JAE 2(PC)
- MOVL $-1, AX
- MOVL AX, ret+12(FP)
- RET
-
-TEXT runtime·write(SB),NOSPLIT,$-4
- MOVL $4, AX
- INT $0x80
- JAE 2(PC)
- MOVL $-1, AX
- MOVL AX, ret+12(FP)
- RET
-
-TEXT runtime·getrlimit(SB),NOSPLIT,$-4
- MOVL $194, AX
- INT $0x80
- MOVL AX, ret+8(FP)
- RET
-
-TEXT runtime·raise(SB),NOSPLIT,$16
- MOVL $496, AX // lwp_gettid
- INT $0x80
- MOVL $0, 0(SP)
- MOVL $-1, 4(SP) // arg 1 - pid
- MOVL AX, 8(SP) // arg 2 - tid
- MOVL sig+0(FP), AX
- MOVL AX, 8(SP) // arg 3 - signum
- MOVL $497, AX // lwp_kill
- INT $0x80
- RET
-
-TEXT runtime·mmap(SB),NOSPLIT,$36
- LEAL addr+0(FP), SI
- LEAL 4(SP), DI
- CLD
- MOVSL // arg 1 - addr
- MOVSL // arg 2 - len
- MOVSL // arg 3 - prot
- MOVSL // arg 4 - flags
- MOVSL // arg 5 - fd
- MOVL $0, AX
- STOSL // arg 6 - pad
- MOVSL // arg 7 - offset
- MOVL $0, AX // top 32 bits of file offset
- STOSL
- MOVL $197, AX // sys_mmap
- INT $0x80
- MOVL AX, ret+24(FP)
- RET
-
-TEXT runtime·munmap(SB),NOSPLIT,$-4
- MOVL $73, AX
- INT $0x80
- JAE 2(PC)
- MOVL $0xf1, 0xf1 // crash
- RET
-
-TEXT runtime·madvise(SB),NOSPLIT,$-4
- MOVL $75, AX // madvise
- INT $0x80
- // ignore failure - maybe pages are locked
- RET
-
-TEXT runtime·setitimer(SB), NOSPLIT, $-4
- MOVL $83, AX
- INT $0x80
- RET
-
-// func now() (sec int64, nsec int32)
-TEXT time·now(SB), NOSPLIT, $32
- MOVL $232, AX
- LEAL 12(SP), BX
- MOVL $0, 4(SP) // CLOCK_REALTIME
- MOVL BX, 8(SP)
- INT $0x80
- MOVL 12(SP), AX // sec
- MOVL 16(SP), BX // nsec
-
- // sec is in AX, nsec in BX
- MOVL AX, sec+0(FP)
- MOVL $0, sec+4(FP)
- MOVL BX, nsec+8(FP)
- RET
-
-// int64 nanotime(void) so really
-// void nanotime(int64 *nsec)
-TEXT runtime·nanotime(SB), NOSPLIT, $32
- MOVL $232, AX
- LEAL 12(SP), BX
- MOVL $4, 4(SP) // CLOCK_MONOTONIC
- MOVL BX, 8(SP)
- INT $0x80
- MOVL 12(SP), AX // sec
- MOVL 16(SP), BX // nsec
-
- // sec is in AX, nsec in BX
- // convert to DX:AX nsec
- MOVL $1000000000, CX
- MULL CX
- ADDL BX, AX
- ADCL $0, DX
-
- MOVL AX, ret_lo+0(FP)
- MOVL DX, ret_hi+4(FP)
- RET
-
-
-TEXT runtime·sigaction(SB),NOSPLIT,$-4
- MOVL $342, AX
- INT $0x80
- JAE 2(PC)
- MOVL $0xf1, 0xf1 // crash
- RET
-
-TEXT runtime·sigtramp(SB),NOSPLIT,$44
- get_tls(CX)
-
- // check that g exists
- MOVL g(CX), DI
- CMPL DI, $0
- JNE 6(PC)
- MOVL signo+0(FP), BX
- MOVL BX, 0(SP)
- MOVL $runtime·badsignal(SB), AX
- CALL AX
- JMP ret
-
- // save g
- MOVL DI, 20(SP)
-
- // g = m->gsignal
- MOVL g_m(DI), BX
- MOVL m_gsignal(BX), BX
- MOVL BX, g(CX)
-
- // copy arguments for call to sighandler
- MOVL signo+0(FP), BX
- MOVL BX, 0(SP)
- MOVL info+4(FP), BX
- MOVL BX, 4(SP)
- MOVL context+8(FP), BX
- MOVL BX, 8(SP)
- MOVL DI, 12(SP)
-
- CALL runtime·sighandler(SB)
-
- // restore g
- get_tls(CX)
- MOVL 20(SP), BX
- MOVL BX, g(CX)
-
-ret:
- // call sigreturn
- MOVL context+8(FP), AX
- MOVL $0, 0(SP) // syscall gap
- MOVL AX, 4(SP)
- MOVL $344, AX // sigreturn(ucontext)
- INT $0x80
- MOVL $0xf1, 0xf1 // crash
- RET
-
-TEXT runtime·sigaltstack(SB),NOSPLIT,$0
- MOVL $53, AX
- INT $0x80
- JAE 2(PC)
- MOVL $0xf1, 0xf1 // crash
- RET
-
-TEXT runtime·usleep(SB),NOSPLIT,$20
- MOVL $0, DX
- MOVL usec+0(FP), AX
- MOVL $1000000, CX
- DIVL CX
- MOVL AX, 12(SP) // tv_sec
- MOVL $1000, AX
- MULL DX
- MOVL AX, 16(SP) // tv_nsec
-
- MOVL $0, 0(SP)
- LEAL 12(SP), AX
- MOVL AX, 4(SP) // arg 1 - rqtp
- MOVL $0, 8(SP) // arg 2 - rmtp
- MOVL $240, AX // sys_nanosleep
- INT $0x80
- RET
-
-TEXT runtime·setldt(SB),NOSPLIT,$4
- // Under DragonFly we set the GS base instead of messing with the LDT.
- MOVL tls0+4(FP), AX
- MOVL AX, 0(SP)
- CALL runtime·settls(SB)
- RET
-
-TEXT runtime·settls(SB),NOSPLIT,$24
- // adjust for ELF: wants to use -4(GS) for g
- MOVL tlsbase+0(FP), CX
- ADDL $4, CX
-
- // Set up a struct tls_info - a size of -1 maps the whole address
- // space and is required for direct-tls access of variable data
- // via negative offsets.
- LEAL 16(SP), BX
- MOVL CX, 16(SP) // base
- MOVL $-1, 20(SP) // size
-
- // set_tls_area returns the descriptor that needs to be loaded into GS.
- MOVL $0, 0(SP) // syscall gap
- MOVL $0, 4(SP) // arg 1 - which
- MOVL BX, 8(SP) // arg 2 - tls_info
- MOVL $8, 12(SP) // arg 3 - infosize
- MOVL $472, AX // set_tls_area
- INT $0x80
- JCC 2(PC)
- MOVL $0xf1, 0xf1 // crash
- MOVW AX, GS
- RET
-
-TEXT runtime·sysctl(SB),NOSPLIT,$28
- LEAL mib+0(FP), SI
- LEAL 4(SP), DI
- CLD
- MOVSL // arg 1 - name
- MOVSL // arg 2 - namelen
- MOVSL // arg 3 - oldp
- MOVSL // arg 4 - oldlenp
- MOVSL // arg 5 - newp
- MOVSL // arg 6 - newlen
- MOVL $202, AX // sys___sysctl
- INT $0x80
- JCC 4(PC)
- NEGL AX
- MOVL AX, ret+24(FP)
- RET
- MOVL $0, AX
- MOVL AX, ret+24(FP)
- RET
-
-TEXT runtime·osyield(SB),NOSPLIT,$-4
- MOVL $331, AX // sys_sched_yield
- INT $0x80
- RET
-
-TEXT runtime·sigprocmask(SB),NOSPLIT,$16
- MOVL $0, 0(SP) // syscall gap
- MOVL $3, 4(SP) // arg 1 - how (SIG_SETMASK)
- MOVL new+0(FP), AX
- MOVL AX, 8(SP) // arg 2 - set
- MOVL old+4(FP), AX
- MOVL AX, 12(SP) // arg 3 - oset
- MOVL $340, AX // sys_sigprocmask
- INT $0x80
- JAE 2(PC)
- MOVL $0xf1, 0xf1 // crash
- RET
-
-// int32 runtime·kqueue(void);
-TEXT runtime·kqueue(SB),NOSPLIT,$0
- MOVL $362, AX
- INT $0x80
- JAE 2(PC)
- NEGL AX
- MOVL AX, ret+0(FP)
- RET
-
-// int32 runtime·kevent(int kq, Kevent *changelist, int nchanges, Kevent *eventlist, int nevents, Timespec *timeout);
-TEXT runtime·kevent(SB),NOSPLIT,$0
- MOVL $363, AX
- INT $0x80
- JAE 2(PC)
- NEGL AX
- MOVL AX, ret+24(FP)
- RET
-
-// int32 runtime·closeonexec(int32 fd);
-TEXT runtime·closeonexec(SB),NOSPLIT,$32
- MOVL $92, AX // fcntl
- // 0(SP) is where the caller PC would be; kernel skips it
- MOVL fd+0(FP), BX
- MOVL BX, 4(SP) // fd
- MOVL $2, 8(SP) // F_SETFD
- MOVL $1, 12(SP) // FD_CLOEXEC
- INT $0x80
- JAE 2(PC)
- NEGL AX
- RET
-
-GLOBL runtime·tlsoffset(SB),NOPTR,$4