diff options
author | Artur Grabowski <art@cvs.openbsd.org> | 2002-07-20 19:24:58 +0000 |
---|---|---|
committer | Artur Grabowski <art@cvs.openbsd.org> | 2002-07-20 19:24:58 +0000 |
commit | e4a211bbec694bd8f760b505efa05e164a04da1b (patch) | |
tree | b37670277517419a042dee847a6f840ac7430b7f /sys/arch/sparc64 | |
parent | 09b17f5dab5c4c6d73c813f334ed5cb1d9c679aa (diff) |
Instead of copying out the signal trampoline on top of the stack, create
an uvm aobj, copy out the signal trampoline into it and share that page
among all processes for the same emulation.
This also requires us to actually be able to tell signal code where the
trampoline is located, so introduce a new field in struct proc - p_sigcode
that is a pointer to sigcode. This allows us to remove all the ugly
calculations of the signal trampoline address done in every sendsig
function in the tree (that's why so many files are changed).
Tested by various people. ok deraadt@
Diffstat (limited to 'sys/arch/sparc64')
-rw-r--r-- | sys/arch/sparc64/sparc64/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/sparc64/netbsd_machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc64/stand/ofwboot/version | 2 |
3 files changed, 5 insertions, 9 deletions
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c index 4fe6af36656..ddf79f9c508 100644 --- a/sys/arch/sparc64/sparc64/machdep.c +++ b/sys/arch/sparc64/sparc64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.46 2002/07/10 20:30:15 jsyn Exp $ */ +/* $OpenBSD: machdep.c,v 1.47 2002/07/20 19:24:57 art Exp $ */ /* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */ /*- @@ -625,8 +625,6 @@ sendsig(catcher, sig, mask, code, type, val) struct rwindow *oldsp, *newsp; struct sigframe sf; int onstack; - extern char sigcode[], esigcode[]; -#define szsigcode (esigcode - sigcode) tf = p->p_md.md_tf; oldsp = (struct rwindow *)(u_long)(tf->tf_out[6] + STACK_OFFSET); @@ -710,7 +708,7 @@ sendsig(catcher, sig, mask, code, type, val) * Arrange to continue execution at the code copied out in exec(). * It needs the function to call in %g1, and a new stack pointer. */ - addr = (vaddr_t)PS_STRINGS - szsigcode; + addr = p->p_sigcode; tf->tf_global[1] = (vaddr_t)catcher; tf->tf_pc = addr; tf->tf_npc = addr + 4; diff --git a/sys/arch/sparc64/sparc64/netbsd_machdep.c b/sys/arch/sparc64/sparc64/netbsd_machdep.c index c5c527cb5f5..7bbf4f02e51 100644 --- a/sys/arch/sparc64/sparc64/netbsd_machdep.c +++ b/sys/arch/sparc64/sparc64/netbsd_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netbsd_machdep.c,v 1.3 2002/06/15 17:23:31 art Exp $ */ +/* $OpenBSD: netbsd_machdep.c,v 1.4 2002/07/20 19:24:57 art Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -146,8 +146,6 @@ netbsd_sendsig(catcher, sig, mask, code, type, val) struct rwindow *oldsp, *newsp; struct netbsd_sigframe sf, *fp; int onstack; - extern char netbsd_sigcode[], netbsd_esigcode[]; -#define szsigcode (netbsd_esigcode - netbsd_sigcode) tf = p->p_md.md_tf; oldsp = (struct rwindow *)(u_long)(tf->tf_out[6] + STACK_OFFSET); @@ -215,7 +213,7 @@ netbsd_sendsig(catcher, sig, mask, code, type, val) * Arrange to continue execution at the code copied out in exec(). * It needs the function to call in %g1, and a new stack pointer. */ - addr = (vaddr_t)PS_STRINGS - szsigcode; + addr = p->p_sigcode; tf->tf_global[1] = (vaddr_t)catcher; tf->tf_pc = addr; tf->tf_npc = addr + 4; diff --git a/sys/arch/sparc64/stand/ofwboot/version b/sys/arch/sparc64/stand/ofwboot/version index 0cfbf08886f..b8626c4cff2 100644 --- a/sys/arch/sparc64/stand/ofwboot/version +++ b/sys/arch/sparc64/stand/ofwboot/version @@ -1 +1 @@ -2 +4 |