From: Alastair Bridgewater Date: Thu, 8 Nov 2012 23:32:36 +0000 (-0500) Subject: runtime/thread.h: Fix non-thread binding and control stack pointer access. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b607463d9035bab2f5f8ad3d40950da93d782176;p=sbcl.git runtime/thread.h: Fix non-thread binding and control stack pointer access. * 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. --- diff --git a/src/runtime/thread.h b/src/runtime/thread.h index 3c2d5bc..c828176 100644 --- a/src/runtime/thread.h +++ b/src/runtime/thread.h @@ -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)