Use flatteningization in package-data-list
[sbcl.git] / src / runtime / globals.c
blob2b71298836dda81aef62a278ff791a64e54260ba
1 /*
2 * variables everybody needs to look at or frob on
3 */
5 /*
6 * This software is part of the SBCL system. See the README file for
7 * more information.
9 * This software is derived from the CMU CL system, which was
10 * written at Carnegie Mellon University and released into the
11 * public domain. The software is in the public domain and is
12 * provided with absolutely no warranty. See the COPYING and CREDITS
13 * files for more information.
16 #include <stdio.h>
17 #include <sys/types.h>
18 #include <unistd.h>
20 #include "sbcl.h"
21 #include "runtime.h"
22 #include "globals.h"
23 #include "validate.h"
25 #ifndef LISP_FEATURE_SB_THREAD
26 int foreign_function_call_active;
27 #endif
29 #if !defined(LISP_FEATURE_SB_THREAD)
30 lispobj *current_control_stack_pointer;
31 #endif
32 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) || !defined(LISP_FEATURE_SB_THREAD)
33 lispobj *current_control_frame_pointer;
34 #endif
35 #if !defined(BINDING_STACK_POINTER) && !defined(LISP_FEATURE_SB_THREAD)
36 lispobj *current_binding_stack_pointer;
37 #endif
39 /* ALLOCATION_POINTER is x86 or RT. Anyone want to do an RT port? */
41 # if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64) && !defined(LISP_FEATURE_ARM) && !defined(LISP_FEATURE_ARM64)
42 /* The Object Formerly Known As current_dynamic_space_free_pointer */
43 lispobj *dynamic_space_free_pointer;
44 #endif
46 #ifndef LISP_FEATURE_GENCGC /* GENCGC has its own way to record trigger */
47 lispobj *current_auto_gc_trigger;
48 #endif
50 /* For copying GCs, this points to the start of the dynamic space
51 * currently in use (that will become the from_space when the next GC
52 * is done). For the GENCGC, it always points to DYNAMIC_SPACE_START. */
53 lispobj *current_dynamic_space;
55 #if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_GCC_TLS)
56 pthread_key_t specials=0;
57 #endif
59 void globals_init(void)
61 /* Space, stack, and free pointer vars are initialized by
62 * validate() and coreparse(). */
63 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) || !defined(LISP_FEATURE_SB_THREAD)
64 current_control_frame_pointer = (lispobj *)0;
65 #endif
67 #ifndef LISP_FEATURE_GENCGC
68 /* no GC trigger yet */
69 current_auto_gc_trigger = NULL;
70 #endif
72 #ifndef LISP_FEATURE_SB_THREAD
73 #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
74 /* KLUDGE: x86oids always think they're in lisp code. See the
75 * comment at the bottom of
76 * interrupt.c/fake_foreign_function_call() and the lack of any
77 * access to foreign_function_call_active or the corresponding
78 * thread slot in x86{,-64}-assem.S. */
79 foreign_function_call_active = 0;
80 #else
81 foreign_function_call_active = 1;
82 #endif
83 #endif
85 #if defined(LISP_FEATURE_SB_THREAD) && !defined(LISP_FEATURE_GCC_TLS)
86 pthread_key_create(&specials,0);
87 #endif