2 * This software is part of the SBCL system. See the README file for
5 * This software is derived from the CMU CL system, which was
6 * written at Carnegie Mellon University and released into the
7 * public domain. The software is in the public domain and is
8 * provided with absolutely no warranty. See the COPYING and CREDITS
9 * files for more information.
13 #include <osreldate.h>
16 #include <sys/types.h>
18 #include <sys/signal.h>
20 typedef caddr_t os_vm_address_t;
21 typedef vm_size_t os_vm_size_t;
22 typedef off_t os_vm_offset_t;
23 typedef int os_vm_prot_t;
25 #if defined __FreeBSD__
26 /* Note: The man page for sigaction(2) in FreeBSD 4.0 says that this
27 * is an mcontext_t, but according to comments by Raymond Wiker in the
28 * original FreeBSD port of SBCL, that's wrong, it's actually a
30 typedef ucontext_t os_context_t;
31 /* KLUDGE: A hack inherited from CMU CL used to be conditional on
32 * !defined(__linux__), and has now been made conditional on
33 * CANNOT_GET_TO_SINGLE_STEP_FLAG: if the OS won't let us flip the
34 * single-step flag bit in the state stored in a signal context, then
35 * we need to mess around with overwriting preceding code with
36 * bit-flipping code. This isn't needed in Linux or OpenBSD; I haven't
37 * been able to test whether it's still needed in FreeBSD, so for
38 * conservatism it's left in. -- WHN 2000-10-24 */
39 #define CANNOT_GET_TO_SINGLE_STEP_FLAG
40 #elif defined __OpenBSD__
41 typedef struct sigcontext os_context_t;
43 #error unsupported BSD variant
46 #define OS_VM_PROT_READ PROT_READ
47 #define OS_VM_PROT_WRITE PROT_WRITE
48 #define OS_VM_PROT_EXECUTE PROT_EXEC
50 #define OS_VM_DEFAULT_PAGESIZE 4096