diff options
author | marcel <marcel@FreeBSD.org> | 2003-07-24 07:51:49 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2003-07-24 07:51:49 +0000 |
commit | e6af3a1393324f87f4f4865c1bbb1065e3bfc667 (patch) | |
tree | 7189d033cccd2b84c078f724712ce158471bf278 /lib | |
parent | 5db03ff255bd51fa39e5b4ad5c32e7756c0e7a0f (diff) | |
download | FreeBSD-src-e6af3a1393324f87f4f4865c1bbb1065e3bfc667.zip FreeBSD-src-e6af3a1393324f87f4f4865c1bbb1065e3bfc667.tar.gz |
Implement _get_curthread and _set_curthread. We use GCCs builtin
function this, which expands to PAL calls (rduniq and wruniq).
This needs adjustment when TLS is implemented.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libthr/arch/alpha/alpha/_curthread.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libthr/arch/alpha/alpha/_curthread.c b/lib/libthr/arch/alpha/alpha/_curthread.c index c6706e9..56166a7 100644 --- a/lib/libthr/arch/alpha/alpha/_curthread.c +++ b/lib/libthr/arch/alpha/alpha/_curthread.c @@ -35,13 +35,18 @@ __FBSDID("$FreeBSD$"); void * _set_curthread(ucontext_t *uc, struct pthread *thread, int *err) { + *err = 0; + if (uc != NULL) + uc->uc_mcontext.mc_thrptr = (uint64_t)thread; + else + __builtin_set_thread_pointer(thread); return (NULL); } struct pthread * _get_curthread(void) { - return (NULL); + return (__builtin_thread_pointer()); } void |