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