2006-07-07 00:07:18 -04:00
|
|
|
#define SIGSEGV_EXC_STATE_TYPE i386_exception_state_t
|
|
|
|
|
#define SIGSEGV_EXC_STATE_FLAVOR i386_EXCEPTION_STATE
|
|
|
|
|
#define SIGSEGV_EXC_STATE_COUNT i386_EXCEPTION_STATE_COUNT
|
|
|
|
|
#define SIGSEGV_THREAD_STATE_TYPE i386_thread_state_t
|
|
|
|
|
#define SIGSEGV_THREAD_STATE_FLAVOR i386_THREAD_STATE
|
|
|
|
|
#define SIGSEGV_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT
|
2019-10-18 09:05:11 -04:00
|
|
|
|
|
|
|
|
#if __DARWIN_UNIX03
|
|
|
|
|
#define SIGSEGV_EXC_STATE_FAULT(exc_state) (exc_state).__faultvaddr
|
|
|
|
|
#define SIGSEGV_STACK_POINTER(thr_state) (thr_state).__esp
|
|
|
|
|
#define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).__eip
|
|
|
|
|
#else
|
|
|
|
|
#define SIGSEGV_EXC_STATE_FAULT(exc_state) (exc_state).faultvaddr
|
|
|
|
|
#define SIGSEGV_STACK_POINTER(thr_state) (thr_state).esp
|
|
|
|
|
#define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).eip
|
|
|
|
|
#endif
|
2006-07-07 00:15:31 -04:00
|
|
|
|
2006-08-05 18:10:01 -04:00
|
|
|
/* Adjust stack pointer so we can push an arg */
|
2006-07-07 03:46:05 -04:00
|
|
|
INLINE unsigned long fix_stack_ptr(unsigned long sp)
|
2006-07-07 00:15:31 -04:00
|
|
|
{
|
2006-10-02 01:11:56 -04:00
|
|
|
return sp - (sp & 0xf);
|
2006-07-07 00:15:31 -04:00
|
|
|
}
|
2006-08-05 18:10:01 -04:00
|
|
|
|
|
|
|
|
INLINE void pass_arg0(SIGSEGV_THREAD_STATE_TYPE *thr_state, CELL arg)
|
|
|
|
|
{
|
2019-10-18 09:05:11 -04:00
|
|
|
*(CELL *)SIGSEGV_STACK_POINTER(*thr_state) = arg;
|
|
|
|
|
SIGSEGV_STACK_POINTER(*thr_state) -= CELLS;
|
2006-08-05 18:10:01 -04:00
|
|
|
}
|