Module Name: src
Committed By: rin
Date: Mon Jun 22 06:49:04 UTC 2020
Modified Files:
src/lib/libc/arch/powerpc/gen: _lwp.c
Log Message:
Turn on _UC_TLSBASE for sure in the same manner as other ports.
No functional changes since that flag is turned on via getcontext(2).
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/lib/libc/arch/powerpc/gen/_lwp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/arch/powerpc/gen/_lwp.c
diff -u src/lib/libc/arch/powerpc/gen/_lwp.c:1.7 src/lib/libc/arch/powerpc/gen/_lwp.c:1.8
--- src/lib/libc/arch/powerpc/gen/_lwp.c:1.7 Thu Mar 22 05:36:50 2012
+++ src/lib/libc/arch/powerpc/gen/_lwp.c Mon Jun 22 06:49:04 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: _lwp.c,v 1.7 2012/03/22 05:36:50 matt Exp $ */
+/* $NetBSD: _lwp.c,v 1.8 2020/06/22 06:49:04 rin 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.7 2012/03/22 05:36:50 matt Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.8 2020/06/22 06:49:04 rin Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -67,6 +67,8 @@ _lwp_makecontext(ucontext_t *u, void (*s
u->uc_mcontext.__gregs[1] = sp; /* stack */
u->uc_mcontext.__gregs[33] = (uintptr_t) _lwp_exit; /* LR */
u->uc_mcontext.__gregs[34] = (uintptr_t) start; /* PC */
+
u->uc_mcontext.__gregs[_REG_R2] =
(uintptr_t)tcb + TLS_TP_OFFSET + sizeof(struct tls_tcb);
+ u->uc_flags |= _UC_TLSBASE;
}