| Commit | Line | Data |
|---|---|---|
| eeab7066 | 1 | /* |
| 62957726 | 2 | |
| eeab7066 RT |
3 | This code was written as part of the CMU Common Lisp project at |
| 4 | Carnegie Mellon University, and has been placed in the public domain. | |
| 5 | ||
| 6 | */ | |
| 62957726 | 7 | /* Variables everybody needs to look at or frob on. */ |
| 8 | ||
| 9 | #include <stdio.h> | |
| 10 | ||
| 11 | #include "lisp.h" | |
| 12 | #include "internals.h" | |
| 13 | #include "globals.h" | |
| 14 | ||
| 15 | int foreign_function_call_active; | |
| 16 | ||
| 17 | lispobj *current_control_stack_pointer; | |
| 18 | lispobj *current_control_frame_pointer; | |
| 9a8c1c2f | 19 | |
| 62957726 | 20 | #ifndef BINDING_STACK_POINTER |
| 21 | lispobj *current_binding_stack_pointer; | |
| 22 | #endif | |
| 23 | ||
| 24 | lispobj *read_only_space; | |
| 25 | lispobj *static_space; | |
| 26 | lispobj *dynamic_0_space; | |
| 27 | lispobj *dynamic_1_space; | |
| a7070998 | 28 | unsigned dynamic_space_size; |
| 62957726 | 29 | lispobj *control_stack; |
| 9a8c1c2f | 30 | |
| 44a8f0c7 | 31 | |
| 3f2ead72 | 32 | #if (defined(i386) || defined(__x86_64)) |
| 5ced0fdf | 33 | lispobj *control_stack_end; |
| 34 | #endif | |
| 62957726 | 35 | lispobj *binding_stack; |
| 36 | ||
| 37 | lispobj *current_dynamic_space; | |
| 9a8c1c2f | 38 | |
| 62957726 | 39 | #ifndef ALLOCATION_POINTER |
| 40 | lispobj *current_dynamic_space_free_pointer; | |
| 41 | #endif | |
| 42 | #ifndef INTERNAL_GC_TRIGGER | |
| 43 | lispobj *current_auto_gc_trigger; | |
| 44 | #endif | |
| 45 | ||
| 44a8f0c7 RT |
46 | unsigned long read_only_space_size; |
| 47 | unsigned long binding_stack_size; | |
| 48 | unsigned long static_space_size; | |
| 49 | unsigned long control_stack_size; | |
| 50 | ||
| 51 | ||
| 9a8c1c2f | 52 | void |
| 53 | globals_init(void) | |
| 62957726 | 54 | { |
| 55 | /* Space, stack, and free pointer vars are initialized by | |
| 56 | validate() and coreparse(). */ | |
| 57 | ||
| 58 | #ifndef INTERNAL_GC_TRIGGER | |
| 59 | /* No GC trigger yet */ | |
| 60 | current_auto_gc_trigger = NULL; | |
| 61 | #endif | |
| 62 | ||
| 63 | /* Set foreign function call active. */ | |
| 64 | foreign_function_call_active = 1; | |
| 65 | ||
| 66 | /* Initialize the current lisp state. */ | |
| 3f2ead72 | 67 | #if !(defined(i386) || defined(__x86_64)) |
| 62957726 | 68 | current_control_stack_pointer = control_stack; |
| 5ced0fdf | 69 | #else |
| 70 | current_control_stack_pointer = control_stack_end; | |
| 71 | #endif | |
| 72 | ||
| 9a8c1c2f | 73 | current_control_frame_pointer = (lispobj *) 0; |
| 62957726 | 74 | #ifndef BINDING_STACK_POINTER |
| 75 | current_binding_stack_pointer = binding_stack; | |
| 76 | #endif | |
| 77 | } |