more 386 runtime fixes.
can pass many tests;
current stumbling block is an 8l bug.
R=r
DELTA=122 (83 added, 8 deleted, 31 changed)
OCL=29872
CL=29876
diff --git a/src/runtime/darwin/thread.c b/src/runtime/darwin/thread.c
index c780e16..7926708 100644
--- a/src/runtime/darwin/thread.c
+++ b/src/runtime/darwin/thread.c
@@ -144,13 +144,15 @@
void
osinit(void)
{
- // Register our thread-creation callback (see sys_amd64_darwin.s).
+ // Register our thread-creation callback (see {amd64,386}/sys.s).
bsdthread_register();
}
void
newosproc(M *m, G *g, void *stk, void (*fn)(void))
{
+ // printf("newosproc m=%p g=%p stk=%p fn=%p\n", m, g, stk, fn);
+ m->tls[0] = m->id; // so 386 asm can find it
bsdthread_create(stk, m, g, fn);
}