(let* ((control-stack-start
(descriptor-sap sb!vm::*control-stack-start*))
(control-stack-end
- (sap+
- (descriptor-sap sb!vm::*binding-stack-start*) -4)))
- #!-stack-grows-downward-not-upward
- (and (sap< x (current-sp))
+ (descriptor-sap sb!vm::*control-stack-end*)))
+ #!-stack-grows-downward-not-upward
+ (and (sap< x (current-sp))
(sap<= control-stack-start
- x)
- (zerop (logand (sap-int x) #b11)))
- #!+stack-grows-downward-not-upward
- (and (sap>= x (current-sp))
+ x)
+ (zerop (logand (sap-int x) #b11)))
+ #!+stack-grows-downward-not-upward
+ (and (sap>= x (current-sp))
(sap> control-stack-end x)
(zerop (logand (sap-int x) #b11)))))
(binding-stack-start :c-type "lispobj *")
(binding-stack-pointer :c-type "lispobj *")
(control-stack-start :c-type "lispobj *")
+ (control-stack-end :c-type "lispobj *")
(alien-stack-start :c-type "lispobj *")
(alien-stack-pointer :c-type "lispobj *")
(alloc-region :c-type "struct alloc_region" :length 5)
*binding-stack-pointer*
*binding-stack-start*
*control-stack-start*
+ *control-stack-end*
;; the floating point constants
*fp-constant-0d0*
preserve_pointer(regs.ebp);
preserve_pointer(regs.eax);
#endif
- for (ptr = ((void **)
- ((void *)th->control_stack_start
- + THREAD_CONTROL_STACK_SIZE)
- -1);
+ for (ptr = th->control_stack_end;
#ifdef LISP_FEATURE_SB_THREAD
ptr > regs.esp;
#else
{
struct thread *th;
if(in_range_p(addr, READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE) ||
- in_range_p(addr, STATIC_SPACE_START , STATIC_SPACE_SIZE) ||
+ in_range_p(addr, STATIC_SPACE_START , STATIC_SPACE_SIZE) ||
in_range_p(addr, DYNAMIC_SPACE_START , DYNAMIC_SPACE_SIZE))
return 1;
for_each_thread(th) {
- if(in_range_p(addr, th->control_stack_start,
- THREAD_CONTROL_STACK_SIZE) ||
- in_range_p(addr, th->binding_stack_start,
- BINDING_STACK_SIZE))
+ if((th->control_stack_start <= addr) && (addr < th->control_stack_end))
+ return 1;
+ if(in_range_p(addr, th->binding_stack_start, BINDING_STACK_SIZE))
return 1;
}
return 0;
lose("PTRACE_GETREGS");
}
setup_i386_stack_scav(regs.ebp,
- ((void *)thread->control_stack_start)
- +THREAD_CONTROL_STACK_SIZE);
+ ((void *)thread->control_stack_end));
}
#endif
#endif
setup_i386_stack_scav(((&static_roots)-2),
- ((void *)all_threads->control_stack_start)
- +THREAD_CONTROL_STACK_SIZE);
-
+ ((void *)all_threads->control_stack_end));
pscav(&static_roots, 1, 0);
STATIC_TLS_INIT(BINDING_STACK_START,binding_stack_start);
STATIC_TLS_INIT(BINDING_STACK_POINTER,binding_stack_pointer);
STATIC_TLS_INIT(CONTROL_STACK_START,control_stack_start);
+ STATIC_TLS_INIT(CONTROL_STACK_END,control_stack_end);
STATIC_TLS_INIT(ALIEN_STACK,alien_stack_pointer);
STATIC_TLS_INIT(PSEUDO_ATOMIC_ATOMIC,pseudo_atomic_atomic);
STATIC_TLS_INIT(PSEUDO_ATOMIC_INTERRUPTED,pseudo_atomic_interrupted);
th->control_stack_start = spaces;
th->binding_stack_start=
(lispobj*)((void*)th->control_stack_start+THREAD_CONTROL_STACK_SIZE);
+ th->control_stack_end = th->binding_stack_start-1;
th->alien_stack_start=
(lispobj*)((void*)th->binding_stack_start+BINDING_STACK_SIZE);
th->binding_stack_pointer=th->binding_stack_start;
#define DYNAMIC_SPACE_SIZE ( DYNAMIC_SPACE_END - DYNAMIC_SPACE_START)
#define READ_ONLY_SPACE_SIZE (READ_ONLY_SPACE_END - READ_ONLY_SPACE_START)
#define STATIC_SPACE_SIZE ( STATIC_SPACE_END - STATIC_SPACE_START)
-#define THREAD_CONTROL_STACK_SIZE (2*1024*1024) /* wired elsewhere-watch out */
+#define THREAD_CONTROL_STACK_SIZE (2*1024*1024) /* eventually this'll be choosable per-thread */
#if !defined(LANGUAGE_ASSEMBLY)
#include <thread.h>
#ifdef LISP_FEATURE_STACK_GROWS_DOWNWARD_NOT_UPWARD
#define CONTROL_STACK_GUARD_PAGE(th) ((void *)(th->control_stack_start))
#else
-#define CONTROL_STACK_GUARD_PAGE(th) (((void *)(th->control_stack_start))+THREAD_CONTROL_STACK_SIZE - os_vm_page_size)
+#define CONTROL_STACK_GUARD_PAGE(th) \
+ (((void *)(th->control_stack_end)) - os_vm_page_size)
#endif
extern void validate(void);
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.pre8.31"
+"0.pre8.32"