6 * This software is part of the SBCL system. See the README file for
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.
26 ensure_space(lispobj *start, unsigned long size)
28 if (os_validate((os_vm_address_t)start,(os_vm_size_t)size)==NULL) {
30 "ensure_space: failed to validate %ld bytes at 0x%08lx\n",
32 (unsigned long)start);
34 "(hint: Try \"ulimit -a\"; maybe you should increase memory limits.)\n");
39 os_vm_address_t undefined_alien_address = 0;
42 ensure_undefined_alien(void) {
43 os_vm_address_t start = os_validate(NULL, os_vm_page_size);
45 os_protect(start, os_vm_page_size, OS_VM_PROT_NONE);
46 undefined_alien_address = start;
48 lose("could not allocate guard page for undefined alien");
56 printf("validating memory ...");
60 ensure_space( (lispobj *)READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE);
61 ensure_space( (lispobj *)STATIC_SPACE_START , STATIC_SPACE_SIZE);
62 #ifdef LISP_FEATURE_GENCGC
63 ensure_space( (lispobj *)DYNAMIC_SPACE_START , DYNAMIC_SPACE_SIZE);
65 ensure_space( (lispobj *)DYNAMIC_0_SPACE_START , DYNAMIC_SPACE_SIZE);
66 ensure_space( (lispobj *)DYNAMIC_1_SPACE_START , DYNAMIC_SPACE_SIZE);
69 #ifdef LISP_FEATURE_LINKAGE_TABLE
70 ensure_space( (lispobj *)LINKAGE_TABLE_SPACE_START, LINKAGE_TABLE_SPACE_SIZE);
73 #ifdef LISP_FEATURE_OS_PROVIDES_DLOPEN
74 ensure_undefined_alien();
83 protect_control_stack_guard_page(struct thread *th, int protect_p) {
84 os_protect(CONTROL_STACK_GUARD_PAGE(th),
85 os_vm_page_size,protect_p ?
86 (OS_VM_PROT_READ|OS_VM_PROT_EXECUTE) : OS_VM_PROT_ALL);
90 protect_control_stack_return_guard_page(struct thread *th, int protect_p) {
91 os_protect(CONTROL_STACK_RETURN_GUARD_PAGE(th),
92 os_vm_page_size,protect_p ?
93 (OS_VM_PROT_READ|OS_VM_PROT_EXECUTE) : OS_VM_PROT_ALL);