0.9.0.39:
[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 extern lispobj *current_control_stack_pointer;
28 extern lispobj *current_control_frame_pointer;
29 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
30 extern lispobj *current_binding_stack_pointer;
31 # endif
32
33 # ifndef LISP_FEATURE_GENCGC
34 /* Beware! gencgc has also a (non-global) dynamic_space_free_pointer. */
35 extern lispobj *dynamic_space_free_pointer;
36 extern lispobj *current_auto_gc_trigger;
37 # endif
38
39 extern lispobj *current_dynamic_space;
40
41 extern void globals_init(void);
42
43 #else /* LANGUAGE_ASSEMBLY */
44
45 # ifdef LISP_FEATURE_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 LISP_FEATURE_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 LISP_FEATURE_ALPHA
62 #  ifdef __linux__
63 #   define EXTERN(name,bytes) .globl name 
64 #  endif
65 # endif
66 /**/
67 # ifdef LISP_FEATURE_PPC
68 #  ifdef LISP_FEATURE_DARWIN
69 #   define EXTERN(name,bytes) .globl _/**/name
70 #  else
71 #   define EXTERN(name,bytes) .globl name 
72 #  endif
73 # endif
74 /**/
75 # if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
76 #  define EXTERN(name,bytes) .global name
77 # endif
78
79 # if defined(LISP_FEATURE_ALPHA) || defined(LISP_FEATURE_X86_64)
80 #  define POINTERSIZE 8
81 # else
82 #  define POINTERSIZE 4
83 # endif
84
85 EXTERN(foreign_function_call_active, 4)
86
87 EXTERN(current_control_stack_pointer, POINTERSIZE)
88 EXTERN(current_control_frame_pointer, POINTERSIZE)
89 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
90 EXTERN(current_binding_stack_pointer, POINTERSIZE)
91 # endif
92 # ifndef LISP_FEATURE_GENCGC
93 EXTERN(dynamic_space_free_pointer, POINTERSIZE)
94 # endif
95
96 #endif /* LANGUAGE_ASSEMBLY */
97
98 #endif /* _INCLUDED_GLOBALS_H_ */