Fix Linux/PPC port

db4
Doug Coleman 2008-04-09 16:58:55 -05:00
parent d748c367c0
commit 2da9aa9d18
4 changed files with 15 additions and 10 deletions

View File

@ -1,4 +1,12 @@
#include <ucontext.h>
#define FRAME_RETURN_ADDRESS(frame) *((XT *)(frame_successor(frame) + 1) + 1)
INLINE void *ucontext_stack_pointer(void *uap)
{
ucontext_t *ucontext = (ucontext_t *)uap;
return (void *)ucontext->uc_mcontext.uc_regs->gregs[PT_R1];
}
#define UAP_PROGRAM_COUNTER(ucontext) \
(((ucontext_t *)(ucontext))->uc_mcontext.uc_regs->gregs[PT_NIP])

View File

@ -15,4 +15,10 @@ DLLEXPORT void c_to_factor_toplevel(CELL quot);
#ifndef environ
extern char ***_NSGetEnviron(void);
#define environ (*_NSGetEnviron())
#endif
#endif
INLINE void *ucontext_stack_pointer(void *uap)
{
ucontext_t *ucontext = (ucontext_t *)uap;
return ucontext->uc_stack.ss_sp;
}

View File

@ -1,7 +0,0 @@
#include <ucontext.h>
INLINE void *ucontext_stack_pointer(void *uap)
{
ucontext_t *ucontext = (ucontext_t *)uap;
return ucontext->uc_stack.ss_sp;
}

View File

@ -27,7 +27,6 @@
#include "os-unix.h"
#ifdef __APPLE__
#include "os-unix-ucontext.h"
#include "os-macosx.h"
#include "mach_signal.h"
@ -84,7 +83,6 @@
#if defined(FACTOR_X86)
#include "os-linux-x86.32.h"
#elif defined(FACTOR_PPC)
#include "os-unix-ucontext.h"
#include "os-linux-ppc.h"
#elif defined(FACTOR_ARM)
#include "os-linux-arm.h"