Module Name: src
Committed By: joerg
Date: Wed Jul 1 16:54:41 UTC 2009
Modified Files:
src/lib/libc/arch/x86_64/gen: _lwp.c
Log Message:
Reduce diff to makecontext.
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/libc/arch/x86_64/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/x86_64/gen/_lwp.c
diff -u src/lib/libc/arch/x86_64/gen/_lwp.c:1.4 src/lib/libc/arch/x86_64/gen/_lwp.c:1.5
--- src/lib/libc/arch/x86_64/gen/_lwp.c:1.4 Mon Apr 28 20:22:58 2008
+++ src/lib/libc/arch/x86_64/gen/_lwp.c Wed Jul 1 16:54:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: _lwp.c,v 1.4 2008/04/28 20:22:58 martin Exp $ */
+/* $NetBSD: _lwp.c,v 1.5 2009/07/01 16:54:41 joerg Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: _lwp.c,v 1.4 2008/04/28 20:22:58 martin Exp $");
+__RCSID("$NetBSD: _lwp.c,v 1.5 2009/07/01 16:54:41 joerg Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -45,6 +45,7 @@
_lwp_makecontext(ucontext_t *u, void (*start)(void *),
void *arg, void *private, caddr_t stack_base, size_t stack_size)
{
+ __greg_t *gr = u->uc_mcontext.__gregs;
void **sp;
getcontext(u);
@@ -54,16 +55,16 @@
u->uc_stack.ss_size = stack_size;
/* LINTED uintptr_t is safe */
- u->uc_mcontext.__gregs[_REG_RIP] = (uintptr_t)start;
+ gr[_REG_RIP] = (uintptr_t)start;
sp = (void **) (((uintptr_t)(stack_base + stack_size) & ~15) - 8);
/* LINTED __greg_t is safe */
- u->uc_mcontext.__gregs[_REG_RDI] = (__greg_t)arg;
+ gr[_REG_RDI] = (__greg_t)arg;
*--sp = (void *) _lwp_exit;
/* LINTED uintptr_t is safe */
- u->uc_mcontext.__gregs[_REG_URSP] = (uintptr_t) sp;
+ gr[_REG_URSP] = (uintptr_t) sp;
/* LINTED private is currently unused */
}