(in-package "SB!THREAD")
-#-sb-fluid (declaim (inline sb!vm::current-thread-offset-sap))
+#!-sb-fluid (declaim (inline sb!vm::current-thread-offset-sap))
(defun sb!vm::current-thread-offset-sap (n)
(declare (type (unsigned-byte 27) n))
(sb!sys:sap-ref-sap (alien-sap (extern-alien "all_threads" (* t)))
(def!constant dynamic-0-space-end #x38000000)
(def!constant dynamic-1-space-start #x40000000)
- (def!constant dynamic-1-space-end #x48000000)
-
- (def!constant control-stack-start #x50000000)
- (def!constant control-stack-end #x51000000)
-
- (def!constant binding-stack-start #x60000000)
- (def!constant binding-stack-end #x61000000))
+ (def!constant dynamic-1-space-end #x48000000))
\f
;;;; other random constants.
*current-catch-block*
*current-unwind-protect-block*
+ *binding-stack-start*
+ *control-stack-start*
+ *control-stack-end*
+
;; interrupt handling
*free-interrupt-context-index*
sb!unix::*interrupts-enabled*
(:generator 1
(inst unimp pending-interrupt-trap)))
+#!+sb-thread
+(error "write a VOP for CURRENT-THREAD-OFFSET-SAP")
(define-vop (halt)
(:generator 1
OS_SRC = sunos-os.c sparc-sunos-os.c os-common.c
#LINKFLAGS+=-static
LINKFLAGS+=
-OS_LIBS= -ldl -lsocket -lnsl
+OS_LIBS= -ldl -lsocket -lnsl -lrt
GC_SRC= cheneygc.c
struct thread *arch_os_get_current_thread() {
return all_threads;
}
-struct thread *arch_os_thread_init() {
+int arch_os_thread_init(struct thread *thread) {
return 1; /* success */
}
-struct thread *arch_os_thread_cleanup() {
+int arch_os_thread_cleanup(struct thread *thread) {
return 1; /* success */
}
#include <sys/types.h>
#include <stdlib.h>
#include <strings.h>
+#if (defined(LISP_FEATURE_SB_THREAD) && defined(LISP_FEATURE_LINUX))
#include <sys/ptrace.h>
#include <linux/user.h>
+#endif
#include <errno.h>
#include "runtime.h"
undoably_install_low_level_interrupt_handler(SIGEMT, sigemt_handler);
}
+void get_spinlock(lispobj *word, int value) {
+ /* FIXME: dummy definition */
+ *word = value;
+}
+
\f
extern lispobj call_into_lisp(lispobj fun, lispobj *args, int nargs);
#include "validate.h"
+#ifdef LISP_FEATURE_SB_THREAD
+#error "Define threading support functions"
+#else
+struct thread *arch_os_get_current_thread() {
+ return all_threads;
+}
+int arch_os_thread_init(struct thread *thread) {
+ return 1; /* success */
+}
+int arch_os_thread_cleanup(struct thread *thread) {
+ return 1; /* success */
+}
+#endif
os_context_register_t *
os_context_register_addr(os_context_t *context, int offset)
Just assume address is valid if it lies within one of the known
spaces. (Unlike sunos-os which keeps track of every valid page.) */
- return ( in_range_p(addr, READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE)
- || in_range_p(addr, STATIC_SPACE_START , STATIC_SPACE_SIZE )
- || in_range_p(addr, DYNAMIC_0_SPACE_START, DYNAMIC_SPACE_SIZE )
- || in_range_p(addr, DYNAMIC_1_SPACE_START, DYNAMIC_SPACE_SIZE )
- || in_range_p(addr, CONTROL_STACK_START , CONTROL_STACK_SIZE )
- || in_range_p(addr, BINDING_STACK_START , BINDING_STACK_SIZE ));
+
+ /* FIXME: this looks like a valid definition for all targets with
+ cheney-gc; it may not be impressively smart (witness the
+ comment above) but maybe associating these functions with the
+ GC rather than the OS would be a maintainability win. -- CSR,
+ 2003-04-04 */
+ struct thread *th;
+ if(in_range_p(addr, READ_ONLY_SPACE_START, READ_ONLY_SPACE_SIZE) ||
+ in_range_p(addr, STATIC_SPACE_START , STATIC_SPACE_SIZE) ||
+ in_range_p(addr, DYNAMIC_0_SPACE_START, DYNAMIC_SPACE_SIZE) ||
+ in_range_p(addr, DYNAMIC_1_SPACE_START, DYNAMIC_SPACE_SIZE))
+ return 1;
+ for_each_thread(th) {
+ if((th->control_stack_start <= addr) && (addr < th->control_stack_end))
+ return 1;
+ if(in_range_p(addr, th->binding_stack_start, BINDING_STACK_SIZE))
+ return 1;
+ }
+ return 0;
}
-
\f
#include <stdlib.h>
#include <stdio.h>
#include <sched.h>
+#include <signal.h>
#include <stddef.h>
#ifndef CLONE_PARENT /* lameass glibc 2.2 doesn't define this */
#define CLONE_PARENT 0x00008000 /* even though the manpage documents it */
fprintf(stderr, "/continue\n");
}
th->unbound_marker = UNBOUND_MARKER_WIDETAG;
+#ifdef LISP_FEATURE_SB_THREAD
/* wait here until our thread is linked into all_threads: see below */
while(th->pid<1) sched_yield();
+#else
+ if(th->pid < 1)
+ lose("th->pid not set up right");
+#endif
if(arch_os_thread_init(th)==0)
return 1; /* failure. no, really */
return 0;
}
-
-
void block_sigcont(void)
{
/* don't allow ourselves to receive SIGCONT while we're in the
sigwaitinfo(&set,0);
sigprocmask(SIG_UNBLOCK,&set,0);
}
-
#endif
}
-
+int arch_os_thread_init(struct thread *thread);
+extern struct thread *arch_os_get_current_thread();
#endif /* _INCLUDE_THREAD_H_ */
return (os_context_t *) *void_context;
}
-extern struct thread *arch_os_get_current_thread();
unsigned long os_context_fp_control(os_context_t *context);
void os_restore_fp_control(os_context_t *context);
-int arch_os_thread_init(struct thread *thread);
#endif /* _X86_LINUX_OS_H */
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.pre8.38"
+"0.pre8.39"