]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libthread/386.c
libsec: take just the CN part of Distinguished Name in subjectAltName
[plan9front.git] / sys / src / libthread / 386.c
1 #include <u.h>
2 #include <libc.h>
3 #include <thread.h>
4 #include "threadimpl.h"
5
6 static void
7 launcher386(void (*f)(void *arg), void *arg)
8 {
9         (*f)(arg);
10         threadexits(nil);
11 }
12
13 void
14 _threadinitstack(Thread *t, void (*f)(void*), void *arg)
15 {
16         ulong *tos;
17
18         tos = (ulong*)&t->stk[t->stksize&~7];
19         *--tos = (ulong)arg;
20         *--tos = (ulong)f;
21         t->sched[JMPBUFPC] = (ulong)launcher386+JMPBUFDPC;
22         t->sched[JMPBUFSP] = (ulong)tos - 8;            /* old PC and new PC */
23 }
24