3 $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/FreeBSD-os.h,v 1.23 2009/01/20 04:45:18 agoncharov Rel $
5 This code was written as part of the CMU Common Lisp project at
6 Carnegie Mellon University, and has been placed in the public domain.
10 #ifndef _FREEBSD_OS_H_
11 #define _FREEBSD_OS_H_
15 #include <osreldate.h>
19 typedef void *os_vm_address_t;
20 typedef size_t os_vm_size_t;
21 typedef off_t os_vm_offset_t;
22 typedef int os_vm_prot_t;
23 #define os_context_t ucontext_t
25 #define OS_VM_PROT_READ PROT_READ
26 #define OS_VM_PROT_WRITE PROT_WRITE
27 #define OS_VM_PROT_EXECUTE PROT_EXEC
29 #define OS_VM_DEFAULT_PAGESIZE 4096
31 /* ucontext_t *context; using `void *' to compile without warning */
32 #define HANDLER_ARGS int signal, siginfo_t *code, void *context
34 #define CODE(code) ((code) ? code->si_code : 0)
35 #define RESTORE_FPU(context) restore_fpu(context)
37 void restore_fpu(ucontext_t *);
39 #if __FreeBSD_version < 700004
40 #define PROTECTION_VIOLATION_SIGNAL SIGBUS
41 #define PROTECTION_VIOLATION_CODE BUS_PAGE_FAULT
43 #define PROTECTION_VIOLATION_SIGNAL SIGSEGV
44 #define PROTECTION_VIOLATION_CODE SEGV_ACCERR
47 #endif /* _FREEBSD_OS_H_ */