0.9.9.36:
[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 #ifndef _INCLUDED_GLOBALS_H_
13 #define _INCLUDED_GLOBALS_H_
14
15 #ifndef LANGUAGE_ASSEMBLY
16 # include <sys/types.h>
17 # include <unistd.h>
18 # include "runtime.h"
19 #endif
20
21 #include "sbcl.h"
22
23 #ifndef LANGUAGE_ASSEMBLY
24 extern int foreign_function_call_active;
25 extern boolean stop_the_world;
26
27 #if defined(LISP_FEATURE_SB_THREAD)
28 extern pthread_key_t specials;
29 #endif
30
31 extern lispobj *current_control_stack_pointer;
32 extern lispobj *current_control_frame_pointer;
33 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
34 extern lispobj *current_binding_stack_pointer;
35 # endif
36
37 #if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
38 /* This is unused on X86 and X86_64, but is used as the global
39  *  allocation pointer by the cheney GC, and, in some instances, as
40  *  the global allocation pointer on PPC/GENCGC. This should probably
41  *  be cleaned up such that it only needs to exist on cheney. At the
42  *  moment, it is also used by the GENCGC, to hold the pseudo_atomic
43  *  bits, and is tightly coupled to reg_ALLOC by the assembly
44  *  routines. */
45 extern lispobj *dynamic_space_free_pointer;
46 #endif
47
48 # ifndef LISP_FEATURE_GENCGC
49 extern lispobj *current_auto_gc_trigger;
50 # endif
51
52 extern lispobj *current_dynamic_space;
53
54 extern void globals_init(void);
55
56 #else /* LANGUAGE_ASSEMBLY */
57
58 # ifdef LISP_FEATURE_MIPS
59 #  ifdef __linux__
60 #   define EXTERN(name,bytes) .globl name
61 #  else
62 #   define EXTERN(name,bytes) .extern name bytes
63 #  endif
64 # endif
65 /**/
66 # ifdef LISP_FEATURE_SPARC
67 #  ifdef SVR4
68 #   define EXTERN(name,bytes) .global name
69 #  else
70 #   define EXTERN(name,bytes) .global _ ## name
71 #  endif
72 # endif
73 /**/
74 # ifdef LISP_FEATURE_ALPHA
75 #  ifdef __linux__
76 #   define EXTERN(name,bytes) .globl name
77 #  endif
78 # endif
79 /**/
80 # ifdef LISP_FEATURE_PPC
81 #  ifdef LISP_FEATURE_DARWIN
82 #   define EXTERN(name,bytes) .globl _/**/name
83 #  else
84 #   define EXTERN(name,bytes) .globl name
85 #  endif
86 # endif
87 /**/
88 # if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
89 #  define EXTERN(name,bytes) .global name
90 # endif
91
92 # if defined(LISP_FEATURE_ALPHA) || defined(LISP_FEATURE_X86_64)
93 #  define POINTERSIZE 8
94 # else
95 #  define POINTERSIZE 4
96 # endif
97
98 EXTERN(foreign_function_call_active, 4)
99
100 EXTERN(current_control_stack_pointer, POINTERSIZE)
101 EXTERN(current_control_frame_pointer, POINTERSIZE)
102 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
103 EXTERN(current_binding_stack_pointer, POINTERSIZE)
104 # endif
105 # ifndef LISP_FEATURE_GENCGC
106 EXTERN(dynamic_space_free_pointer, POINTERSIZE)
107 # endif
108
109 #endif /* LANGUAGE_ASSEMBLY */
110
111 #endif /* _INCLUDED_GLOBALS_H_ */