[4] | 1 | #ifndef _SIGCONTEXT_H
|
---|
| 2 | #define _SIGCONTEXT_H
|
---|
| 3 |
|
---|
| 4 | /* The sigcontext structure is used by the sigreturn(2) system call.
|
---|
| 5 | * sigreturn() is seldom called by user programs, but it is used internally
|
---|
| 6 | * by the signal catching mechanism.
|
---|
| 7 | */
|
---|
| 8 |
|
---|
| 9 | #ifndef _ANSI_H
|
---|
| 10 | #include <ansi.h>
|
---|
| 11 | #endif
|
---|
| 12 |
|
---|
| 13 | #ifndef _MINIX_SYS_CONFIG_H
|
---|
| 14 | #include <minix/sys_config.h>
|
---|
| 15 | #endif
|
---|
| 16 |
|
---|
| 17 | #if !defined(_MINIX_CHIP)
|
---|
| 18 | #include "error, configuration is not known"
|
---|
| 19 | #endif
|
---|
| 20 |
|
---|
| 21 | /* The following structure should match the stackframe_s structure used
|
---|
| 22 | * by the kernel's context switching code. Floating point registers should
|
---|
| 23 | * be added in a different struct.
|
---|
| 24 | */
|
---|
| 25 | struct sigregs {
|
---|
| 26 | short sr_gs;
|
---|
| 27 | short sr_fs;
|
---|
| 28 | short sr_es;
|
---|
| 29 | short sr_ds;
|
---|
| 30 | int sr_di;
|
---|
| 31 | int sr_si;
|
---|
| 32 | int sr_bp;
|
---|
| 33 | int sr_st; /* stack top -- used in kernel */
|
---|
| 34 | int sr_bx;
|
---|
| 35 | int sr_dx;
|
---|
| 36 | int sr_cx;
|
---|
| 37 | int sr_retreg;
|
---|
| 38 | int sr_retadr; /* return address to caller of save -- used
|
---|
| 39 | * in kernel */
|
---|
| 40 | int sr_pc;
|
---|
| 41 | int sr_cs;
|
---|
| 42 | int sr_psw;
|
---|
| 43 | int sr_sp;
|
---|
| 44 | int sr_ss;
|
---|
| 45 | };
|
---|
| 46 |
|
---|
| 47 | struct sigframe { /* stack frame created for signalled process */
|
---|
| 48 | _PROTOTYPE( void (*sf_retadr), (void) );
|
---|
| 49 | int sf_signo;
|
---|
| 50 | int sf_code;
|
---|
| 51 | struct sigcontext *sf_scp;
|
---|
| 52 | int sf_fp;
|
---|
| 53 | _PROTOTYPE( void (*sf_retadr2), (void) );
|
---|
| 54 | struct sigcontext *sf_scpcopy;
|
---|
| 55 | };
|
---|
| 56 |
|
---|
| 57 | struct sigcontext {
|
---|
| 58 | int sc_flags; /* sigstack state to restore */
|
---|
| 59 | long sc_mask; /* signal mask to restore */
|
---|
| 60 | struct sigregs sc_regs; /* register set to restore */
|
---|
| 61 | };
|
---|
| 62 |
|
---|
| 63 | #define sc_gs sc_regs.sr_gs
|
---|
| 64 | #define sc_fs sc_regs.sr_fs
|
---|
| 65 | #define sc_es sc_regs.sr_es
|
---|
| 66 | #define sc_ds sc_regs.sr_ds
|
---|
| 67 | #define sc_di sc_regs.sr_di
|
---|
| 68 | #define sc_si sc_regs.sr_si
|
---|
| 69 | #define sc_fp sc_regs.sr_bp
|
---|
| 70 | #define sc_st sc_regs.sr_st /* stack top -- used in kernel */
|
---|
| 71 | #define sc_bx sc_regs.sr_bx
|
---|
| 72 | #define sc_dx sc_regs.sr_dx
|
---|
| 73 | #define sc_cx sc_regs.sr_cx
|
---|
| 74 | #define sc_retreg sc_regs.sr_retreg
|
---|
| 75 | #define sc_retadr sc_regs.sr_retadr /* return address to caller of
|
---|
| 76 | save -- used in kernel */
|
---|
| 77 | #define sc_pc sc_regs.sr_pc
|
---|
| 78 | #define sc_cs sc_regs.sr_cs
|
---|
| 79 | #define sc_psw sc_regs.sr_psw
|
---|
| 80 | #define sc_sp sc_regs.sr_sp
|
---|
| 81 | #define sc_ss sc_regs.sr_ss
|
---|
| 82 |
|
---|
| 83 | /* Values for sc_flags. Must agree with <minix/jmp_buf.h>. */
|
---|
| 84 | #define SC_SIGCONTEXT 2 /* nonzero when signal context is included */
|
---|
| 85 | #define SC_NOREGLOCALS 4 /* nonzero when registers are not to be
|
---|
| 86 | saved and restored */
|
---|
| 87 |
|
---|
| 88 | _PROTOTYPE( int sigreturn, (struct sigcontext *_scp) );
|
---|
| 89 |
|
---|
| 90 | #endif /* _SIGCONTEXT_H */
|
---|