1.0.19.33: Improved interrupt handling on darwin/x86[-64]
[sbcl/eslaughter.git] / src / runtime / globals.h
blobeacb4405f56495884984311573b80796dc2bc029
1 /*
2 * This software is part of the SBCL system. See the README file for
3 * more information.
5 * This software is derived from the CMU CL system, which was
6 * written at Carnegie Mellon University and released into the
7 * public domain. The software is in the public domain and is
8 * provided with absolutely no warranty. See the COPYING and CREDITS
9 * files for more information.
12 #ifndef _INCLUDED_GLOBALS_H_
13 #define _INCLUDED_GLOBALS_H_
15 #ifndef LANGUAGE_ASSEMBLY
16 # include <sys/types.h>
17 # include <unistd.h>
18 # include "runtime.h"
19 #endif
21 #include "sbcl.h"
23 /* Currently threads live only on x86oid platforms, but this thing
24 * cannot ever work with threads, so... */
25 #if !defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
26 #define FOREIGN_FUNCTION_CALL_FLAG
27 #endif
29 #ifndef LANGUAGE_ASSEMBLY
31 #ifdef FOREIGN_FUNCTION_CALL_FLAG
32 extern int foreign_function_call_active;
33 #endif
35 extern size_t dynamic_space_size;
36 extern size_t thread_control_stack_size;
38 #ifdef LISP_FEATURE_WIN32
39 #define ENVIRON _environ
40 #else
41 #define ENVIRON environ
42 #endif
43 extern char **ENVIRON;
45 #if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_GCC_TLS)
46 extern pthread_key_t specials;
47 #endif
49 extern lispobj *current_control_stack_pointer;
50 extern lispobj *current_control_frame_pointer;
51 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
52 extern lispobj *current_binding_stack_pointer;
53 # endif
55 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
56 /* This is unused on X86 and X86_64, but is used as the global
57 * allocation pointer by the cheney GC, and, in some instances, as
58 * the global allocation pointer on PPC/GENCGC. This should probably
59 * be cleaned up such that it only needs to exist on cheney. At the
60 * moment, it is also used by the GENCGC, to hold the pseudo_atomic
61 * bits, and is tightly coupled to reg_ALLOC by the assembly
62 * routines. */
63 extern lispobj *dynamic_space_free_pointer;
64 #endif
66 # ifndef LISP_FEATURE_GENCGC
67 extern lispobj *current_auto_gc_trigger;
68 # endif
70 extern lispobj *current_dynamic_space;
72 extern void globals_init(void);
74 #else /* LANGUAGE_ASSEMBLY */
76 # ifdef LISP_FEATURE_MIPS
77 # ifdef __linux__
78 # define EXTERN(name,bytes) .globl name
79 # else
80 # define EXTERN(name,bytes) .extern name bytes
81 # endif
82 # endif
83 /**/
84 # ifdef LISP_FEATURE_SPARC
85 # ifdef SVR4
86 # define EXTERN(name,bytes) .global name
87 # else
88 # define EXTERN(name,bytes) .global _ ## name
89 # endif
90 # endif
91 /**/
92 # ifdef LISP_FEATURE_ALPHA
93 # ifdef __linux__
94 # define EXTERN(name,bytes) .globl name
95 # endif
96 # endif
97 /**/
98 # ifdef LISP_FEATURE_PPC
99 # ifdef LISP_FEATURE_DARWIN
100 # define EXTERN(name,bytes) .globl _/**/name
101 # else
102 # define EXTERN(name,bytes) .globl name
103 # endif
104 # endif
105 /**/
106 # if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
107 # define EXTERN(name,bytes) .global name
108 # endif
110 # if defined(LISP_FEATURE_ALPHA) || defined(LISP_FEATURE_X86_64)
111 # define POINTERSIZE 8
112 # else
113 # define POINTERSIZE 4
114 # endif
116 #ifdef FOREIGN_FUNCTION_CALL_FLAG
117 EXTERN(foreign_function_call_active, 4)
118 #endif
120 EXTERN(current_control_stack_pointer, POINTERSIZE)
121 EXTERN(current_control_frame_pointer, POINTERSIZE)
122 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
123 EXTERN(current_binding_stack_pointer, POINTERSIZE)
124 # endif
125 # ifndef LISP_FEATURE_GENCGC
126 EXTERN(dynamic_space_free_pointer, POINTERSIZE)
127 # endif
129 #endif /* LANGUAGE_ASSEMBLY */
131 #endif /* _INCLUDED_GLOBALS_H_ */