[cmucl-commit] [git] CMU Common Lisp branch dynamic-stack-alloc updated. snapshot-2011-10-3-g8b8a38b
Raymond Toy
rtoy at common-lisp.net
Mon Oct 3 06:34:14 CEST 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".
The branch, dynamic-stack-alloc has been updated
via 8b8a38b2bad5a856dea915309be4f3697e2f0312 (commit)
via b7087fa144452cbe2de103f2885c501404a4e0d1 (commit)
from f7345b4a470baf7aa98722dab14cf28651a66457 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8b8a38b2bad5a856dea915309be4f3697e2f0312
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sun Oct 2 21:33:56 2011 -0700
Mmap the control stack anywhere on Linux and use altstack instead of
mmap'ing a space for the sigaltstack.
Adjust spaces[] accordingly too.
diff --git a/lisp/solaris-os.c b/lisp/solaris-os.c
index fa1a45e..ac61280 100644
--- a/lisp/solaris-os.c
+++ b/lisp/solaris-os.c
@@ -200,7 +200,7 @@ boolean valid_addr(os_vm_address_t addr)
#ifndef GENCGC
|| in_range_p(addr, DYNAMIC_1_SPACE_START, dynamic_space_size)
#endif
- || in_range_p(addr, CONTROL_STACK_START, control_stack_size)
+ || in_range_p(addr, control_stack, control_stack_size)
|| in_range_p(addr, BINDING_STACK_START, binding_stack_size));
}
@@ -410,9 +410,11 @@ os_vm_address_t round_up_sparse_size(os_vm_address_t addr)
* after them. Must not include the dynamic spaces because the size
* of the dynamic space can be controlled from the command line.
*/
-static os_vm_address_t spaces[] = {
- READ_ONLY_SPACE_START, STATIC_SPACE_START,
- BINDING_STACK_START, CONTROL_STACK_START
+static os_vm_address_t *spaces[] = {
+ (os_vm_address_t*) &read_only_space,
+ (os_vm_address_t*) &static_space,
+ (os_vm_address_t*) &binding_stack,
+ (os_vm_address_t*) &control_stack
};
/*
@@ -444,7 +446,7 @@ make_holes(void)
for (k = 0; k < sizeof(spaces) / sizeof(spaces[0]); ++k) {
- hole = spaces[k] + *space_size[k];
+ hole = *spaces[k] + *space_size[k];
if (os_validate(hole, HOLE_SIZE) == NULL) {
fprintf(stderr,
diff --git a/lisp/sparc-validate.h b/lisp/sparc-validate.h
index 7ef7af4..98e12c3 100644
--- a/lisp/sparc-validate.h
+++ b/lisp/sparc-validate.h
@@ -100,9 +100,11 @@
#define STATIC_SPACE_START (SpaceStart_TargetStatic)
#define STATIC_SPACE_SIZE ((2*MB_128) - SPARSE_BLOCK_SIZE) /* 256 MB - 32 KB, 256 MB max */
+#if 0
#define CONTROL_STACK_START (0x38000000)
+#endif
#define CONTROL_STACK_SIZE (MB_128 - SPARSE_BLOCK_SIZE) /* 128 MB - 32 KB, 128 MB max */
-#define CONTROL_STACK_END (CONTROL_STACK_START + control_stack_size)
+#define CONTROL_STACK_END ((char*)control_stack + control_stack_size)
#define DYNAMIC_0_SPACE_START (SpaceStart_TargetDynamic)
commit b7087fa144452cbe2de103f2885c501404a4e0d1
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Sun Oct 2 20:42:57 2011 -0700
Mmap the control stack anywhere on Linux and use altstack instead of
mmap'ing a space for the sigaltstack.
diff --git a/lisp/Linux-os.c b/lisp/Linux-os.c
index f4b96ef..3217476 100644
--- a/lisp/Linux-os.c
+++ b/lisp/Linux-os.c
@@ -377,7 +377,7 @@ valid_addr(os_vm_address_t addr)
|| in_range_p(addr, STATIC_SPACE_START, static_space_size)
|| in_range_p(addr, DYNAMIC_0_SPACE_START, dynamic_space_size)
|| in_range_p(addr, DYNAMIC_1_SPACE_START, dynamic_space_size)
- || in_range_p(addr, CONTROL_STACK_START, control_stack_size)
+ || in_range_p(addr, control_stack, control_stack_size)
|| in_range_p(addr, BINDING_STACK_START, binding_stack_size))
return TRUE;
return FALSE;
@@ -445,7 +445,7 @@ sigsegv_handler(HANDLER_ARGS)
#ifdef i386
interrupt_handle_now(signal, contextstruct);
#else
-#define CONTROL_STACK_TOP (((char*) CONTROL_STACK_START) + control_stack_size)
+#define CONTROL_STACK_TOP (((char*) control_stack) + control_stack_size)
addr = arch_get_bad_addr(signal, code, context);
@@ -455,7 +455,7 @@ sigsegv_handler(HANDLER_ARGS)
} else if (addr > CONTROL_STACK_TOP && addr < BINDING_STACK_START) {
fprintf(stderr, "Possible stack overflow at 0x%08lX!\n", addr);
/* try to fix control frame pointer */
- while (!(CONTROL_STACK_START <= *current_control_frame_pointer &&
+ while (!(control_stack <= *current_control_frame_pointer &&
*current_control_frame_pointer <= CONTROL_STACK_TOP))
((char *) current_control_frame_pointer) -= sizeof(lispobj);
ldb_monitor();
diff --git a/lisp/x86-validate.h b/lisp/x86-validate.h
index e3a2319..a2c9414 100644
--- a/lisp/x86-validate.h
+++ b/lisp/x86-validate.h
@@ -184,10 +184,14 @@
#define BINDING_STACK_START (0x20000000)
#define BINDING_STACK_SIZE (0x07fff000) /* 128MB - 1 page */
+#if 0
#define CONTROL_STACK_START 0x38000000
+#endif
#define CONTROL_STACK_SIZE (0x07fff000 - 8192)
+#if 0
#define SIGNAL_STACK_START CONTROL_STACK_END
+#endif
#define SIGNAL_STACK_SIZE SIGSTKSZ
#define DYNAMIC_0_SPACE_START (SpaceStart_TargetDynamic)
-----------------------------------------------------------------------
Summary of changes:
lisp/Linux-os.c | 6 +++---
lisp/solaris-os.c | 12 +++++++-----
lisp/sparc-validate.h | 4 +++-
lisp/x86-validate.h | 4 ++++
4 files changed, 17 insertions(+), 9 deletions(-)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-commit
mailing list