Updates for Intel Mac

release
Slava 2007-09-20 19:17:17 -04:00
parent dac4a5598c
commit 8c022cced5
5 changed files with 16 additions and 23 deletions

BIN
Factor.app/Contents/MacOS/factor Executable file

Binary file not shown.

View File

@ -1,8 +1,13 @@
#if defined(__APPLE__) || (defined(WINDOWS) && !defined(__arm__)) #if defined(__APPLE__) || (defined(WINDOWS) && !defined(__arm__))
#define MANGLE(sym) _##sym #define MANGLE(sym) _##sym
#define XX @
#else #else
#define MANGLE(sym) sym #define MANGLE(sym) sym
#endif
/* Apple's PPC assembler is out of date? */
#if defined(__APPLE__) && defined(FACTOR_PPC)
#define XX @
#else
#define XX ; #define XX ;
#endif #endif

View File

@ -46,6 +46,3 @@ typedef struct _F_STACK_FRAME {
#define MACH_STACK_POINTER(thr_state) (thr_state)->r1 #define MACH_STACK_POINTER(thr_state) (thr_state)->r1
#define MACH_PROGRAM_COUNTER(thr_state) (thr_state)->srr0 #define MACH_PROGRAM_COUNTER(thr_state) (thr_state)->srr0
#endif #endif
#define UAP_PROGRAM_COUNTER(ucontext) \
MACH_PROGRAM_COUNTER(&(((ucontext_t *)(ucontext))->uc_mcontext->ss))

View File

@ -6,23 +6,11 @@
#define MACH_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT #define MACH_THREAD_STATE_COUNT i386_THREAD_STATE_COUNT
#if __DARWIN_UNIX03 #if __DARWIN_UNIX03
#define MACH_EXC_STATE_FAULT(exc_state) (exc_state).__faultvaddr #define MACH_EXC_STATE_FAULT(exc_state) (exc_state)->__faultvaddr
#define MACH_STACK_POINTER(thr_state) (thr_state).__esp #define MACH_STACK_POINTER(thr_state) (thr_state)->__esp
#define MACH_PROGRAM_COUNTER(thr_state) (thr_state).__eip #define MACH_PROGRAM_COUNTER(thr_state) (thr_state)->__eip
#else #else
#define MACH_EXC_STATE_FAULT(exc_state) (exc_state).faultvaddr #define MACH_EXC_STATE_FAULT(exc_state) (exc_state)->faultvaddr
#define MACH_STACK_POINTER(thr_state) (thr_state).esp #define MACH_STACK_POINTER(thr_state) (thr_state)->esp
#define MACH_PROGRAM_COUNTER(thr_state) (thr_state).eip #define MACH_PROGRAM_COUNTER(thr_state) (thr_state)->eip
#endif #endif
/* Adjust stack pointer so we can push an arg */
INLINE unsigned long fix_stack_ptr(unsigned long sp)
{
return sp - (sp & 0xf);
}
INLINE void pass_arg0(MACH_THREAD_STATE_TYPE *thr_state, CELL arg)
{
*(CELL *)MACH_STACK_POINTER(*thr_state) = arg;
MACH_STACK_POINTER(*thr_state) -= CELLS;
}

View File

@ -11,3 +11,6 @@ const char *vm_executable_path(void);
const char *default_image_path(void); const char *default_image_path(void);
DLLEXPORT void c_to_factor_toplevel(CELL quot); DLLEXPORT void c_to_factor_toplevel(CELL quot);
#define UAP_PROGRAM_COUNTER(ucontext) \
MACH_PROGRAM_COUNTER(&(((ucontext_t *)(ucontext))->uc_mcontext->ss))