diff options
| author | Joel Sing <jsing@google.com> | 2012-11-22 01:25:53 +1100 |
|---|---|---|
| committer | Joel Sing <jsing@google.com> | 2012-11-22 01:25:53 +1100 |
| commit | cd37fecffbc937432d729510c2dda7e61e39adfb (patch) | |
| tree | 59adcfc6d3393d6221e89aa98e65fd109c674ed4 /src/pkg/runtime/thread_openbsd.c | |
| parent | 1bd4a7dbcbf833a5e37cf8d0a6e7fc55c557543b (diff) | |
| download | go-cd37fecffbc937432d729510c2dda7e61e39adfb.tar.xz | |
runtime: update openbsd runtime to use new tfork syscall
Update OpenBSD runtime to use the new version of the sys___tfork
syscall and switch TLS initialisation from sys_arch to sys___set_tcb
(note that both of these syscalls are available in OpenBSD 5.2).
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6843058
Diffstat (limited to 'src/pkg/runtime/thread_openbsd.c')
| -rw-r--r-- | src/pkg/runtime/thread_openbsd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/runtime/thread_openbsd.c b/src/pkg/runtime/thread_openbsd.c index f479e2c3e9..b696534e79 100644 --- a/src/pkg/runtime/thread_openbsd.c +++ b/src/pkg/runtime/thread_openbsd.c @@ -23,7 +23,7 @@ extern SigTab runtime·sigtab[]; static Sigset sigset_all = ~(Sigset)0; static Sigset sigset_none; -extern int64 runtime·tfork_thread(void *param, void *stack, M *m, G *g, void (*fn)(void)); +extern int64 runtime·tfork(void *param, uintptr psize, M *m, G *g, void (*fn)(void)); extern int32 runtime·thrsleep(void *ident, int32 clock_id, void *tsp, void *lock, const int32 *abort); extern int32 runtime·thrwakeup(void *ident, int32 n); @@ -139,10 +139,10 @@ runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void)) param.tf_tcb = (byte*)&m->tls[0]; param.tf_tid = (int32*)&m->procid; - param.tf_flags = (int32)0; + param.tf_stack = stk; oset = runtime·sigprocmask(SIG_SETMASK, sigset_all); - ret = runtime·tfork_thread((byte*)¶m, stk, m, g, fn); + ret = runtime·tfork((byte*)¶m, sizeof(param), m, g, fn); runtime·sigprocmask(SIG_SETMASK, oset); if(ret < 0) { |
