X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fx86-arch.c;h=fbe318bc7aa8efaceb24c7be8c7804f477ae127e;hb=01044af1b8d69fc3899dc0417064c1512223223d;hp=d2213d58324900dad06e759127bff621326eb5cc;hpb=3bb2fb5b9ecdeebecaded4ac6e5af0f653be8867;p=sbcl.git diff --git a/src/runtime/x86-arch.c b/src/runtime/x86-arch.c index d2213d5..fbe318b 100644 --- a/src/runtime/x86-arch.c +++ b/src/runtime/x86-arch.c @@ -24,6 +24,7 @@ #include "interr.h" #include "breakpoint.h" #include "monitor.h" +#include "thread.h" #include "genesis/static-symbols.h" #include "genesis/symbol.h" @@ -54,8 +55,10 @@ context_eflags_addr(os_context_t *context) return &context->uc_mcontext.gregs[16]; #elif defined __FreeBSD__ return &context->uc_mcontext.mc_eflags; -#elif defined __OpenBSD__ +#elif defined __OpenBSD__ || defined __NetBSD__ return &context->sc_eflags; +#elif defined __NetBSD__ + return &(context->uc_mcontext.__gregs[_REG_EFL]); #else #error unsupported OS #endif @@ -71,8 +74,7 @@ void arch_skip_instruction(os_context_t *context) int vlen; int code; - FSHOW((stderr, "/[arch_skip_inst at %x]\n", *os_context_pc_addr(context))); - + /* Get and skip the Lisp interrupt code. */ code = *(char*)(*os_context_pc_addr(context))++; switch (code) @@ -115,13 +117,14 @@ arch_internal_error_arguments(os_context_t *context) boolean arch_pseudo_atomic_atomic(os_context_t *context) { - return SymbolValue(PSEUDO_ATOMIC_ATOMIC); + return SymbolValue(PSEUDO_ATOMIC_ATOMIC,arch_os_get_current_thread()); } void arch_set_pseudo_atomic_interrupted(os_context_t *context) { - SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(1)); + SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(1), + arch_os_get_current_thread()); } /* @@ -190,6 +193,7 @@ sigtrap_handler(int signal, siginfo_t *info, void *void_context) int code = info->si_code; os_context_t *context = (os_context_t*)void_context; unsigned int trap; + sigset_t ss; if (single_stepping && (signal==SIGTRAP)) { @@ -240,6 +244,9 @@ sigtrap_handler(int signal, siginfo_t *info, void *void_context) case trap_PendingInterrupt: FSHOW((stderr, "/\n")); arch_skip_instruction(context); + sigemptyset(&ss); + sigaddset(&ss,SIGTRAP); + sigprocmask(SIG_UNBLOCK,&ss,0); interrupt_handle_pending(context); break; @@ -316,6 +323,7 @@ call_into_lisp(lispobj fun, lispobj *args, int nargs); * could be in registers depending on what the compiler likes. So we * copy the args into a portable vector and let the assembly language * call-in function figure it out. */ + lispobj funcall0(lispobj function) {