*/
#include <stdio.h>
+#include <stdlib.h>
+
#include "runtime.h"
#include "os.h"
#include "globals.h"
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);
+}
+