Initial revision
[sbcl.git] / src / runtime / globals.c
1 /*
2  * variables everybody needs to look at or frob on
3  */
4
5 /*
6  * This software is part of the SBCL system. See the README file for
7  * more information.
8  *
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.
14  */
15
16 /*
17  * $Header$
18  */
19
20 #include <stdio.h>
21
22 #include "runtime.h"
23 #include "sbcl.h"
24 #include "globals.h"
25
26 int foreign_function_call_active;
27
28 lispobj *current_control_stack_pointer;
29 lispobj *current_control_frame_pointer;
30 #ifndef BINDING_STACK_POINTER
31 lispobj *current_binding_stack_pointer;
32 #endif
33
34 lispobj *read_only_space;
35 lispobj *static_space;
36 lispobj *dynamic_0_space;
37 lispobj *dynamic_1_space;
38 lispobj *control_stack;
39 #ifdef __i386__
40 lispobj *control_stack_end;
41 #endif
42 lispobj *binding_stack;
43
44 lispobj *current_dynamic_space;
45 #ifndef ALLOCATION_POINTER
46 lispobj *current_dynamic_space_free_pointer;
47 #endif
48 #ifndef INTERNAL_GC_TRIGGER
49 lispobj *current_auto_gc_trigger;
50 #endif
51
52 void globals_init(void)
53 {
54     /* Space, stack, and free pointer vars are initialized by
55      * validate() and coreparse(). */
56
57 #ifndef INTERNAL_GC_TRIGGER
58     /* no GC trigger yet */
59     current_auto_gc_trigger = NULL;
60 #endif
61
62     /* Set foreign function call active. */
63     foreign_function_call_active = 1;
64
65     /* Initialize the current Lisp state. */
66 #ifndef __i386__
67     current_control_stack_pointer = control_stack;
68 #else
69     current_control_stack_pointer = control_stack_end;
70 #endif
71
72     current_control_frame_pointer = (lispobj *)0;
73 #ifndef BINDING_STACK_POINTER
74     current_binding_stack_pointer = binding_stack;
75 #endif
76 }