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 extern lispobj *current_control_stack_pointer;
51 extern lispobj *current_control_frame_pointer;
52 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64) && !defined(LISP_FEATURE_SB_THREAD)
53 extern lispobj *current_binding_stack_pointer;
56 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
57 /* This is unused on X86 and X86_64, but is used as the global
58 * allocation pointer by the cheney GC, and, in some instances, as
59 * the global allocation pointer on PPC/GENCGC. This should probably
60 * be cleaned up such that it only needs to exist on cheney. At the
61 * moment, it is also used by the GENCGC, to hold the pseudo_atomic
62 * bits, and is tightly coupled to reg_ALLOC by the assembly
64 extern lispobj *dynamic_space_free_pointer;
67 # ifndef LISP_FEATURE_GENCGC
68 extern lispobj *current_auto_gc_trigger;
71 extern lispobj *current_dynamic_space;
73 extern void globals_init(void);
75 #else /* LANGUAGE_ASSEMBLY */
77 # ifdef LISP_FEATURE_MIPS
79 # define EXTERN(name,bytes) .globl name
81 # define EXTERN(name,bytes) .extern name bytes
85 # ifdef LISP_FEATURE_SPARC
87 # define EXTERN(name,bytes) .global name
89 # define EXTERN(name,bytes) .global _ ## name
93 # ifdef LISP_FEATURE_ALPHA
95 # define EXTERN(name,bytes) .globl name
99 # ifdef LISP_FEATURE_PPC
100 # ifdef LISP_FEATURE_DARWIN
101 # define EXTERN(name,bytes) .globl _ ## name
103 # define EXTERN(name,bytes) .globl name
107 # if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
108 # define EXTERN(name,bytes) .global name
111 # if defined(LISP_FEATURE_ALPHA) || defined(LISP_FEATURE_X86_64)
112 # define POINTERSIZE 8
114 # define POINTERSIZE 4
117 #ifndef LISP_FEATURE_SB_THREAD
118 EXTERN(foreign_function_call_active, 4)
121 EXTERN(current_control_stack_pointer, POINTERSIZE)
122 EXTERN(current_control_frame_pointer, POINTERSIZE)
123 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
124 EXTERN(current_binding_stack_pointer, POINTERSIZE)
126 # ifndef LISP_FEATURE_GENCGC
127 EXTERN(dynamic_space_free_pointer, POINTERSIZE)
130 #endif /* LANGUAGE_ASSEMBLY */
132 #endif /* _INCLUDED_GLOBALS_H_ */