| eeab7066 |
1 | /* |
| 5ced0fdf |
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 | Morfed from the FreeBSD file by Peter Van Eynde (July 1996) |
| c9dd646e |
7 | Alpha support by Julian Dolby, 1999. |
| 8 | |
| 5ced0fdf |
9 | */ |
| 10 | |
| e67c0397 |
11 | #ifndef _LINUX_OS_H_ |
| 12 | #define _LINUX_OS_H_ |
| 13 | |
| 5ced0fdf |
14 | #include <stdlib.h> |
| 670d643f |
15 | #include <signal.h> |
| 1c58559d |
16 | #include <sys/param.h> |
| 5ced0fdf |
17 | #include <sys/types.h> |
| 18 | #include <sys/mman.h> |
| 19 | #include <sys/signal.h> |
| 9a8c1c2f |
20 | #include <string.h> |
| bde871c1 |
21 | /* #include <dlfcn.h> */ |
| 5ced0fdf |
22 | #include <sys/time.h> |
| 23 | #include <sys/stat.h> |
| 24 | #include <unistd.h> |
| 25 | #include <sys/syscall.h> |
| 26 | #include <asm/unistd.h> |
| 27 | #include <errno.h> |
| 4b96ae74 |
28 | |
| 9a8c1c2f |
29 | typedef caddr_t os_vm_address_t; /* like hpux */ |
| 30 | typedef size_t os_vm_size_t; /* like hpux */ |
| 31 | typedef off_t os_vm_offset_t; /* like hpux */ |
| 32 | typedef int os_vm_prot_t; /* like hpux */ |
| 342beebb |
33 | #define os_context_t ucontext_t |
| 5ced0fdf |
34 | |
| 9a8c1c2f |
35 | #define OS_VM_PROT_READ PROT_READ /* like hpux */ |
| 36 | #define OS_VM_PROT_WRITE PROT_WRITE /* like hpux */ |
| 37 | #define OS_VM_PROT_EXECUTE PROT_EXEC /* like hpux */ |
| 25b808fb |
38 | |
| 9a8c1c2f |
39 | #ifndef __alpha__ |
| 40 | #define OS_VM_DEFAULT_PAGESIZE 4096 /* like hpux */ |
| 25b808fb |
41 | #else |
| 9a8c1c2f |
42 | #define OS_VM_DEFAULT_PAGESIZE 8192 /* like hpux */ |
| 25b808fb |
43 | #endif |
| 5ced0fdf |
44 | |
| 44eba57f |
45 | void restore_fpu(ucontext_t *); |
| 25b808fb |
46 | |
| aa96ed2c |
47 | #define HANDLER_ARGS int signal, siginfo_t *code, void *context |
| 342beebb |
48 | #define CODE(code) ((code) ? code->si_code : 0) |
| 44eba57f |
49 | #define RESTORE_FPU(context) restore_fpu(context) |
| 25b808fb |
50 | |
| 670d643f |
51 | #define PROTECTION_VIOLATION_SIGNAL SIGSEGV |
| e67c0397 |
52 | |
| 53 | #endif /* _LINUX_OS_H_ */ |