Initial revision
[sbcl.git] / src / runtime / bsd-os.h
1 /*
2  * This software is part of the SBCL system. See the README file for
3  * more information.
4  *
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.
10  */
11
12 /*
13  * $Header$
14  */
15
16 #ifdef __FreeBSD__
17 #include <osreldate.h>
18 #endif
19
20 #include <sys/types.h>
21 #include <sys/mman.h>
22 #include <sys/signal.h>
23
24 typedef caddr_t os_vm_address_t;
25 typedef vm_size_t os_vm_size_t;
26 typedef off_t os_vm_offset_t;
27 typedef int os_vm_prot_t;
28
29 #if defined __FreeBSD__
30 /* Note: The man page for sigaction(2) in FreeBSD 4.0 says that this
31  * is an mcontext_t, but according to comments by Raymond Wiker in the
32  * original FreeBSD port of SBCL, that's wrong, it's actually a
33  * ucontext_t. */
34 typedef ucontext_t os_context_t;
35 #elif defined __OpenBSD__
36 typedef struct sigcontext os_context_t;
37 #else
38 #error unsupported BSD variant
39 #endif
40
41 #define OS_VM_PROT_READ PROT_READ
42 #define OS_VM_PROT_WRITE PROT_WRITE
43 #define OS_VM_PROT_EXECUTE PROT_EXEC
44
45 #define OS_VM_DEFAULT_PAGESIZE  4096