471da1fc7563a5ee8e27892bb174bd7610073f03
[projects/cmucl/cmucl.git] / src / lisp / globals.c
1 /* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/globals.c,v 1.5 2005/09/15 18:26:51 rtoy Rel $ */
2
3 /* Variables everybody needs to look at or frob on. */
4
5 #include <stdio.h>
6
7 #include "lisp.h"
8 #include "internals.h"
9 #include "globals.h"
10
11 int foreign_function_call_active;
12
13 lispobj *current_control_stack_pointer;
14 lispobj *current_control_frame_pointer;
15
16 #ifndef BINDING_STACK_POINTER
17 lispobj *current_binding_stack_pointer;
18 #endif
19
20 lispobj *read_only_space;
21 lispobj *static_space;
22 lispobj *dynamic_0_space;
23 lispobj *dynamic_1_space;
24 unsigned dynamic_space_size;
25 lispobj *control_stack;
26
27
28 #if (defined(i386) || defined(__x86_64))
29 lispobj *control_stack_end;
30 #endif
31 lispobj *binding_stack;
32
33 lispobj *current_dynamic_space;
34
35 #ifndef ALLOCATION_POINTER
36 lispobj *current_dynamic_space_free_pointer;
37 #endif
38 #ifndef INTERNAL_GC_TRIGGER
39 lispobj *current_auto_gc_trigger;
40 #endif
41
42 unsigned long read_only_space_size;
43 unsigned long binding_stack_size;
44 unsigned long static_space_size;
45 unsigned long control_stack_size;
46
47
48 void
49 globals_init(void)
50 {
51     /* Space, stack, and free pointer vars are initialized by
52        validate() and coreparse(). */
53
54 #ifndef INTERNAL_GC_TRIGGER
55     /* No GC trigger yet */
56     current_auto_gc_trigger = NULL;
57 #endif
58
59     /* Set foreign function call active. */
60     foreign_function_call_active = 1;
61
62     /* Initialize the current lisp state. */
63 #if !(defined(i386) || defined(__x86_64))
64     current_control_stack_pointer = control_stack;
65 #else
66     current_control_stack_pointer = control_stack_end;
67 #endif
68
69     current_control_frame_pointer = (lispobj *) 0;
70 #ifndef BINDING_STACK_POINTER
71     current_binding_stack_pointer = binding_stack;
72 #endif
73 }