Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc Add PPC TLS support. Add -D_LIBC_SOURCE for tls.c ...



details:   https://anonhg.NetBSD.org/src/rev/c6a7155147ae
branches:  trunk
changeset: 763175:c6a7155147ae
user:      matt <matt%NetBSD.org@localhost>
date:      Sat Mar 12 07:55:09 2011 +0000

description:
Add PPC TLS support.  Add -D_LIBC_SOURCE for tls.c and _lwp.c (powerpc)
so that __lwp_gettcb_fast and __lwp_settcb inlines are define.

diffstat:

 lib/libc/arch/powerpc/gen/Makefile.inc |  4 +++-
 lib/libc/arch/powerpc/gen/_lwp.c       |  9 +++++----
 lib/libc/tls/Makefile.inc              |  5 +++--
 3 files changed, 11 insertions(+), 7 deletions(-)

diffs (68 lines):

diff -r 76f3f8dd8122 -r c6a7155147ae lib/libc/arch/powerpc/gen/Makefile.inc
--- a/lib/libc/arch/powerpc/gen/Makefile.inc    Sat Mar 12 07:52:37 2011 +0000
+++ b/lib/libc/arch/powerpc/gen/Makefile.inc    Sat Mar 12 07:55:09 2011 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.24 2009/12/06 07:12:17 uebayasi Exp $
+#      $NetBSD: Makefile.inc,v 1.25 2011/03/12 07:55:09 matt Exp $
 
 SRCS+= __setjmp14.S __sigsetjmp14.S _setjmp.S
 SRCS+= bswap16.c bswap32.c bswap64.c
@@ -21,6 +21,8 @@
 SRCS+= fpgetsticky.c fpsetsticky.c
 .endif
 
+CPPFLAGS._lwp.c        += -D_LIBC_SOURCE
+
 LSRCS.powerpc.gen=Lint_swapcontext.c
 LSRCS+=                ${LSRCS.powerpc.gen}
 DPSRCS+=       ${LSRCS.powerpc.gen}
diff -r 76f3f8dd8122 -r c6a7155147ae lib/libc/arch/powerpc/gen/_lwp.c
--- a/lib/libc/arch/powerpc/gen/_lwp.c  Sat Mar 12 07:52:37 2011 +0000
+++ b/lib/libc/arch/powerpc/gen/_lwp.c  Sat Mar 12 07:55:09 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:42 joerg Exp $   */
+/*     $NetBSD: _lwp.c,v 1.6 2011/03/12 07:55:09 matt Exp $    */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:42 joerg Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.6 2011/03/12 07:55:09 matt Exp $");
 #endif /* LIBC_SCCS and not lint */
 
 #include "namespace.h"
@@ -48,7 +48,7 @@
 
 void
 _lwp_makecontext(ucontext_t *u, void (*start)(void *), void *arg,
-       void *private, caddr_t stack_base, size_t stack_size)
+       void *tcb, caddr_t stack_base, size_t stack_size)
 {
        void    **sp;
 
@@ -64,5 +64,6 @@
        u->uc_mcontext.__gregs[1] = ((int) sp) - 12;    /* stack */
        u->uc_mcontext.__gregs[33] = (int) _lwp_exit;   /* LR */
        u->uc_mcontext.__gregs[34] = (int) start;       /* PC */
-       u->uc_mcontext.__gregs[_REG_R2] = (__greg_t) private;
+       u->uc_mcontext.__gregs[_REG_R2] =
+           (__greg_t)tcb + TLS_TP_OFFSET + sizeof(struct tls_tcb);
 }
diff -r 76f3f8dd8122 -r c6a7155147ae lib/libc/tls/Makefile.inc
--- a/lib/libc/tls/Makefile.inc Sat Mar 12 07:52:37 2011 +0000
+++ b/lib/libc/tls/Makefile.inc Sat Mar 12 07:55:09 2011 +0000
@@ -1,8 +1,9 @@
-#      $NetBSD: Makefile.inc,v 1.1 2011/03/09 23:10:06 joerg Exp $
+#      $NetBSD: Makefile.inc,v 1.2 2011/03/12 07:55:09 matt Exp $
 
 .include <bsd.own.mk>
 
 # Our sources
 .PATH: ${.PARSEDIR} ${ARCHDIR}/tls
 
-SRCS+= tls.c
+SRCS+=                 tls.c
+CPPFLAGS.tls.c+=       -D_LIBC_SOURCE



Home | Main Index | Thread Index | Old Index