runtime/thread.h: Fix non-thread binding and control stack pointer access.
authorAlastair Bridgewater <nyef@kana.lisphacker.com>
Thu, 8 Nov 2012 23:32:36 +0000 (18:32 -0500)
committerAlastair Bridgewater <nyef@kana.lisphacker.com>
Thu, 8 Nov 2012 23:32:36 +0000 (18:32 -0500)
  * In the non-threaded case, these macros used to break up into two
groups, one for x86oids and one for everything else.  This is wrong
just as soon as a non-x86oid port uses a static symbol for the binding
stack pointer.

  * Reorganize the non-threaded cases to parallel the structure of the
threaded case, dispatching on the presense of the static symbol for
binding stack access and specifically detecting non-x86oids for the
control frame pointer access.

src/runtime/thread.h

index 3c2d5bc..c828176 100644 (file)
@@ -229,22 +229,24 @@ StaticSymbolFunction(lispobj sym)
 #define access_control_frame_pointer(thread) \
     ((thread)->control_frame_pointer)
 #  endif
-#elif defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64)
+#else
+#  if defined(BINDING_STACK_POINTER)
 #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)
-#define access_control_stack_pointer(thread)    \
-    (current_control_stack_pointer)
-#else
+#  else
 #define get_binding_stack_pointer(thread)       \
     (current_binding_stack_pointer)
 #define set_binding_stack_pointer(thread,value) \
     (current_binding_stack_pointer = (lispobj *)(value))
-#define access_control_stack_pointer(thread) \
+#  endif
+#define access_control_stack_pointer(thread)    \
     (current_control_stack_pointer)
+#  if !defined(LISP_FEATURE_X86) && !defined(LISP_FEATURE_X86_64)
 #define access_control_frame_pointer(thread) \
     (current_control_frame_pointer)
+#  endif
 #endif
 
 #if defined(LISP_FEATURE_SB_THREAD) && defined(LISP_FEATURE_GCC_TLS)