17 #include "internals.h"
20 extern void make_holes(void);
24 ensure_space(lispobj * start, size_t size)
26 if (os_validate((os_vm_address_t) start, size) == NULL) {
28 "ensure_space: Failed to validate %ld bytes at 0x%08lx\n",
29 (unsigned long) size, (unsigned long) start);
35 /* builtin_image_flag is used as a flag indicating that the lisp image is
36 built into the executable. The other variables are set to actual values
37 in elf.c when the core section is mapped. FMG
39 extern int builtin_image_flag;
40 long image_dynamic_space_size = 0;
41 long image_read_only_space_size = 0;
42 long image_static_space_size = 0;
47 /* void *dynamic_space_data = NULL; */
50 read_only_space = (lispobj *) READ_ONLY_SPACE_START;
51 /* Note that if the lisp core is not built into the image,
52 the below expression will be equal to this:
53 ensure_space(read_only_space, READ_ONLY_SPACE_SIZE);
56 ensure_space((lispobj *)((int)read_only_space + image_read_only_space_size),
57 read_only_space_size - image_read_only_space_size);
60 static_space = (lispobj *) STATIC_SPACE_START;
61 /* Note that if the lisp core is not built into the image,
62 the below expression will be equal to this:
63 ensure_space(static_space, STATIC_SPACE_SIZE);
66 ensure_space((lispobj *)((int)static_space + image_static_space_size),
67 static_space_size - image_static_space_size);
70 dynamic_0_space = (lispobj *) DYNAMIC_0_SPACE_START;
71 /* Note that if the lisp core is not built into the image,
72 the below expression will be equal to this:
73 ensure_space(dynamic_0_space, dynamic_space_size);
76 ensure_space((lispobj *)((int)dynamic_0_space + image_dynamic_space_size),
77 dynamic_space_size - image_dynamic_space_size);
79 current_dynamic_space = dynamic_0_space;
83 dynamic_1_space = (lispobj *) DYNAMIC_1_SPACE_START;
84 ensure_space(dynamic_1_space, dynamic_space_size);
85 /* I'm not sure about the following, or if the lisp executable
86 stuff will work with a garbage collector other than gencgc.
90 if (builtin_image_flag != 0)
91 dynamic_space_data = alloca((int) (&image_dynamic_space_size));
96 control_stack = (lispobj *) CONTROL_STACK_START;
97 #if (defined(i386) || defined(__x86_64))
98 control_stack_end = (lispobj *) (CONTROL_STACK_START + control_stack_size);
100 ensure_space(control_stack, control_stack_size);
102 #ifdef SIGNAL_STACK_START
103 ensure_space((lispobj *) SIGNAL_STACK_START, SIGNAL_STACK_SIZE);
107 binding_stack = (lispobj *) BINDING_STACK_START;
108 ensure_space(binding_stack, binding_stack_size);
110 ensure_space((lispobj *) FOREIGN_LINKAGE_SPACE_START,
111 FOREIGN_LINKAGE_SPACE_SIZE);
122 os_guard_control_stack(0, 1);