summaryrefslogtreecommitdiffstats
path: root/sys/alpha
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2002-01-10 02:36:30 +0000
committerdeischen <deischen@FreeBSD.org>2002-01-10 02:36:30 +0000
commitb11ad1474409669c5f7ff5cf0ea388966e0f1780 (patch)
tree2a93239f79207893ae0f93f4ff6b447555b16b84 /sys/alpha
parentf70fe994fa68e0808a81a45ceac9ac601ec99b40 (diff)
downloadFreeBSD-src-b11ad1474409669c5f7ff5cf0ea388966e0f1780.zip
FreeBSD-src-b11ad1474409669c5f7ff5cf0ea388966e0f1780.tar.gz
Use a spare slot in the machine context to identify the context format
and to inherently verify its validity. Alpha signal frames and trap frames are different; this field identifies which format the context is Set the machine context format (signal frame) before copying it out when sending a signal. Approved by: -arch
Diffstat (limited to 'sys/alpha')
-rw-r--r--sys/alpha/alpha/machdep.c1
-rw-r--r--sys/alpha/include/ucontext.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c
index 6680425..d43b841 100644
--- a/sys/alpha/alpha/machdep.c
+++ b/sys/alpha/alpha/machdep.c
@@ -1329,6 +1329,7 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
frame->tf_regs[FRAME_TRAPARG_A1];
sf.sf_uc.uc_mcontext.mc_regs[R_TRAPARG_A2] =
frame->tf_regs[FRAME_TRAPARG_A2];
+ sf.sf_uc.uc_mcontext.mc_format = __UC_REV0_SIGFRAME;
/*
* Allocate and validate space for the signal handler
diff --git a/sys/alpha/include/ucontext.h b/sys/alpha/include/ucontext.h
index 50b1418..3e88881 100644
--- a/sys/alpha/include/ucontext.h
+++ b/sys/alpha/include/ucontext.h
@@ -44,7 +44,10 @@ typedef struct __mcontext {
unsigned long mc_fpcr;
unsigned long mc_fp_control;
long mc_ownedfp;
- long __spare__[7];
+#define __UC_REV0_SIGFRAME 1 /* context is a signal frame */
+#define __UC_REV0_TRAPFRAME 2 /* context is a trap frame */
+ long mc_format;
+ long __spare__[6];
} mcontext_t;
#endif /* !_MACHINE_UCONTEXT_H_ */
OpenPOWER on IntegriCloud