0.9.0.8:
[sbcl.git] / src / runtime / globals.h
1 /*
2  * This software is part of the SBCL system. See the README file for
3  * more information.
4  *
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.
10  */
11
12 #if !defined(_INCLUDE_GLOBALS_H_)
13 #define _INCLUDED_GLOBALS_H_
14
15 #ifndef LANGUAGE_ASSEMBLY
16
17 #include <sys/types.h>
18 #include <unistd.h>
19 #include "sbcl.h"
20 #include "runtime.h"
21
22 extern int foreign_function_call_active;
23 extern boolean stop_the_world;
24
25 extern lispobj *current_control_stack_pointer;
26 extern lispobj *current_control_frame_pointer;
27 #if !defined(LISP_FEATURE_X86)
28 extern lispobj *current_binding_stack_pointer;
29 #endif
30
31 #if !defined(LISP_FEATURE_X86)
32 /* FIXME: Why doesn't the x86 need this? */
33 extern lispobj *dynamic_space_free_pointer;
34 extern lispobj *current_auto_gc_trigger;
35 #endif
36
37 extern lispobj *current_dynamic_space;
38 extern boolean stop_the_world;
39
40 extern void globals_init(void);
41
42 #else /* LANGUAGE_ASSEMBLY */
43
44 #ifdef LISP_FEATURE_MIPS
45 #ifdef __linux__
46 #define EXTERN(name,bytes) .globl name 
47 #else
48 #define EXTERN(name,bytes) .extern name bytes
49 #endif
50 #endif
51 /**/
52 #ifdef LISP_FEATURE_SPARC
53 #ifdef SVR4
54 #define EXTERN(name,bytes) .global name
55 #else
56 #define EXTERN(name,bytes) .global _ ## name
57 #endif
58 #endif
59 /**/
60 #ifdef LISP_FEATURE_ALPHA
61 #ifdef __linux__
62 #define EXTERN(name,bytes) .globl name 
63 #endif
64 #endif
65 #ifdef LISP_FEATURE_PPC
66 #ifdef LISP_FEATURE_DARWIN
67 #define EXTERN(name,bytes) .globl _/**/name
68 #else
69 #define EXTERN(name,bytes) .globl name 
70 #endif
71 #endif
72 #ifdef LISP_FEATURE_X86
73 #ifdef __linux__
74 /* I'm very dubious about this.  Linux hasn't used _ on external names
75  * since ELF became prevalent - i.e. about 1996, on x86    -dan 20010125 */
76 #define EXTERN(name,bytes) .globl _/**/name
77 #else
78 #define EXTERN(name,bytes) .global _ ## name
79 #endif
80 #endif
81
82 /* FIXME : these sizes are, incidentally, bogus on Alpha.  But the
83  * EXTERN macro doesn't use its second arg anyway, so no immediate harm
84  * done   -dan 2002.05.07
85  */
86
87 EXTERN(foreign_function_call_active, 4)
88
89 EXTERN(current_control_stack_pointer, 4)
90 EXTERN(current_control_frame_pointer, 4)
91 EXTERN(current_binding_stack_pointer, 4)
92 EXTERN(dynamic_space_free_pointer, 4)
93 EXTERN(current_dynamic_space, 4)
94
95 #endif /* LANGUAGE_ASSEMBLY */
96
97 #endif /* _INCLUDED_GLOBALS_H_ */