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.
This commit is contained in:
parent
d972b61c0e
commit
69358e3723
|
@ -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+= fpgetround.c fpsetround.c fpgetmask.c fpsetmask.c
|
|||
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}
|
||||
|
|
|
@ -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 @@ __RCSID("$NetBSD: _lwp.c,v 1.5 2011/02/24 04:28:42 joerg Exp $");
|
|||
|
||||
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 @@ _lwp_makecontext(ucontext_t *u, void (*start)(void *), void *arg,
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue