2 * This software is part of the SBCL system. See the README file for
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>
23 #ifndef LANGUAGE_ASSEMBLY
25 #ifdef LISP_FEATURE_SB_THREAD
26 #define foreign_function_call_active_p(thread) \
27 (thread->foreign_function_call_active)
29 extern int foreign_function_call_active;
30 #define foreign_function_call_active_p(thread) \
31 foreign_function_call_active
34 extern size_t dynamic_space_size;
35 extern size_t thread_control_stack_size;
37 extern struct runtime_options *runtime_options;
39 #ifdef LISP_FEATURE_WIN32
40 #define ENVIRON _environ
42 #define ENVIRON environ
44 extern char **ENVIRON;
46 #if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_GCC_TLS)
47 extern pthread_key_t specials;
50 #if !defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_C_STACK_IS_CONTROL_STACK)
51 extern lispobj *current_control_stack_pointer;
53 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) || !defined(LISP_FEATURE_SB_THREAD)
54 extern lispobj *current_control_frame_pointer;
56 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64) && !defined(LISP_FEATURE_SB_THREAD)
57 extern lispobj *current_binding_stack_pointer;
60 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
61 /* This is unused on X86 and X86_64, but is used as the global
62 * allocation pointer by the cheney GC, and, in some instances, as
63 * the global allocation pointer on PPC/GENCGC. This should probably
64 * be cleaned up such that it only needs to exist on cheney. At the
65 * moment, it is also used by the GENCGC, to hold the pseudo_atomic
66 * bits, and is tightly coupled to reg_ALLOC by the assembly
68 extern lispobj *dynamic_space_free_pointer;
71 # ifndef LISP_FEATURE_GENCGC
72 extern lispobj *current_auto_gc_trigger;
75 extern lispobj *current_dynamic_space;
77 extern void globals_init(void);
79 #else /* LANGUAGE_ASSEMBLY */
81 # ifdef LISP_FEATURE_MIPS
83 # define EXTERN(name,bytes) .globl name
85 # define EXTERN(name,bytes) .extern name bytes
89 # ifdef LISP_FEATURE_SPARC
91 # define EXTERN(name,bytes) .global name
93 # define EXTERN(name,bytes) .global _ ## name
97 # ifdef LISP_FEATURE_ALPHA
99 # define EXTERN(name,bytes) .globl name
103 # ifdef LISP_FEATURE_PPC
104 # ifdef LISP_FEATURE_DARWIN
105 # define EXTERN(name,bytes) .globl _ ## name
107 # define EXTERN(name,bytes) .globl name
111 # if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
112 # define EXTERN(name,bytes) .global name
115 # if defined(LISP_FEATURE_ALPHA) || defined(LISP_FEATURE_X86_64)
116 # define POINTERSIZE 8
118 # define POINTERSIZE 4
121 #ifndef LISP_FEATURE_SB_THREAD
122 EXTERN(foreign_function_call_active, 4)
125 #if !defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_C_STACK_IS_CONTROL_STACK)
126 EXTERN(current_control_stack_pointer, POINTERSIZE)
128 EXTERN(current_control_frame_pointer, POINTERSIZE)
129 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
130 EXTERN(current_binding_stack_pointer, POINTERSIZE)
132 # ifndef LISP_FEATURE_GENCGC
133 EXTERN(dynamic_space_free_pointer, POINTERSIZE)
136 #endif /* LANGUAGE_ASSEMBLY */
138 #endif /* _INCLUDED_GLOBALS_H_ */