summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-08-30 17:58:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-08-30 17:58:28 +0000
commite426eeb70603608c783eedcfd1fa2e34ce32ac14 (patch)
tree7264c34dcf85fb6d1d2ad7ad3be0cdac0df8019e /sys/arch
parented2a1dd34e3ad09e1f97648a746ba8f0eb0a292b (diff)
correctly deal with layout of sigframe
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/sparc64/sparc64/locore.s17
-rw-r--r--sys/arch/sparc64/sparc64/machdep.c3
2 files changed, 12 insertions, 8 deletions
diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s
index a3fc243c30f..10349de0525 100644
--- a/sys/arch/sparc64/sparc64/locore.s
+++ b/sys/arch/sparc64/sparc64/locore.s
@@ -6264,17 +6264,20 @@ _C_LABEL(cache_flush_phys):
* When this code is run, the stack looks like:
* [%sp] 128 bytes to which registers can be dumped
* [%sp + 128] signal number (goes in %o0)
- * [%sp + 128 + 4] signal code (goes in %o1)
- * [%sp + 128 + 8] first word of saved state (sigcontext)
+ * [%sp + 128 + 4] signal code (ignored)
+ * [%sp + 128 + 8] siginfo pointer(goes in %o1)
+ * [%sp + 128 + 16] first word of saved state (sigcontext)
* .
* .
* .
- * [%sp + NNN] last word of saved state
+ * [%sp + NNN] last word of saved state
+ * [%sp + ...] siginfo structure
* (followed by previous stack contents or top of signal stack).
* The address of the function to call is in %g1; the old %g1 and %o0
* have already been saved in the sigcontext. We are running in a clean
* window, all previous windows now being saved to the stack.
*
+ * XXX this is bullshit
* Note that [%sp + 128 + 8] == %sp + 128 + 16. The copy at %sp+128+8
* will eventually be removed, with a hole left in its place, if things
* work out.
@@ -6327,9 +6330,9 @@ _C_LABEL(sigcode):
membar #Sync
rd %y, %l1 ! in any case, save %y
lduw [%fp + BIAS + 128], %o0 ! sig
- lduw [%fp + BIAS + 128 + 4], %o1 ! code
- call %g1 ! (*sa->sa_handler)(sig,code,scp)
- add %fp, BIAS + 128 + 8, %o2 ! scp
+ ldx [%fp + BIAS + 128 + 8], %o1 ! siginfo
+ call %g1 ! (*sa->sa_handler)(sig, sip, scp)
+ add %fp, BIAS + 128 + 16, %o2 ! scp
/*
* Now that the handler has returned, re-establish all the state
@@ -6366,7 +6369,7 @@ _C_LABEL(sigcode):
membar #Sync
restore %g0, SYS_sigreturn, %g1 ! get registers back & set syscall #
- add %sp, BIAS + 128 + 8, %o0! compute scp
+ add %sp, BIAS + 128 + 16, %o0! compute scp
! andn %o0, 0x0f, %o0
t ST_SYSCALL ! sigreturn(scp)
! sigreturn does not return unless it fails
diff --git a/sys/arch/sparc64/sparc64/machdep.c b/sys/arch/sparc64/sparc64/machdep.c
index dadaee3060f..1b2faace659 100644
--- a/sys/arch/sparc64/sparc64/machdep.c
+++ b/sys/arch/sparc64/sparc64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.12 2001/08/30 15:26:57 jason Exp $ */
+/* $OpenBSD: machdep.c,v 1.13 2001/08/30 17:58:27 deraadt Exp $ */
/* $NetBSD: machdep.c,v 1.108 2001/07/24 19:30:14 eeh Exp $ */
/*-
@@ -502,6 +502,7 @@ int sigpid = 0;
struct sigframe {
int sf_signo; /* signal number */
+ int sf_code; /* signal code (unused) */
siginfo_t *sf_sip; /* points to siginfo_t */
#ifndef __arch64__
struct sigcontext *sf_scp; /* SunOS user addr of sigcontext */