4f59a1ab8dabbf856ed519be6a35e37b677e62ab
[projects/cmucl/cmucl.git] / src / lisp / sunos-os.h
1 /*
2
3  $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/sunos-os.h,v 1.14 2010/12/22 02:12:52 rtoy Exp $
4
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.
7
8 */
9
10 #ifndef _SUNOS_OS_H_
11 #define _SUNOS_OS_H_
12
13 #ifdef SOLARIS
14 #undef boolean
15 #endif /* SOLARIS */
16
17 #include <sys/param.h>
18 #include <sys/types.h>
19 #include <string.h>
20
21 #ifdef SOLARIS
22 #define boolean int
23 #include <signal.h>
24 #include <unistd.h>
25 #include <sys/fcntl.h>
26 #endif /* SOLARIS */
27
28 #include <sys/mman.h>
29
30 #ifdef SOLARIS
31 #include <ucontext.h>
32 #define sigcontext ucontext
33
34 #endif /* SOLARIS */
35
36 typedef unsigned long os_vm_address_t;
37 typedef long os_vm_size_t;
38 typedef off_t os_vm_offset_t;
39 typedef int os_vm_prot_t;
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 #ifdef i386
46 #define OS_VM_DEFAULT_PAGESIZE  4096
47 #else
48 #define OS_VM_DEFAULT_PAGESIZE  8192
49 #endif
50
51 #ifdef SOLARIS
52 #include <ucontext.h>
53 #define HANDLER_ARGS int signal, siginfo_t *code, void *context
54 #define CODE(code)  ((code) ? code->si_code : 0)
55 typedef struct ucontext os_context_t__;
56 #define os_context_t os_context_t__
57 #ifndef i386
58 #define SAVE_CONTEXT() save_context()
59 #endif
60
61 #ifdef NULL
62 #undef NULL
63 #define NULL 0
64 #endif
65
66 extern void flush_icache(unsigned int *, unsigned int);
67 extern void save_context(void);
68
69 #endif /* SOLARIS */
70
71 #define PROTECTION_VIOLATION_SIGNAL SIGSEGV
72
73 #endif /* _SUNOS_OS_H_ */