1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

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
This commit is contained in:
Daniel Eischen 2002-01-10 02:36:30 +00:00
parent 2e615b482d
commit 8ec12ea9ce
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=89176
2 changed files with 5 additions and 1 deletions

View File

@ -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

View File

@ -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_ */