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.
13 #ifndef _MINIX_SYS_CONFIG_H
14 #include <minix/sys_config.h>
17 #if !defined(_MINIX_CHIP)
18 #include "error, configuration is not known"
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.
25 #if (_MINIX_CHIP == _CHIP_INTEL)
30 #endif /* _WORD_SIZE == 4 */
36 int sr_st
; /* stack top -- used in kernel */
41 int sr_retadr
; /* return address to caller of save -- used
50 struct sigframe
{ /* stack frame created for signalled process */
51 _PROTOTYPE( void (*sf_retadr
), (void) );
54 struct sigcontext
*sf_scp
;
56 _PROTOTYPE( void (*sf_retadr2
), (void) );
57 struct sigcontext
*sf_scpcopy
;
61 #if (_MINIX_CHIP == _CHIP_M68000)
63 long sr_retreg
; /* d0 */
78 long sr_sp
; /* also known as a7 */
81 short sr_dummy
; /* make size multiple of 4 for system.c */
84 #include "error, _MINIX_CHIP is not supported"
86 #endif /* _MINIX_CHIP == _CHIP_INTEL */
89 int sc_flags
; /* sigstack state to restore */
90 long sc_mask
; /* signal mask to restore */
91 struct sigregs sc_regs
; /* register set to restore */
94 #if (_MINIX_CHIP == _CHIP_INTEL)
96 #define sc_gs sc_regs.sr_gs
97 #define sc_fs sc_regs.sr_fs
98 #endif /* _WORD_SIZE == 4 */
99 #define sc_es sc_regs.sr_es
100 #define sc_ds sc_regs.sr_ds
101 #define sc_di sc_regs.sr_di
102 #define sc_si sc_regs.sr_si
103 #define sc_fp sc_regs.sr_bp
104 #define sc_st sc_regs.sr_st /* stack top -- used in kernel */
105 #define sc_bx sc_regs.sr_bx
106 #define sc_dx sc_regs.sr_dx
107 #define sc_cx sc_regs.sr_cx
108 #define sc_retreg sc_regs.sr_retreg
109 #define sc_retadr sc_regs.sr_retadr /* return address to caller of
110 save -- used in kernel */
111 #define sc_pc sc_regs.sr_pc
112 #define sc_cs sc_regs.sr_cs
113 #define sc_psw sc_regs.sr_psw
114 #define sc_sp sc_regs.sr_sp
115 #define sc_ss sc_regs.sr_ss
116 #endif /* _MINIX_CHIP == _CHIP_INTEL */
118 #if (_MINIX_CHIP == M68000)
119 #define sc_retreg sc_regs.sr_retreg
120 #define sc_d1 sc_regs.sr_d1
121 #define sc_d2 sc_regs.sr_d2
122 #define sc_d3 sc_regs.sr_d3
123 #define sc_d4 sc_regs.sr_d4
124 #define sc_d5 sc_regs.sr_d5
125 #define sc_d6 sc_regs.sr_d6
126 #define sc_d7 sc_regs.sr_d7
127 #define sc_a0 sc_regs.sr_a0
128 #define sc_a1 sc_regs.sr_a1
129 #define sc_a2 sc_regs.sr_a2
130 #define sc_a3 sc_regs.sr_a3
131 #define sc_a4 sc_regs.sr_a4
132 #define sc_a5 sc_regs.sr_a5
133 #define sc_fp sc_regs.sr_a6
134 #define sc_sp sc_regs.sr_sp
135 #define sc_pc sc_regs.sr_pc
136 #define sc_psw sc_regs.sr_psw
137 #endif /* _MINIX_CHIP == M68000 */
139 _PROTOTYPE( int sigreturn
, (struct sigcontext
*_scp
) );
141 #endif /* _SIGCONTEXT_H */