Clean up RCS ids
[projects/cmucl/cmucl.git] / src / lisp / FreeBSD-os.h
CommitLineData
5ced0fdf 1/*
2
5ced0fdf 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
e67c0397 8#ifndef _FREEBSD_OS_H_
9#define _FREEBSD_OS_H_
10
5ced0fdf 11#include <sys/mman.h>
5ced0fdf 12
27bc1a7b 13#include <osreldate.h>
86957330 14#include <signal.h>
f3e5780e 15#include <ucontext.h>
1c58559d 16
86957330 17typedef void *os_vm_address_t;
18typedef size_t os_vm_size_t;
9a8c1c2f 19typedef off_t os_vm_offset_t;
20typedef int os_vm_prot_t;
f3e5780e 21#define os_context_t ucontext_t
5ced0fdf 22
670d643f 23#define OS_VM_PROT_READ PROT_READ
24#define OS_VM_PROT_WRITE PROT_WRITE
5ced0fdf 25#define OS_VM_PROT_EXECUTE PROT_EXEC
26
27#define OS_VM_DEFAULT_PAGESIZE 4096
28
00353423 29/* ucontext_t *context; using `void *' to compile without warning */
30#define HANDLER_ARGS int signal, siginfo_t *code, void *context
31
f3e5780e 32#define CODE(code) ((code) ? code->si_code : 0)
9495c516 33#define RESTORE_FPU(context) restore_fpu(context)
bf84be07 34
9495c516 35void restore_fpu(ucontext_t *);
670d643f 36
27bc1a7b 37#if __FreeBSD_version < 700004
670d643f 38#define PROTECTION_VIOLATION_SIGNAL SIGBUS
27bc1a7b 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
e67c0397 44
e67c0397 45#endif /* _FREEBSD_OS_H_ */