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>
19 # include "runtime-options.h"
24 #ifndef LANGUAGE_ASSEMBLY
26 #ifdef LISP_FEATURE_SB_THREAD
27 #define foreign_function_call_active_p(thread) \
28 (thread->foreign_function_call_active)
30 extern int foreign_function_call_active;
31 #define foreign_function_call_active_p(thread) \
32 foreign_function_call_active
35 extern os_vm_size_t dynamic_space_size;
36 extern os_vm_size_t thread_control_stack_size;
38 extern struct runtime_options *runtime_options;
40 #ifdef LISP_FEATURE_WIN32
41 #define ENVIRON _environ
43 #define ENVIRON environ
45 extern char **ENVIRON;
47 #if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_GCC_TLS)
48 extern pthread_key_t specials;
51 #if !defined(LISP_FEATURE_SB_THREAD)
52 extern lispobj *current_control_stack_pointer;
54 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) || !defined(LISP_FEATURE_SB_THREAD)
55 extern lispobj *current_control_frame_pointer;
57 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64) && !defined(LISP_FEATURE_SB_THREAD)
58 extern lispobj *current_binding_stack_pointer;
61 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
62 /* This is unused on X86 and X86_64, but is used as the global
63 * allocation pointer by the cheney GC, and, in some instances, as
64 * the global allocation pointer on PPC/GENCGC. This should probably
65 * be cleaned up such that it only needs to exist on cheney. At the
66 * moment, it is also used by the GENCGC, to hold the pseudo_atomic
67 * bits, and is tightly coupled to reg_ALLOC by the assembly
69 extern lispobj *dynamic_space_free_pointer;
72 # ifndef LISP_FEATURE_GENCGC
73 extern lispobj *current_auto_gc_trigger;
76 extern lispobj *current_dynamic_space;
78 extern void globals_init(void);
80 #else /* LANGUAGE_ASSEMBLY */
82 # ifdef LISP_FEATURE_MIPS
84 # define EXTERN(name,bytes) .globl name
86 # define EXTERN(name,bytes) .extern name bytes
90 # ifdef LISP_FEATURE_SPARC
92 # define EXTERN(name,bytes) .global name
94 # define EXTERN(name,bytes) .global _ ## name
98 # ifdef LISP_FEATURE_ALPHA
100 # define EXTERN(name,bytes) .globl name
104 # ifdef LISP_FEATURE_PPC
105 # ifdef LISP_FEATURE_DARWIN
106 # define EXTERN(name,bytes) .globl _ ## name
108 # define EXTERN(name,bytes) .globl name
112 # if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
113 # define EXTERN(name,bytes) .global name
116 # if defined(LISP_FEATURE_ALPHA) || defined(LISP_FEATURE_X86_64)
117 # define POINTERSIZE 8
119 # define POINTERSIZE 4
122 #ifndef LISP_FEATURE_SB_THREAD
123 EXTERN(foreign_function_call_active, 4)
126 #if !defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_C_STACK_IS_CONTROL_STACK)
127 EXTERN(current_control_stack_pointer, POINTERSIZE)
129 EXTERN(current_control_frame_pointer, POINTERSIZE)
130 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
131 EXTERN(current_binding_stack_pointer, POINTERSIZE)
133 # ifndef LISP_FEATURE_GENCGC
134 EXTERN(dynamic_space_free_pointer, POINTERSIZE)
137 #endif /* LANGUAGE_ASSEMBLY */
139 #endif /* _INCLUDED_GLOBALS_H_ */