From owner-freebsd-threads@FreeBSD.ORG Thu Jun 19 21:40:45 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7F69A37B401; Thu, 19 Jun 2003 21:40:45 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 14ED243F75; Thu, 19 Jun 2003 21:40:45 -0700 (PDT) (envelope-from davidxu@freebsd.org) Received: from davidw2k (davidxu@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.9/8.12.9) with SMTP id h5K4edUp066708; Thu, 19 Jun 2003 21:40:40 -0700 (PDT) (envelope-from davidxu@freebsd.org) Message-ID: <009b01c336e6$85045ee0$f001a8c0@davidw2k> From: "David Xu" To: , "Marcel Moolenaar" References: Date: Fri, 20 Jun 2003 12:43:34 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 cc: threads@freebsd.org cc: Julian Elischer Subject: Re: Implementing TLS: step 1 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jun 2003 04:40:45 -0000 ----- Original Message -----=20 From: "Daniel Eischen" To: "Marcel Moolenaar" Cc: ; ; "Julian Elischer" = Sent: Friday, June 20, 2003 11:57 AM Subject: Re: Implementing TLS: step 1 > On Thu, 19 Jun 2003, Marcel Moolenaar wrote: >=20 > > On Thu, Jun 19, 2003 at 11:39:42PM -0400, Daniel Eischen wrote: > > >=20 > > > > Q2: Given that libthr has been ported to ia64, what needs to be = done > > > > to port libkse to ia64 (roughtly)? > > >=20 > > > libpthread/arch/i386/include/ksd.h: > > > libpthread/arch/i386/include/atomic_ops.h > > > libpthread/arch/i386/include/pthread_md.h > > > libpthread/arch/i386/i386: > >=20 > > No kernel code? Hmmm, looks like something that's worth giving a >=20 > I'm not too sure about the kernel code. If you have KSEs > working for libthr, then I assume there is very little extra > kernel code needed. You do need to have get_mcontext() and > set_mcontext() implemented in machdep.c, though. It looks > like you do (although nothing is done with clear_ret in > get_mcontext()). >=20 > David, Julian, care to comment? >=20 Yes, we don't have so much MD code in kernel. MD functions used by kse kernel code: cpu_thread_setup - not kse related, all process need it, should already work. cpu_set_upcall_kse - kse code, set userland return address to upcall func entry, and push its=20 mailbox parameter on user stack. cpu_thread_clean - not kse related, should already work. cpu_set_upcall - not kse related, make a new thread's=20 initial context so cpu_switch() can load it, it may inherits original thread's pcb and userland context (syscall trap frame). I think it might already work on ia64. get_mcontext - used by kse code, but is general function, and any application can use it, not just kse app. set_mcontext - same as above Planed MD function: void thread_siginfo(int sig, u_long code, siginfo_t *info); Construct a siginfo structure based on current user trap frame and parameter sig and MD fault code, fill fault address in this structure. The function is used by kse to deliver sync signal to userland, sample implement on ia32 is : /* * Build siginfo_t for SA thread */ void thread_siginfo(int sig, u_long code, siginfo_t *si) { struct proc *p; struct thread *td; td =3D curthread; p =3D td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); bzero(si, sizeof(*si)); si->si_signo =3D sig; si->si_code =3D code; si->si_addr =3D (void *)td->td_frame->tf_err; } > > shot. If we have libkse on ia64, we can more easily work on the > > issues related to TLS... >=20 > --=20 > Dan Eischen >=20 > _______________________________________________ > freebsd-threads@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-threads > To unsubscribe, send any mail to = "freebsd-threads-unsubscribe@freebsd.org" >=20