#include <sys/mman.h>
#include <sys/signal.h>
+#ifdef LISP_FEATURE_DARWIN
+#include <mach/mach_types.h>
+#endif
+
typedef caddr_t os_vm_address_t;
-#ifdef __NetBSD__
+#if defined __NetBSD__
typedef vsize_t os_vm_size_t;
+#elif defined __OpenBSD__
+typedef size_t os_vm_size_t;
#else
typedef vm_size_t os_vm_size_t;
#endif
* so we need to implement single stepping in a more roundabout way. */
#define CANNOT_GET_TO_SINGLE_STEP_FLAG
#define SIG_MEMORY_FAULT SIGBUS
+
#elif defined __OpenBSD__
+
typedef struct sigcontext os_context_t;
#define SIG_MEMORY_FAULT SIGSEGV
+
+#elif defined __NetBSD__
+
+#include <ucontext.h>
+typedef ucontext_t os_context_t;
+#define SIG_MEMORY_FAULT SIGSEGV
+
#elif defined LISP_FEATURE_DARWIN
/* man pages claim that the third argument is a sigcontext struct,
but ucontext_t is defined, matches sigcontext where sensible,
#include <ucontext.h>
typedef ucontext_t os_context_t;
#define SIG_MEMORY_FAULT SIGBUS
+
#else
#error unsupported BSD variant
#endif