From owner-freebsd-alpha@FreeBSD.ORG Sat Jul 19 19:09:18 2003 Return-Path: Delivered-To: freebsd-alpha@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2627037B401 for ; Sat, 19 Jul 2003 19:09:18 -0700 (PDT) Received: from ns1.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6277E43F75 for ; Sat, 19 Jul 2003 19:09:17 -0700 (PDT) (envelope-from marcel@xcllnt.net) Received: from athlon.pn.xcllnt.net (athlon.pn.xcllnt.net [192.168.4.3]) by ns1.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6K29Hv1080798; Sat, 19 Jul 2003 19:09:17 -0700 (PDT) (envelope-from marcel@piii.pn.xcllnt.net) Received: from athlon.pn.xcllnt.net (localhost [127.0.0.1]) by athlon.pn.xcllnt.net (8.12.9/8.12.9) with ESMTP id h6K29H58001444; Sat, 19 Jul 2003 19:09:17 -0700 (PDT) (envelope-from marcel@athlon.pn.xcllnt.net) Received: (from marcel@localhost) by athlon.pn.xcllnt.net (8.12.9/8.12.9/Submit) id h6K29GGw001443; Sat, 19 Jul 2003 19:09:16 -0700 (PDT) (envelope-from marcel) Date: Sat, 19 Jul 2003 19:09:16 -0700 From: Marcel Moolenaar To: Mike Makonnen Message-ID: <20030720020916.GC1219@athlon.pn.xcllnt.net> References: <20030719225226.GA44388@kokeb.ambesa.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="2oS5YaxWCcQjTEyO" Content-Disposition: inline In-Reply-To: <20030719225226.GA44388@kokeb.ambesa.net> User-Agent: Mutt/1.5.4i cc: freebsd-alpha@freebsd.org Subject: Re: libthr needs your help X-BeenThere: freebsd-alpha@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting FreeBSD to the Alpha List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Jul 2003 02:09:18 -0000 --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--