X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fvalidate.c;h=d88d17df03dc98828b0aa25b360b060b18005f54;hb=1e9a538c32223df9132c1e7fb2b67a2129c40a8d;hp=e8cf0bfdb0d9574502b81ec53cf7a6ae0cd864ba;hpb=d7f6139a91d7d9b0667a597584ae306d958bb2f4;p=sbcl.git diff --git a/src/runtime/validate.c b/src/runtime/validate.c index e8cf0bf..d88d17d 100644 --- a/src/runtime/validate.c +++ b/src/runtime/validate.c @@ -14,6 +14,8 @@ */ #include +#include + #include "runtime.h" #include "os.h" #include "globals.h" @@ -58,26 +60,32 @@ void validate(void) { #ifdef PRINTNOISE - printf("validating memory ..."); - fflush(stdout); + printf("validating memory ..."); + fflush(stdout); #endif - - ensure_space( (lispobj *)READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE); - ensure_space( (lispobj *)STATIC_SPACE_START , STATIC_SPACE_SIZE); -#ifdef GENCGC - ensure_space( (lispobj *)DYNAMIC_SPACE_START , DYNAMIC_SPACE_SIZE); + + ensure_space( (lispobj *)READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE); + ensure_space( (lispobj *)STATIC_SPACE_START , STATIC_SPACE_SIZE); +#ifdef LISP_FEATURE_GENCGC + ensure_space( (lispobj *)DYNAMIC_SPACE_START , DYNAMIC_SPACE_SIZE); #else - ensure_space( (lispobj *)DYNAMIC_0_SPACE_START , DYNAMIC_SPACE_SIZE); - ensure_space( (lispobj *)DYNAMIC_1_SPACE_START , DYNAMIC_SPACE_SIZE); + ensure_space( (lispobj *)DYNAMIC_0_SPACE_START , DYNAMIC_SPACE_SIZE); + ensure_space( (lispobj *)DYNAMIC_1_SPACE_START , DYNAMIC_SPACE_SIZE); #endif - ensure_space( (lispobj *)CONTROL_STACK_START , CONTROL_STACK_SIZE); - ensure_space( (lispobj *)BINDING_STACK_START , BINDING_STACK_SIZE); #ifdef HOLES - make_holes(); + make_holes(); #endif - + #ifdef PRINTNOISE - printf(" done.\n"); + printf(" done.\n"); #endif } + +void protect_control_stack_guard_page(pid_t t_id, int protect_p) { + struct thread *th = find_thread_by_pid(t_id); + os_protect(CONTROL_STACK_GUARD_PAGE(th), + os_vm_page_size,protect_p ? + (OS_VM_PROT_READ|OS_VM_PROT_EXECUTE) : OS_VM_PROT_ALL); +} +