Clean up RCS ids
[projects/cmucl/cmucl.git] / src / lisp / FreeBSD-os.h
1 /*
2
3  This code was written as part of the CMU Common Lisp project at
4  Carnegie Mellon University, and has been placed in the public domain.
5
6 */
7
8 #ifndef _FREEBSD_OS_H_
9 #define _FREEBSD_OS_H_
10
11 #include <sys/mman.h>
12
13 #include <osreldate.h>
14 #include <signal.h>
15 #include <ucontext.h>
16
17 typedef void *os_vm_address_t;
18 typedef size_t os_vm_size_t;
19 typedef off_t os_vm_offset_t;
20 typedef int os_vm_prot_t;
21 #define os_context_t ucontext_t
22
23 #define OS_VM_PROT_READ    PROT_READ
24 #define OS_VM_PROT_WRITE   PROT_WRITE
25 #define OS_VM_PROT_EXECUTE PROT_EXEC
26
27 #define OS_VM_DEFAULT_PAGESIZE  4096
28
29 /* ucontext_t *context; using `void *' to compile without warning */
30 #define HANDLER_ARGS int signal, siginfo_t *code, void *context
31
32 #define CODE(code)  ((code) ? code->si_code : 0)
33 #define RESTORE_FPU(context) restore_fpu(context)
34
35 void restore_fpu(ucontext_t *);
36
37 #if __FreeBSD_version < 700004
38 #define PROTECTION_VIOLATION_SIGNAL SIGBUS
39 #define PROTECTION_VIOLATION_CODE BUS_PAGE_FAULT
40 #else
41 #define PROTECTION_VIOLATION_SIGNAL SIGSEGV
42 #define PROTECTION_VIOLATION_CODE SEGV_ACCERR
43 #endif
44
45 #endif /* _FREEBSD_OS_H_ */