e8dd9debb53bcdb2214ab029d4daf92f6dd8ebdf
[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 pid_t parent_pid;
39 extern boolean stop_the_world;
40
41 extern void globals_init(void);
42
43 #else /* LANGUAGE_ASSEMBLY */
44
45 #ifdef mips
46 #ifdef __linux__
47 #define EXTERN(name,bytes) .globl name 
48 #else
49 #define EXTERN(name,bytes) .extern name bytes
50 #endif
51 #endif
52 /**/
53 #ifdef sparc
54 #ifdef SVR4
55 #define EXTERN(name,bytes) .global name
56 #else
57 #define EXTERN(name,bytes) .global _ ## name
58 #endif
59 #endif
60 /**/
61 #ifdef alpha
62 #ifdef __linux__
63 #define EXTERN(name,bytes) .globl name 
64 #endif
65 #endif
66 #ifdef ppc
67 #ifdef LISP_FEATURE_DARWIN
68 #define EXTERN(name,bytes) .globl _/**/name
69 #else
70 #define EXTERN(name,bytes) .globl name 
71 #endif
72 #endif
73 #ifdef LISP_FEATURE_X86
74 #ifdef __linux__
75 /* I'm very dubious about this.  Linux hasn't used _ on external names
76  * since ELF became prevalent - i.e. about 1996, on x86    -dan 20010125 */
77 #define EXTERN(name,bytes) .globl _/**/name
78 #else
79 #define EXTERN(name,bytes) .global _ ## name
80 #endif
81 #endif
82
83 /* FIXME : these sizes are, incidentally, bogus on Alpha.  But the
84  * EXTERN macro doesn't use its second arg anyway, so no immediate harm
85  * done   -dan 2002.05.07
86  */
87
88 EXTERN(foreign_function_call_active, 4)
89
90 EXTERN(current_control_stack_pointer, 4)
91 EXTERN(current_control_frame_pointer, 4)
92 EXTERN(current_binding_stack_pointer, 4)
93 EXTERN(dynamic_space_free_pointer, 4)
94 EXTERN(current_dynamic_space, 4)
95
96 #ifdef mips
97 EXTERN(current_flags_register, 4)
98 #endif
99
100 #endif /* LANGUAGE_ASSEMBLY */
101
102 #endif /* _INCLUDED_GLOBALS_H_ */