Setjmp/longjmp updates and cleanup.
This commit is contained in:
45
include/sys/jmp_buf.h
Normal file
45
include/sys/jmp_buf.h
Normal file
@@ -0,0 +1,45 @@
|
||||
/* This file is intended for use by program code (possibly written in
|
||||
* assembly) that needs to manipulate a jmp_buf or sigjmp_buf. The JB_*
|
||||
* values are byte offsets into the jmp_buf and sigjmp_buf structures.
|
||||
*/
|
||||
|
||||
#ifndef _JMP_BUF_H
|
||||
#define _JMP_BUF_H
|
||||
|
||||
#include <minix/config.h>
|
||||
|
||||
#if defined(__ACK__)
|
||||
/* as per lib/ack/rts/setjmp.e */
|
||||
|
||||
/* note the lack of parentheses, which would confuse 'as' */
|
||||
#define JB_PC 0
|
||||
#define JB_SP JB_PC + _EM_PSIZE
|
||||
#define JB_LB JB_SP + _EM_PSIZE
|
||||
#define JB_MASK JB_LB + _EM_PSIZE
|
||||
#define JB_FLAGS JB_MASK + _EM_LSIZE
|
||||
|
||||
#if (CHIP == INTEL)
|
||||
#define JB_BP JB_LB
|
||||
#endif
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
#if (CHIP == INTEL) && (_WORD_SIZE == 4)
|
||||
/* as per lib/gnu/rts/__setjmp.gs */
|
||||
|
||||
#define JB_FLAGS 0
|
||||
#define JB_MASK 4
|
||||
#define JB_PC 8
|
||||
#define JB_SP 12
|
||||
#define JB_BP 16
|
||||
#define JB_BX 20
|
||||
#define JB_CX 24
|
||||
#define JB_DX 28
|
||||
#define JB_SI 32
|
||||
#define JB_DI 36
|
||||
|
||||
#endif /* (CHIP == INTEL) && (_WORD_SIZE == 4) */
|
||||
|
||||
#endif /* __GNU__ */
|
||||
|
||||
#endif /* _JMP_BUF_H */
|
||||
@@ -136,11 +136,6 @@ struct sigcontext {
|
||||
#define sc_psw sc_regs.sr_psw
|
||||
#endif /* _MINIX_CHIP == M68000 */
|
||||
|
||||
/* Values for sc_flags. Must agree with <minix/jmp_buf.h>. */
|
||||
#define SC_SIGCONTEXT 2 /* nonzero when signal context is included */
|
||||
#define SC_NOREGLOCALS 4 /* nonzero when registers are not to be
|
||||
saved and restored */
|
||||
|
||||
_PROTOTYPE( int sigreturn, (struct sigcontext *_scp) );
|
||||
|
||||
#endif /* _SIGCONTEXT_H */
|
||||
|
||||
Reference in New Issue
Block a user