Skip to content
Snippets Groups Projects
Commit e61f0408 authored by wlott's avatar wlott
Browse files

allocate, but protect against reading or writing, the page following each

of the heaps or stacks.  This keeps os_allocate from deciding to use one
of those pages for something else.
parent a6327a92
No related branches found
No related tags found
No related merge requests found
...@@ -21,3 +21,6 @@ ...@@ -21,3 +21,6 @@
#define NUMBER_STACK_START (0xf0000000) #define NUMBER_STACK_START (0xf0000000)
#endif #endif
#define NUMBER_STACK_SIZE (0x00100000) #define NUMBER_STACK_SIZE (0x00100000)
#define HOLES {0x0bffe000, 0x0fffe000, 0x17ffe000, 0x1fffe000}
#define HOLE_SIZE 0x2000
/* /*
* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/validate.c,v 1.2 1992/09/08 23:22:52 wlott Exp $ * $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/validate.c,v 1.3 1993/01/18 02:12:17 wlott Exp $
* *
* Memory Validation * Memory Validation
*/ */
...@@ -21,6 +21,27 @@ static void ensure_space(lispobj *start, unsigned long size) ...@@ -21,6 +21,27 @@ static void ensure_space(lispobj *start, unsigned long size)
} }
} }
#ifdef HOLES
static os_vm_address_t holes[] = HOLES;
static void make_holes(void)
{
int i;
for (i = 0; i < sizeof(holes)/sizeof(holes[0]); i++) {
if (os_validate(holes[i], HOLE_SIZE) == NULL) {
fprintf(stderr,
"ensure_space: Failed to validate %ld bytes at 0x%08X\n",
HOLE_SIZE,
(unsigned long)holes[i]);
exit(1);
}
os_protect(holes[i], HOLE_SIZE, 0);
}
}
#endif
void validate(void) void validate(void)
{ {
#ifdef PRINTNOISE #ifdef PRINTNOISE
...@@ -59,6 +80,10 @@ void validate(void) ...@@ -59,6 +80,10 @@ void validate(void)
ensure_space((lispobj *)NUMBER_STACK_START, NUMBER_STACK_SIZE); ensure_space((lispobj *)NUMBER_STACK_START, NUMBER_STACK_SIZE);
#endif #endif
#ifdef HOLES
make_holes();
#endif
#ifdef PRINTNOISE #ifdef PRINTNOISE
printf(" done.\n"); printf(" done.\n");
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment