70beb568343f019762c24f193ef7772c0e889282
[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 #include <stdio.h>
17
18 #include "runtime.h"
19 #include "sbcl.h"
20 #include "globals.h"
21
22 int foreign_function_call_active;
23
24 lispobj *current_control_stack_pointer;
25 lispobj *current_control_frame_pointer;
26 #ifndef BINDING_STACK_POINTER
27 lispobj *current_binding_stack_pointer;
28 #endif
29
30 #ifndef ALLOCATION_POINTER
31 lispobj *dynamic_space_free_pointer;
32 #endif
33 #ifndef INTERNAL_GC_TRIGGER
34 lispobj *current_auto_gc_trigger;
35 #endif
36
37 void globals_init(void)
38 {
39     /* Space, stack, and free pointer vars are initialized by
40      * validate() and coreparse(). */
41
42 #ifndef INTERNAL_GC_TRIGGER
43     /* no GC trigger yet */
44     current_auto_gc_trigger = NULL;
45 #endif
46
47     /* Set foreign function call active. */
48     foreign_function_call_active = 1;
49
50     /* Initialize the current Lisp state. */
51 #ifndef __i386__
52     current_control_stack_pointer = (lispobj *)CONTROL_STACK_START;
53 #else
54     current_control_stack_pointer = (lispobj *)CONTROL_STACK_END;
55 #endif
56
57     current_control_frame_pointer = (lispobj *)0;
58 #ifndef BINDING_STACK_POINTER
59     current_binding_stack_pointer = BINDING_STACK_START;
60 #endif
61 }