* bug fix: signal a warning when defining a setf-function when a
setf-expander is already present.
Patch by Douglas Katzman.
+ * bug fix: improved threading on PPC.
changes in sbcl-1.1.10 relative to sbcl-1.1.9:
* enhancement: ASDF has been updated to 3.0.2.
}
#define ARCH_HAS_FLOAT_REGISTERS
+#define ALIEN_STACK_GROWS_DOWNWARD
#endif /* _ALPHA_ARCH_H */
}
#define ARCH_HAS_NPC_REGISTER
+#define ALIEN_STACK_GROWS_UPWARD
#endif /* _HPPA_ARCH_H */
#ifndef _MIPS_ARCH_H
#define _MIPS_ARCH_H
+#define ALIEN_STACK_GROWS_DOWNWARD
static inline void
get_spinlock(volatile lispobj *word, long value)
#endif
#define ARCH_HAS_LINK_REGISTER
+#define ALIEN_STACK_GROWS_DOWNWARD
extern void ppc_flush_icache(os_vm_address_t address, os_vm_size_t length);
}
#define ARCH_HAS_NPC_REGISTER
+#define ALIEN_STACK_GROWS_DOWNWARD
#endif /* _SPARC_ARCH_H */
th->state_not_stopped_waitcount = 0;
#endif
th->state=STATE_RUNNING;
-#ifdef LISP_FEATURE_STACK_GROWS_DOWNWARD_NOT_UPWARD
+#ifdef ALIEN_STACK_GROWS_DOWNWARD
th->alien_stack_pointer=((void *)th->alien_stack_start
+ ALIEN_STACK_SIZE-N_WORD_BYTES);
#else
#if !defined(LANGUAGE_ASSEMBLY)
#include <thread.h>
+
#ifdef LISP_FEATURE_STACK_GROWS_DOWNWARD_NOT_UPWARD
#define CONTROL_STACK_HARD_GUARD_PAGE(th) \
(CONTROL_STACK_HARD_GUARD_PAGE(th) + os_vm_page_size)
#define CONTROL_STACK_RETURN_GUARD_PAGE(th) \
(CONTROL_STACK_GUARD_PAGE(th) + os_vm_page_size)
-
-#define ALIEN_STACK_HARD_GUARD_PAGE(th) \
- ((os_vm_address_t)(th->alien_stack_start))
-#define ALIEN_STACK_GUARD_PAGE(th) \
- (ALIEN_STACK_HARD_GUARD_PAGE(th) + os_vm_page_size)
-#define ALIEN_STACK_RETURN_GUARD_PAGE(th) \
- (ALIEN_STACK_GUARD_PAGE(th) + os_vm_page_size)
-
#else
#define CONTROL_STACK_HARD_GUARD_PAGE(th) \
#define CONTROL_STACK_RETURN_GUARD_PAGE(th) \
(CONTROL_STACK_GUARD_PAGE(th) - os_vm_page_size)
+#endif
+
+#ifdef ALIEN_STACK_GROWS_DOWNWARD
+
+#define ALIEN_STACK_HARD_GUARD_PAGE(th) \
+ ((os_vm_address_t)(th->alien_stack_start))
+#define ALIEN_STACK_GUARD_PAGE(th) \
+ (ALIEN_STACK_HARD_GUARD_PAGE(th) + os_vm_page_size)
+#define ALIEN_STACK_RETURN_GUARD_PAGE(th) \
+ (ALIEN_STACK_GUARD_PAGE(th) + os_vm_page_size)
+
+#elif ALIEN_STACK_GROWS_UPWARD
+
#define ALIEN_STACK_HARD_GUARD_PAGE(th) \
(((os_vm_address_t)th->alien_stack_start) + ALIEN_STACK_SIZE - \
os_vm_page_size)
#define ALIEN_STACK_RETURN_GUARD_PAGE(th) \
(ALIEN_STACK_GUARD_PAGE(th) - os_vm_page_size)
+#else
+#error ALIEN_STACK_GROWS_DOWNWARD or ALIEN_STACK_GROWS_UPWARD has to be defined
#endif
#define BINDING_STACK_HARD_GUARD_PAGE(th) \
#include "interr.h" /* for declaration of lose() */
#define ARCH_HAS_STACK_POINTER
+#define ALIEN_STACK_GROWS_DOWNWARD
/* FIXME: Do we also want
* #define ARCH_HAS_FLOAT_REGISTERS
#include "interr.h" /* for declaration of lose() */
#define ARCH_HAS_STACK_POINTER
+#define ALIEN_STACK_GROWS_DOWNWARD
/* FIXME: Do we also want
* #define ARCH_HAS_FLOAT_REGISTERS
--- /dev/null
+#include <alloca.h>
+#include <string.h>
+
+#define SIZE 128*1024 // twice the largest page size
+void alloca_test()
+{
+ void* foo = alloca(SIZE);
+ memset(foo, 0xff, SIZE);
+}
FreeBSD-X86-64) new=-fPIC ;;
Linux-MIPS) new=-fPIC ;;
Linux-X86-64) new=-fPIC ;;
- Linux-PowerPC) new=-fPIC ;;
+ Linux-PowerPC) new=-fPIC ;;
NetBSD-PowerPC) new=-fPIC ;;
NetBSD-X86-64) new=-fPIC ;;
OpenBSD-PowerPC) new=-fPIC ;;
(sb-thread:join-thread reader)))))
(writer))
(assert (eq result :ok))))
+
+(with-test (:name :thread-alloca)
+ (sb-ext:run-program "/bin/sh"
+ '("run-compiler.sh" "-sbcl-pic" "-sbcl-shared"
+ "alloca.c" "-o" "alloca.so")
+ :environment (test-util::test-env))
+
+ (load-shared-object (truename "alloca.so"))
+
+ (alien-funcall (extern-alien "alloca_test" (function void)))
+ (sb-thread:join-thread
+ (sb-thread:make-thread
+ (lambda ()
+ (alien-funcall (extern-alien "alloca_test" (function void)))))))