#ifndef KERN_PROC_PATHNAME
#define KERN_PROC_PATHNAME 12
#endif
+
+#define UAP_STACK_POINTER_TYPE __register_t
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);
+#define UAP_STACK_POINTER_TYPE greg_t
+
}
#define UAP_STACK_POINTER(ucontext) (((ucontext_t *)ucontext)->uc_stack.ss_sp)
+#define UAP_STACK_POINTER_TYPE void*
+
}
#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
--- /dev/null
+#define UAP_STACK_POINTER_TYPE __greg_t
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;
}
#endif
#elif defined(__OpenBSD__)
#define FACTOR_OS_STRING "openbsd"
+ #include "os-openbsd.hpp"
#if defined(FACTOR_X86)
#include "os-openbsd-x86.32.hpp"
#endif
#elif defined(__NetBSD__)
#define FACTOR_OS_STRING "netbsd"
+ #include "os-netbsd.hpp"
#if defined(FACTOR_X86)
#include "os-netbsd-x86.32.hpp"
#error "Unsupported NetBSD flavor"
#endif
- #include "os-netbsd.hpp"
#elif defined(linux)
#define FACTOR_OS_STRING "linux"
#include "os-linux.hpp"