1.0.23.40: export page sizes to C with LU suffix
[sbcl.git] / src / runtime / thread.h
index ca50539..c252afa 100644 (file)
@@ -17,6 +17,7 @@ struct alloc_region { };
 #include "genesis/symbol.h"
 #include "genesis/static-symbols.h"
 #include "genesis/thread.h"
+#include "genesis/fdefn.h"
 
 #define STATE_RUNNING (make_fixnum(1))
 #define STATE_SUSPENDED (make_fixnum(2))
@@ -33,6 +34,15 @@ union per_thread_data {
 extern struct thread * volatile all_threads;
 extern int dynamic_values_bytes;
 
+#if defined(LISP_FEATURE_DARWIN)
+#define CONTROL_STACK_ALIGNMENT_BYTES 8192 /* darwin wants page-aligned stacks */
+#define THREAD_ALIGNMENT_BYTES CONTROL_STACK_ALIGNMENT_BYTES
+#else
+#define THREAD_ALIGNMENT_BYTES BACKEND_PAGE_BYTES
+#define CONTROL_STACK_ALIGNMENT_BYTES 16
+#endif
+
+
 #ifdef LISP_FEATURE_SB_THREAD
 #define for_each_thread(th) for(th=all_threads;th;th=th->next)
 #else
@@ -102,6 +112,13 @@ SetTlSymbolValue(u64 tagged_symbol_pointer,lispobj val, void *thread)
 #endif
 }
 
+/* This only works for static symbols. */
+static inline lispobj
+StaticSymbolFunction(lispobj sym)
+{
+    return ((struct fdefn *)native_pointer(SymbolValue(sym, 0)))->fun;
+}
+
 static inline
 os_context_t *get_interrupt_context_for_thread(struct thread *th)
 {