libthr needs your help

Marcel Moolenaar marcel at xcllnt.net
Sat Jul 19 19:09:18 PDT 2003


On Sat, Jul 19, 2003 at 06:52:27PM -0400, Mike Makonnen wrote:
> I need a brave volunteer :-) to implement the remaining 2
> (maybe 3) functions necessary to make libthr work on alpha. If it's
> anything like sparc64 or ia64, then it will only be 5/6 lines
> worth of code. I just committed the stubs this morning and they
> compile fine. They can be found at:
> src/lib/libthr/arch/alpaha/alpha/_curthread.c

Don't forget casuptr() in the kernel. It's currently a stub in
sys/alpha/alpha/machdep.c.

Attached what I think needs to be done on alpha (modulo renaming
mc_spare[0] to somthing meaningful)

Thought,

-- 
 Marcel Moolenaar	  USPA: A-39004		 marcel at xcllnt.net
-------------- next part --------------
Index: _curthread.c
===================================================================
RCS file: /home/ncvs/src/lib/libthr/arch/alpha/alpha/_curthread.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 _curthread.c
--- _curthread.c	19 Jul 2003 15:57:52 -0000	1.1.1.1
+++ _curthread.c	20 Jul 2003 02:06:26 -0000
@@ -35,13 +35,18 @@
 void *
 _set_curthread(ucontext_t *uc, struct pthread *thread, int *err)
 {
+	*err = 0;
+	if (uc != NULL)
+		uc->uc_mcontext.mc_spare[0] = (uint64_t)thread;
+	else
+		__builtin_set_thread_pointer(thread);
 	return (NULL);
 }
 
 struct pthread *
 _get_curthread(void)
 {
-	return (NULL);
+	__builtin_thread_pointer();
 }
 
 void


More information about the freebsd-alpha mailing list