vm: fix compilation on various Unices
parent
b6dfdcb909
commit
19aef06741
|
@ -6,3 +6,5 @@ extern "C" int getosreldate();
|
||||||
#ifndef KERN_PROC_PATHNAME
|
#ifndef KERN_PROC_PATHNAME
|
||||||
#define KERN_PROC_PATHNAME 12
|
#define KERN_PROC_PATHNAME 12
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define UAP_STACK_POINTER_TYPE __register_t
|
||||||
|
|
|
@ -7,4 +7,6 @@ VM_C_API int inotify_init();
|
||||||
VM_C_API int inotify_add_watch(int fd, const char *name, u32 mask);
|
VM_C_API int inotify_add_watch(int fd, const char *name, u32 mask);
|
||||||
VM_C_API int inotify_rm_watch(int fd, u32 wd);
|
VM_C_API int inotify_rm_watch(int fd, u32 wd);
|
||||||
|
|
||||||
|
#define UAP_STACK_POINTER_TYPE greg_t
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,4 +15,6 @@ void c_to_factor_toplevel(cell quot);
|
||||||
|
|
||||||
#define UAP_STACK_POINTER(ucontext) (((ucontext_t *)ucontext)->uc_stack.ss_sp)
|
#define UAP_STACK_POINTER(ucontext) (((ucontext_t *)ucontext)->uc_stack.ss_sp)
|
||||||
|
|
||||||
|
#define UAP_STACK_POINTER_TYPE void*
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#include <ucontext.h>
|
#include <ucontext.h>
|
||||||
|
|
||||||
namespace factor
|
#define UAP_PROGRAM_COUNTER(uap) _UC_MACHINE_PC((ucontext_t *)uap)
|
||||||
{
|
|
||||||
|
|
||||||
#define UAP_PROGRAM_COUNTER(uap) _UC_MACHINE_PC((ucontext_t *)uap)
|
#define UAP_STACK_POINTER_TYPE __greg_t
|
||||||
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
#define UAP_STACK_POINTER_TYPE __greg_t
|
|
@ -141,7 +141,7 @@ segment::~segment()
|
||||||
|
|
||||||
void factor_vm::dispatch_signal(void *uap, void (handler)())
|
void factor_vm::dispatch_signal(void *uap, void (handler)())
|
||||||
{
|
{
|
||||||
UAP_STACK_POINTER(uap) = fix_callstack_top((stack_frame *)UAP_STACK_POINTER(uap));
|
UAP_STACK_POINTER(uap) = (UAP_STACK_POINTER_TYPE)fix_callstack_top((stack_frame *)UAP_STACK_POINTER(uap));
|
||||||
UAP_PROGRAM_COUNTER(uap) = (cell)handler;
|
UAP_PROGRAM_COUNTER(uap) = (cell)handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__OpenBSD__)
|
#elif defined(__OpenBSD__)
|
||||||
#define FACTOR_OS_STRING "openbsd"
|
#define FACTOR_OS_STRING "openbsd"
|
||||||
|
#include "os-openbsd.hpp"
|
||||||
|
|
||||||
#if defined(FACTOR_X86)
|
#if defined(FACTOR_X86)
|
||||||
#include "os-openbsd-x86.32.hpp"
|
#include "os-openbsd-x86.32.hpp"
|
||||||
|
@ -58,6 +59,7 @@
|
||||||
#endif
|
#endif
|
||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
#define FACTOR_OS_STRING "netbsd"
|
#define FACTOR_OS_STRING "netbsd"
|
||||||
|
#include "os-netbsd.hpp"
|
||||||
|
|
||||||
#if defined(FACTOR_X86)
|
#if defined(FACTOR_X86)
|
||||||
#include "os-netbsd-x86.32.hpp"
|
#include "os-netbsd-x86.32.hpp"
|
||||||
|
@ -67,7 +69,6 @@
|
||||||
#error "Unsupported NetBSD flavor"
|
#error "Unsupported NetBSD flavor"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "os-netbsd.hpp"
|
|
||||||
#elif defined(linux)
|
#elif defined(linux)
|
||||||
#define FACTOR_OS_STRING "linux"
|
#define FACTOR_OS_STRING "linux"
|
||||||
#include "os-linux.hpp"
|
#include "os-linux.hpp"
|
||||||
|
|
Loading…
Reference in New Issue