0.9.6.42:
[sbcl.git] / src / runtime / x86-arch.c
index 5e46ac3..7f136f7 100644 (file)
@@ -35,6 +35,13 @@ unsigned long fast_random_state = 1;
 
 void arch_init(void)
 {}
+
+os_vm_address_t
+arch_get_bad_addr(int sig, siginfo_t *code, os_context_t *context)
+{
+    return (os_vm_address_t)code->si_addr;
+}
+
 \f
 /*
  * hacking signal contexts
@@ -46,7 +53,7 @@ void arch_init(void)
 int *
 context_eflags_addr(os_context_t *context)
 {
-#if defined __linux__
+#if defined __linux__ || defined __sun
     /* KLUDGE: As of kernel 2.2.14 on Red Hat 6.2, there's code in the
      * <sys/ucontext.h> file to define symbolic names for offsets into
      * gregs[], but it's conditional on __USE_GNU and not defined, so
@@ -126,15 +133,22 @@ arch_set_pseudo_atomic_interrupted(os_context_t *context)
     SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(1),
                    arch_os_get_current_thread());
 }
+
+void
+arch_clear_pseudo_atomic_interrupted(os_context_t *context)
+{
+    SetSymbolValue(PSEUDO_ATOMIC_INTERRUPTED, make_fixnum(0),
+                   arch_os_get_current_thread());
+}
 \f
 /*
  * This stuff seems to get called for TRACE and debug activity.
  */
 
-unsigned long
+unsigned int
 arch_install_breakpoint(void *pc)
 {
-    unsigned long result = *(unsigned long*)pc;
+    unsigned int result = *(unsigned int*)pc;
 
     *(char*)pc = BREAKPOINT_INST;               /* x86 INT3       */
     *((char*)pc+1) = trap_Breakpoint;           /* Lisp trap code */
@@ -143,7 +157,7 @@ arch_install_breakpoint(void *pc)
 }
 
 void
-arch_remove_breakpoint(void *pc, unsigned long orig_inst)
+arch_remove_breakpoint(void *pc, unsigned int orig_inst)
 {
     *((char *)pc) = orig_inst & 0xff;
     *((char *)pc + 1) = (orig_inst & 0xff00) >> 8;
@@ -180,7 +194,7 @@ arch_do_displaced_inst(os_context_t *context, unsigned int orig_inst)
     *context_eflags_addr(context) |= 0x100;
 #endif
 
-    single_stepping = (unsigned int*)pc;
+    single_stepping = pc;
 
 #ifdef CANNOT_GET_TO_SINGLE_STEP_FLAG
     *os_context_pc_addr(context) = (char *)pc - 9;