Eliminate another #ifdef

slava 2006-07-07 04:15:31 +00:00
parent 8d60d0f9c9
commit c5a6f75488
3 changed files with 13 additions and 8 deletions

View File

@ -69,17 +69,10 @@ catch_exception_raise (mach_port_t exception_port,
sp = (unsigned long) (SIGSEGV_STACK_POINTER (thread_state)); sp = (unsigned long) (SIGSEGV_STACK_POINTER (thread_state));
#ifdef __i386__
if ((sp & 0xf) != 0)
sp -= (sp & 0xf);
sp -= 4;
#endif
save_thread_state = thread_state; save_thread_state = thread_state;
SIGSEGV_PROGRAM_COUNTER (thread_state) = (unsigned long) terminating_handler; SIGSEGV_PROGRAM_COUNTER (thread_state) = (unsigned long) terminating_handler;
SIGSEGV_STACK_POINTER (thread_state) = sp; SIGSEGV_STACK_POINTER (thread_state) = fix_stack_ptr(sp);
/* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/thread_set_state.html. */ /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/thread_set_state.html. */
if (thread_set_state (thread, SIGSEGV_THREAD_STATE_FLAVOR, if (thread_set_state (thread, SIGSEGV_THREAD_STATE_FLAVOR,

View File

@ -6,3 +6,8 @@
#define SIGSEGV_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT #define SIGSEGV_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT
#define SIGSEGV_STACK_POINTER(thr_state) (thr_state).r1 #define SIGSEGV_STACK_POINTER(thr_state) (thr_state).r1
#define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).srr0 #define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).srr0
INLINE void fix_stack_ptr(unsigned long sp)
{
return sp;
}

View File

@ -6,3 +6,10 @@
#define SIGSEGV_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT #define SIGSEGV_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT
#define SIGSEGV_STACK_POINTER(thr_state) (thr_state).esp #define SIGSEGV_STACK_POINTER(thr_state) (thr_state).esp
#define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).eip #define SIGSEGV_PROGRAM_COUNTER(thr_state) (thr_state).eip
INLINE void fix_stack_ptr(unsigned long sp)
{
if ((sp & 0xf) != 0) sp -= (sp & 0xf);
sp -= 4;
return sp;
}