Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Jul 2003 19:09:16 -0700
From:      Marcel Moolenaar <marcel@xcllnt.net>
To:        Mike Makonnen <mtm@identd.net>
Cc:        freebsd-alpha@freebsd.org
Subject:   Re: libthr needs your help
Message-ID:  <20030720020916.GC1219@athlon.pn.xcllnt.net>
In-Reply-To: <20030719225226.GA44388@kokeb.ambesa.net>
References:  <20030719225226.GA44388@kokeb.ambesa.net>

next in thread | previous in thread | raw e-mail | index | archive | help

--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

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@xcllnt.net

--2oS5YaxWCcQjTEyO
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="alpha.diff"

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

--2oS5YaxWCcQjTEyO--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030720020916.GC1219>