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/sparc | |
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/sparc')
-rw-r--r-- | sys/arch/sparc/sparc/machdep.c | 6 | ||||
-rw-r--r-- | sys/arch/sparc/sparc/svr4_machdep.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 41ed403374d..7de944e8aa1 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.83 2002/06/14 04:16:06 art Exp $ */ +/* $OpenBSD: machdep.c,v 1.84 2002/07/20 19:24:56 art Exp $ */ /* $NetBSD: machdep.c,v 1.85 1997/09/12 08:55:02 pk Exp $ */ /* @@ -525,8 +525,6 @@ sendsig(catcher, sig, mask, code, type, val) struct trapframe *tf; int caddr, oonstack, oldsp, newsp; struct sigframe sf; - extern char sigcode[], esigcode[]; -#define szsigcode (esigcode - sigcode) #ifdef COMPAT_SUNOS extern struct emul emul_sunos; #endif @@ -624,7 +622,7 @@ sendsig(catcher, sig, mask, code, type, val) } else #endif { - caddr = (int)PS_STRINGS - szsigcode; + caddr = p->p_sigcode; tf->tf_global[1] = (int)catcher; } tf->tf_pc = caddr; diff --git a/sys/arch/sparc/sparc/svr4_machdep.c b/sys/arch/sparc/sparc/svr4_machdep.c index cfd23afdf5d..cd448800d36 100644 --- a/sys/arch/sparc/sparc/svr4_machdep.c +++ b/sys/arch/sparc/sparc/svr4_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_machdep.c,v 1.10 2002/03/14 01:26:44 millert Exp $ */ +/* $OpenBSD: svr4_machdep.c,v 1.11 2002/07/20 19:24:57 art Exp $ */ /* $NetBSD: svr4_machdep.c,v 1.24 1997/07/29 10:04:45 fair Exp $ */ /* @@ -452,8 +452,6 @@ svr4_sendsig(catcher, sig, mask, code, type, val) struct svr4_sigframe *fp, frame; struct sigacts *psp = p->p_sigacts; int oonstack, oldsp, newsp, caddr; - extern char svr4_sigcode[], svr4_esigcode[]; - tf = (struct trapframe *)p->p_md.md_tf; oldsp = tf->tf_out[6]; @@ -514,7 +512,7 @@ svr4_sendsig(catcher, sig, mask, code, type, val) /* * Build context to run handler in. */ - caddr = (int)PS_STRINGS - (svr4_esigcode - svr4_sigcode); + caddr = p->p_sigcode; tf->tf_global[1] = (int)catcher; tf->tf_pc = caddr; |