From owner-freebsd-sparc Sun Dec 8 4:25: 0 2002 Delivered-To: freebsd-sparc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7C1A537B401; Sun, 8 Dec 2002 04:24:58 -0800 (PST) Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by mx1.FreeBSD.org (Postfix) with ESMTP id 521DD43E4A; Sun, 8 Dec 2002 04:24:57 -0800 (PST) (envelope-from des@ofug.org) Received: by flood.ping.uio.no (Postfix, from userid 2602) id D1C3E5374; Sun, 8 Dec 2002 13:24:50 +0100 (CET) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: sparc@freebsd.org Cc: peter@freebsd.org Subject: Re: libc_r References: From: Dag-Erling Smorgrav Date: Sun, 08 Dec 2002 13:24:49 +0100 In-Reply-To: (Dag-Erling Smorgrav's message of "Sat, 07 Dec 2002 15:52:01 +0100") Message-ID: Lines: 14 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.2 (i386--freebsd) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-sparc@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --=-=-= Dag-Erling Smorgrav writes: > I haven't started on pthread_private.h yet, and I'm not sure I can > handle it on my own, but I hope this will inspire someone to tackle > it. Right, here's my attempt at making pthread_private.h work on sparc64. It builds, but I haven't tested it yet. DES -- Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pthread.diff Index: uthread/pthread_private.h =================================================================== RCS file: /home/ncvs/src/lib/libc_r/uthread/pthread_private.h,v retrieving revision 1.76 diff -u -r1.76 pthread_private.h --- uthread/pthread_private.h 13 Nov 2002 18:13:26 -0000 1.76 +++ uthread/pthread_private.h 8 Dec 2002 12:21:34 -0000 @@ -67,6 +67,7 @@ * address in a jmp_buf context. * * XXX - These need to be moved into architecture dependent support files. + * XXX - These need to be documented so porters know what's required. */ #if defined(__i386__) #define GET_STACK_JB(jb) ((unsigned long)((jb)[0]._jb[2])) @@ -101,6 +102,16 @@ (jb)[0]._jb[R_RA + 4] = (long)(ra); \ (jb)[0]._jb[R_T12 + 4] = (long)(ra); \ } while (0) +#elif defined(__sparc64__) +#define GET_STACK_JB(jb) ((unsigned long)((jb)[0]._jb[_JB_SP])) +#define GET_STACK_SJB(sjb) ((unsigned long)((sjb)[0]._sjb[_JB_SP])) +#define GET_STACK_UC(ucp) ((ucp)->uc_mcontext.mc_sp) +#define SET_STACK_JB(jb, stk) (jb)[0]._jb[_JB_SP] = (long)(stk) +#define SET_STACK_SJB(sjb, stk) (sjb)[0]._sjb[_JB_SP] = (long)(stk) +#define SET_STACK_UC(ucp, stk) (ucp)->uc_mcontext.mc_sp = (unsigned long)(stk) +#define FP_SAVE_UC(ucp) /* XXX */ +#define FP_RESTORE_UC(ucp) /* XXX */ +#define SET_RETURN_ADDR_JB(jb, ra) (jb)[0]._jb[_JB_PC] = (long)(ra) #else #error "Don't recognize this architecture!" #endif --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-sparc" in the body of the message