2064f6f08b194bbab7d9b59a019cc4a732e08469
[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 "runtime.h"
20
21 extern int foreign_function_call_active;
22 extern boolean stop_the_world;
23
24 extern lispobj *current_control_stack_pointer;
25 extern lispobj *current_control_frame_pointer;
26 #if !defined(LISP_FEATURE_X86)
27 extern lispobj *current_binding_stack_pointer;
28 #endif
29
30 #if !defined(LISP_FEATURE_X86)
31 /* FIXME: Why doesn't the x86 need this? */
32 extern lispobj *dynamic_space_free_pointer;
33 extern lispobj *current_auto_gc_trigger;
34 #endif
35
36 extern lispobj *current_dynamic_space;
37 extern pid_t parent_pid;
38 extern boolean stop_the_world;
39
40 extern void globals_init(void);
41
42 #else /* LANGUAGE_ASSEMBLY */
43
44 #ifdef mips
45 #define EXTERN(name,bytes) .extern name bytes
46 #endif
47 /**/
48 #ifdef sparc
49 #ifdef SVR4
50 #define EXTERN(name,bytes) .global name
51 #else
52 #define EXTERN(name,bytes) .global _ ## name
53 #endif
54 #endif
55 /**/
56 #ifdef alpha
57 #ifdef __linux__
58 #define EXTERN(name,bytes) .globl name 
59 #endif
60 #endif
61 #ifdef ppc
62 #ifdef DARWIN
63 #define EXTERN(name,bytes) .globl _/**/name
64 #else
65 #define EXTERN(name,bytes) .globl name 
66 #endif
67 #endif
68 #ifdef LISP_FEATURE_X86
69 #ifdef __linux__
70 /* I'm very dubious about this.  Linux hasn't used _ on external names
71  * since ELF became prevalent - i.e. about 1996, on x86    -dan 20010125 */
72 #define EXTERN(name,bytes) .globl _/**/name
73 #else
74 #define EXTERN(name,bytes) .global _ ## name
75 #endif
76 #endif
77
78 /* FIXME : these sizes are, incidentally, bogus on Alpha.  But the
79  * EXTERN macro doesn't use its second arg anyway, so no immediate harm
80  * done   -dan 2002.05.07
81  */
82
83 EXTERN(foreign_function_call_active, 4)
84
85 EXTERN(current_control_stack_pointer, 4)
86 EXTERN(current_control_frame_pointer, 4)
87 EXTERN(current_binding_stack_pointer, 4)
88 EXTERN(dynamic_space_free_pointer, 4)
89 EXTERN(current_dynamic_space, 4)
90
91 #ifdef mips
92 EXTERN(current_flags_register, 4)
93 #endif
94
95 #endif /* LANGUAGE_ASSEMBLY */
96
97 #endif /* _INCLUDED_GLOBALS_H_ */