#include "genesis/thread.h"
#include "genesis/static-symbols.h"
-#if defined(BINDING_STACK_POINTER)
-#define GetBSP() ((struct binding *)SymbolValue(BINDING_STACK_POINTER,thread))
-#define SetBSP(value) SetSymbolValue(BINDING_STACK_POINTER, (lispobj)(value),thread)
-#else
-#define GetBSP() ((struct binding *)current_binding_stack_pointer)
-#define SetBSP(value) (current_binding_stack_pointer=(lispobj *)(value))
-#endif
-
void bind_variable(lispobj symbol, lispobj value, void *th)
{
struct binding *binding;
struct thread *thread=(struct thread *)th;
- binding = GetBSP();
- SetBSP(binding+1);
+ binding = (struct binding *)get_binding_stack_pointer(thread);
+ set_binding_stack_pointer(thread,binding+1);
#ifdef LISP_FEATURE_SB_THREAD
{
struct symbol *sym=(struct symbol *)native_pointer(symbol);
struct binding *binding;
lispobj symbol;
- binding = GetBSP() - 1;
+ binding = ((struct binding *)get_binding_stack_pointer(thread)) - 1;
symbol = binding->symbol;
binding->symbol = 0;
binding->value = 0;
- SetBSP(binding);
+ set_binding_stack_pointer(thread,binding);
}
void
{
struct thread *thread=(struct thread *)th;
struct binding *target = (struct binding *)bsp;
- struct binding *binding = GetBSP();
+ struct binding *binding = (struct binding *)get_binding_stack_pointer(thread);
lispobj symbol;
while (target < binding) {
binding->value = 0;
}
}
- SetBSP(binding);
+ set_binding_stack_pointer(thread,binding);
}
lispobj *current_control_stack_pointer;
lispobj *current_control_frame_pointer;
-#ifndef BINDING_STACK_POINTER
+#if !defined(BINDING_STACK_POINTER) && !defined(LISP_FEATURE_SB_THREAD)
lispobj *current_binding_stack_pointer;
#endif
extern lispobj *current_control_stack_pointer;
extern lispobj *current_control_frame_pointer;
-# if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
+#if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64) && !defined(LISP_FEATURE_SB_THREAD)
extern lispobj *current_binding_stack_pointer;
-# endif
+#endif
#if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
/* This is unused on X86 and X86_64, but is used as the global
#endif
#endif
#ifdef reg_BSP
- current_binding_stack_pointer =
- (lispobj *)(unsigned long)
- (*os_context_register_addr(context, reg_BSP));
+ set_binding_stack_pointer(thread,
+ *os_context_register_addr(context, reg_BSP));
#endif
build_fake_control_stack_frames(thread,context);
printf("CFP\t=\t0x%08lx ", (unsigned long)current_control_frame_pointer);
#ifdef reg_BSP
- printf("BSP\t=\t0x%08lx\n", (unsigned long)current_binding_stack_pointer);
+ printf("BSP\t=\t0x%08lx\n", (unsigned long)get_binding_stack_pointer(thread));
#else
/* printf("BSP\t=\t0x%08lx\n",
(unsigned long)SymbolValue(BINDING_STACK_POINTER)); */
SetSymbolValue(ALLOCATION_POINTER, value, 0)
#define get_alloc_pointer() \
SymbolValue(ALLOCATION_POINTER, 0)
-#define get_binding_stack_pointer(thread) \
- SymbolValue(BINDING_STACK_POINTER, thread)
#if defined(LISP_FEATURE_X86)
#define LISPOBJ_ASM_SUFFIX "l"
((unsigned long) dynamic_space_free_pointer & ~LOWTAG_MASK)
#ifdef LISP_FEATURE_SB_THREAD
-#define get_binding_stack_pointer(thread) \
- ((thread)->binding_stack_pointer)
#define get_pseudo_atomic_atomic(thread) \
((thread)->pseudo_atomic_bits & flag_PseudoAtomic)
#define set_pseudo_atomic_atomic(thread) \
#define clear_pseudo_atomic_interrupted(thread) \
((thread)->pseudo_atomic_bits &= ~flag_PseudoAtomicInterrupted)
#else
-#define get_binding_stack_pointer(thread) \
- (current_binding_stack_pointer)
#define get_pseudo_atomic_atomic(thread) \
((unsigned long)dynamic_space_free_pointer & flag_PseudoAtomic)
#define set_pseudo_atomic_atomic(thread) \
#endif
pscav( (lispobj *)all_threads->binding_stack_start,
- (lispobj *)current_binding_stack_pointer -
+ (lispobj *)get_binding_stack_pointer(all_threads) -
all_threads->binding_stack_start,
0);
th->control_stack_guard_page_protected = T;
th->alien_stack_start=
(lispobj*)((void*)th->binding_stack_start+BINDING_STACK_SIZE);
- th->binding_stack_pointer=th->binding_stack_start;
+ set_binding_stack_pointer(th,th->binding_stack_start);
th->this=th;
th->os_thread=0;
#ifdef LISP_FEATURE_SB_THREAD
SetSymbolValue(CONTROL_STACK_START,(lispobj)th->control_stack_start,th);
SetSymbolValue(CONTROL_STACK_END,(lispobj)th->control_stack_end,th);
#if defined(LISP_FEATURE_X86) || defined (LISP_FEATURE_X86_64)
- SetSymbolValue(BINDING_STACK_POINTER,(lispobj)th->binding_stack_pointer,th);
SetSymbolValue(ALIEN_STACK,(lispobj)th->alien_stack_pointer,th);
SetSymbolValue(PSEUDO_ATOMIC_BITS,(lispobj)th->pseudo_atomic_bits,th);
#else
- current_binding_stack_pointer=th->binding_stack_pointer;
current_control_stack_pointer=th->control_stack_start;
#endif
#endif
return ((struct fdefn *)native_pointer(SymbolValue(sym, 0)))->fun;
}
+/* These are for use during GC, on the current thread, or on prenatal
+ * threads only. */
+#if defined(LISP_FEATURE_SB_THREAD)
+#define get_binding_stack_pointer(thread) \
+ ((thread)->binding_stack_pointer)
+#define set_binding_stack_pointer(thread,value) \
+ ((thread)->binding_stack_pointer = (lispobj *)(value))
+#elif defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
+#define get_binding_stack_pointer(thread) \
+ SymbolValue(BINDING_STACK_POINTER, thread)
+#define set_binding_stack_pointer(thread,value) \
+ SetSymbolValue(BINDING_STACK_POINTER, (lispobj)(value), thread)
+#else
+#define get_binding_stack_pointer(thread) \
+ (current_binding_stack_pointer)
+#define set_binding_stack_pointer(thread,value) \
+ (current_binding_stack_pointer = (lispobj *)(value))
+#endif
+
#if defined(LISP_FEATURE_SB_THREAD) && defined(LISP_FEATURE_GCC_TLS)
extern __thread struct thread *current_thread;
#endif
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.41.19"
+"1.0.41.20"