2 * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/validate.c,v 1.25 2007/07/09 16:04:12 fgilham Rel $
19 #include "internals.h"
22 extern void make_holes(void);
26 ensure_space(lispobj * start, size_t size)
28 if (os_validate((os_vm_address_t) start, size) == NULL) {
30 "ensure_space: Failed to validate %ld bytes at 0x%08lx\n",
31 (unsigned long) size, (unsigned long) start);
37 /* builtin_image_flag is used as a flag indicating that the lisp image is
38 built into the executable. The other variables are set to actual values
39 in elf.c when the core section is mapped. FMG
41 extern int builtin_image_flag;
42 long image_dynamic_space_size = 0;
43 long image_read_only_space_size = 0;
44 long image_static_space_size = 0;
49 /* void *dynamic_space_data = NULL; */
52 read_only_space = (lispobj *) READ_ONLY_SPACE_START;
53 /* Note that if the lisp core is not built into the image,
54 the below expression will be equal to this:
55 ensure_space(read_only_space, READ_ONLY_SPACE_SIZE);
58 ensure_space((lispobj *)((int)read_only_space + image_read_only_space_size),
59 read_only_space_size - image_read_only_space_size);
62 static_space = (lispobj *) STATIC_SPACE_START;
63 /* Note that if the lisp core is not built into the image,
64 the below expression will be equal to this:
65 ensure_space(static_space, STATIC_SPACE_SIZE);
68 ensure_space((lispobj *)((int)static_space + image_static_space_size),
69 static_space_size - image_static_space_size);
72 dynamic_0_space = (lispobj *) DYNAMIC_0_SPACE_START;
73 /* Note that if the lisp core is not built into the image,
74 the below expression will be equal to this:
75 ensure_space(dynamic_0_space, dynamic_space_size);
78 ensure_space((lispobj *)((int)dynamic_0_space + image_dynamic_space_size),
79 dynamic_space_size - image_dynamic_space_size);
81 current_dynamic_space = dynamic_0_space;
85 dynamic_1_space = (lispobj *) DYNAMIC_1_SPACE_START;
86 ensure_space(dynamic_1_space, dynamic_space_size);
87 /* I'm not sure about the following, or if the lisp executable
88 stuff will work with a garbage collector other than gencgc.
92 if (builtin_image_flag != 0)
93 dynamic_space_data = alloca((int) (&image_dynamic_space_size));
98 control_stack = (lispobj *) CONTROL_STACK_START;
99 #if (defined(i386) || defined(__x86_64))
100 control_stack_end = (lispobj *) (CONTROL_STACK_START + control_stack_size);
102 ensure_space(control_stack, control_stack_size);
104 #ifdef SIGNAL_STACK_START
105 ensure_space((lispobj *) SIGNAL_STACK_START, SIGNAL_STACK_SIZE);
109 binding_stack = (lispobj *) BINDING_STACK_START;
110 ensure_space(binding_stack, binding_stack_size);
112 ensure_space((lispobj *) FOREIGN_LINKAGE_SPACE_START,
113 FOREIGN_LINKAGE_SPACE_SIZE);
124 os_guard_control_stack(0, 1);