;; utime(), utimes()
#-win32
- (:type suseconds-t "suseconds_t")
+ (:type suseconds-t ; OAOOM warning: similar kludge in tools-for-build
+ #-(and darwin ppc) "suseconds_t"
+ #+(and darwin ppc) "int")
#-win32
(:structure alien-utimbuf
os_flush_icache((os_vm_address_t)next_pc, sizeof(unsigned int));
}
+void
+arch_handle_breakpoint(os_context_t *context)
+{
+ *os_context_pc_addr(context) -=4;
+ handle_breakpoint(context);
+}
+
+void
+arch_handle_fun_end_breakpoint(os_context_t *context)
+{
+ *os_context_pc_addr(context) -=4;
+ *os_context_pc_addr(context) =
+ (int)handle_fun_end_breakpoint(context);
+}
+
static void
sigtrap_handler(int signal, siginfo_t *siginfo, os_context_t *context)
{
} else
/* a "system service" */
code=*((u32 *)(*os_context_pc_addr(context)));
-
- switch (code) {
- case trap_PendingInterrupt:
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- break;
-
- case trap_Halt:
- fake_foreign_function_call(context);
- lose("%%primitive halt called; the party is over.\n");
-
- case trap_Error:
- case trap_Cerror:
- interrupt_internal_error(signal, siginfo, context, code==trap_Cerror);
- break;
-
- case trap_Breakpoint: /* call lisp-level handler */
- *os_context_pc_addr(context) -=4;
- handle_breakpoint(signal, siginfo, context);
- break;
-
- case trap_FunEndBreakpoint:
- *os_context_pc_addr(context) -=4;
- *os_context_pc_addr(context) =
- (int)handle_fun_end_breakpoint(signal, siginfo, context);
- break;
-
- default:
- fprintf(stderr, "unidentified breakpoint/trap %d\n",code);
+ if (!maybe_handle_trap(context, code))
interrupt_handle_now(signal, siginfo, context);
- break;
- }
}
unsigned long
extern void restore_breakpoint_from_single_step(os_context_t * context);
#endif
+extern void arch_handle_breakpoint(os_context_t* context);
+extern void arch_handle_fun_end_breakpoint(os_context_t *context);
+#ifdef trap_AfterBreakpoint
+extern void arch_handle_after_breakpoint(os_context_t *context);
+#endif
+#ifdef trap_SingleStepAround
+extern void arch_handle_single_step_trap(os_context_t *context, int trap);
+#endif
+
#endif /* __ARCH_H__ */
}
}
-void handle_breakpoint(int signal, siginfo_t* info, os_context_t *context)
+void handle_breakpoint(os_context_t *context)
{
lispobj code, context_sap;
undo_fake_foreign_function_call(context);
}
-void *handle_fun_end_breakpoint(int signal, siginfo_t *info,
- os_context_t *context)
+void *handle_fun_end_breakpoint(os_context_t *context)
{
lispobj code, context_sap, lra;
struct code *codeptr;
unsigned int orig_inst);
extern void breakpoint_do_displaced_inst(os_context_t *context,
unsigned int orig_inst);
-extern void handle_breakpoint(int signal, siginfo_t *info,
- os_context_t *context);
-extern void *handle_fun_end_breakpoint(int signal, siginfo_t *info,
- os_context_t *context);
+extern void handle_breakpoint(os_context_t *context);
+extern void *handle_fun_end_breakpoint(os_context_t *context);
extern void handle_single_step_trap (os_context_t *context, int kind,
int register_offset);
}
#endif
-static void sigtrap_handler(int signal, siginfo_t *siginfo, void *void_context)
+void
+arch_handle_breakpoint(os_context_t *context)
+{
+ /*sigsetmask(scp->sc_mask); */
+ handle_breakpoint(context);
+}
+
+void
+arch_handle_fun_end_breakpoint(os_context_t *context)
+{
+ /*sigsetmask(scp->sc_mask); */
+ unsigned long pc;
+ pc = (unsigned long)
+ handle_fun_end_breakpoint(context);
+ *os_context_pc_addr(context) = pc;
+ *os_context_npc_addr(context) = pc + 4;
+}
+
+static void
+sigtrap_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
unsigned int bad_inst;
interrupt_handle_now(signal, siginfo, context);
else {
int im5 = bad_inst & 0x1f;
-
- switch (im5) {
- case trap_Halt:
- fake_foreign_function_call(context);
- lose("%%primitive halt called; the party is over.\n");
-
- case trap_PendingInterrupt:
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- break;
-
- case trap_Error:
- case trap_Cerror:
- interrupt_internal_error(signal, siginfo, context, im5==trap_Cerror);
- break;
-
- case trap_Breakpoint:
- /*sigsetmask(scp->sc_mask); */
- handle_breakpoint(signal, siginfo, context);
- break;
-
- case trap_FunEndBreakpoint:
- /*sigsetmask(scp->sc_mask); */
- {
- unsigned long pc;
- pc = (unsigned long)
- handle_fun_end_breakpoint(signal, siginfo, context);
- *os_context_pc_addr(context) = pc;
- *os_context_npc_addr(context) = pc + 4;
- }
- break;
-
- case trap_SingleStepBreakpoint:
- /* Uh, FIXME */
-#ifdef hpux
- restore_breakpoint(context);
-#endif
- break;
-
- default:
- interrupt_handle_now(signal, siginfo, context);
- break;
- }
+ if (!maybe_handle_trap(context, trap))
+ interrupt_handle_now(signal, sigingo, context);
}
}
#include "genesis/simple-fun.h"
#include "genesis/cons.h"
-
-
static void run_deferred_handler(struct interrupt_data *data, void *v_context);
#ifndef LISP_FEATURE_WIN32
static void store_signal_data_for_later (struct interrupt_data *data,
/* a handler for the signal caused by execution of a trap opcode
* signalling an internal error */
void
-interrupt_internal_error(int signal, siginfo_t *info, os_context_t *context,
- boolean continuable)
+interrupt_internal_error(os_context_t *context, boolean continuable)
{
lispobj context_sap;
arrange_return_to_lisp_function(context, SymbolFunction(MEMORY_FAULT_ERROR));
}
#endif
+
+/* Common logic far trapping instructions. How we actually handle each
+ * case is highly architecture dependant, but the overall shape is
+ * this. */
+boolean
+maybe_handle_trap(os_context_t *context, int trap)
+{
+ switch(trap) {
+ case trap_PendingInterrupt:
+ FSHOW((stderr, "/<trap pending interrupt>\n"));
+ arch_skip_instruction(context);
+ interrupt_handle_pending(context);
+ break;
+ case trap_Error:
+ case trap_Cerror:
+ FSHOW((stderr, "/<trap error/cerror %d>\n", trap));
+ interrupt_internal_error(context, trap==trap_Cerror);
+ break;
+ case trap_Breakpoint:
+ arch_handle_breakpoint(context);
+ break;
+ case trap_FunEndBreakpoint:
+ arch_handle_fun_end_breakpoint(context);
+ break;
+#ifdef trap_AfterBreakpoint
+ case trap_AfterBreakpoint:
+ arch_handle_after_breakpoint(context);
+ break;
+#endif
+#ifdef trap_SingleStepAround
+ case trap_SingleStepAround:
+ case trap_SingleStepBefore:
+ arch_handle_single_step_trap(context, trap);
+ break;
+#endif
+ case trap_Halt:
+ fake_foreign_function_call(context);
+ lose("%%PRIMITIVE HALT called; the party is over.\n");
+ default:
+ FSHOW((stderr,"/[C--trap default %d %d %x]\n",
+ signal, trap, context));
+ /* Not our trap! */
+ return 0;
+ }
+ return 1;
+}
+
extern void arrange_return_to_lisp_function(os_context_t *, lispobj);
extern void interrupt_handle_now(int, siginfo_t*, void*);
extern void interrupt_handle_pending(os_context_t*);
-extern void interrupt_internal_error(int, siginfo_t*, os_context_t*,
- boolean continuable);
+extern void interrupt_internal_error(os_context_t*, boolean continuable);
extern boolean handle_guard_page_triggered(os_context_t *,os_vm_address_t);
extern boolean interrupt_maybe_gc(int, siginfo_t*, void*);
extern boolean interrupt_maybe_gc_int(int, siginfo_t *, void *);
* "cleanly" with union types is in fact a mess. */
#define ARE_SAME_HANDLER(x, y) ((void*)(x) == (void*)(y))
+extern boolean maybe_handle_trap(os_context_t *context, int trap);
+
+#ifndef LISP_FEATURE_WIN32
+extern void lisp_memory_fault_error(os_context_t *context, os_vm_address_t addr);
+#endif
+
#endif
displaced_after_inst = arch_install_after_breakpoint(next_pc);
}
+void
+arch_handle_breakpoint(os_context_t *context)
+{
+ handle_breakpoint(context);
+}
+
+void
+arch_handle_fun_end_breakpoint(os_context_t *context)
+{
+ *os_context_pc_addr(context)
+ = (os_context_register_t)(unsigned int)
+ handle_fun_end_breakpoint(context);
+}
+
+void
+arch_handle_after_breakpoint(os_context_t *context)
+{
+ arch_install_breakpoint(skipped_break_addr);
+ arch_remove_breakpoint((unsigned int *)os_context_pc(context),
+ displaced_after_inst);
+ *os_context_sigmask_addr(context) = orig_sigmask;
+}
+
static void
sigtrap_handler(int signal, siginfo_t *info, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
unsigned int code = (os_context_insn(context) >> 6) & 0xfffff;
-
- switch (code) {
- case trap_Halt:
- fake_foreign_function_call(context);
- lose("%%primitive halt called; the party is over.\n");
-
- case trap_PendingInterrupt:
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- break;
-
- case trap_Error:
- case trap_Cerror:
- interrupt_internal_error(signal, info, context, code == trap_Cerror);
- break;
-
- case trap_Breakpoint:
- handle_breakpoint(signal, info, context);
- break;
-
- case trap_FunEndBreakpoint:
- *os_context_pc_addr(context)
- = (os_context_register_t)(unsigned int)
- handle_fun_end_breakpoint(signal, info, context);
- break;
-
- case trap_AfterBreakpoint:
- arch_install_breakpoint(skipped_break_addr);
- arch_remove_breakpoint((unsigned int *)os_context_pc(context),
- displaced_after_inst);
- *os_context_sigmask_addr(context) = orig_sigmask;
- break;
-
- case 0x10:
+ /* FIXME: WTF is this magic number? Needs to become a #define
+ * and go into maybe_handle_trap. */
+ if (code==0x10) {
arch_clear_pseudo_atomic_interrupted(context);
arch_skip_instruction(context);
interrupt_handle_pending(context);
- return;
-
- default:
- interrupt_handle_now(signal, info, context);
- break;
- }
+ } else if (!maybe_handle_trap(context,code))
+ interrupt_handle_now(signal, info, void_context);
}
#define FIXNUM_VALUE(lispobj) (((int)lispobj) >> N_FIXNUM_TAG_BITS)
+/*
+ * This software is part of the SBCL system. See the README file for
+ * more information.
+ *
+ * This software is derived from the CMU CL system, which was
+ * written at Carnegie Mellon University and released into the
+ * public domain. The software is in the public domain and is
+ * provided with absolutely no warranty. See the COPYING and CREDITS
+ * files for more information.
+ */
+
#include <stdio.h>
#include "sbcl.h"
#include "signal.h"
#include "interrupt.h"
#include "interr.h"
+#include "breakpoint.h"
#if defined(LISP_FEATURE_GENCGC)
#include "gencgc-alloc-region.h"
os_vm_address_t
arch_get_bad_addr(int sig, siginfo_t *code, os_context_t *context)
{
- unsigned long pc = (unsigned long)(*os_context_pc_addr(context));
os_vm_address_t addr;
#if defined(LISP_FEATURE_NETBSD)
{
unsigned int *pc;
unsigned int inst;
- unsigned int or_inst;
unsigned int target, target_ptr, end_addr;
unsigned int opcode;
int size;
- int immed;
boolean were_in_lisp;
char *memory;
- sigset_t block;
target = 0;
size = 0;
}
#endif
+void
+arch_handle_breakpoint(os_context_t *context)
+{
+ handle_breakpoint(context);
+}
+
+void
+arch_handle_fun_end_breakpoint(os_context_t *context)
+{
+ *os_context_pc_addr(context)
+ =(int)handle_fun_end_breakpoint(context);
+}
+
+/* FIXME: AFTER-BREAKPOINT-TRAP is defined for PPC, but never
+ * emitted as far as I can see. Should it be emitted, do removed
+ * entirely? */
+void
+arch_handle_after_breakpoint(os_context_t *context)
+{
+ *skipped_break_addr = trap_Breakpoint;
+ skipped_break_addr = NULL;
+ *(unsigned int *)*os_context_pc_addr(context)
+ = displaced_after_inst;
+ *os_context_sigmask_addr(context)= orig_sigmask;
+ os_flush_icache((os_vm_address_t) *os_context_pc_addr(context),
+ sizeof(unsigned int));
+}
+
+void
+arch_handle_single_step_trap(os_context_t *context, int trap)
+{
+ unsigned int code = *((u32 *)(*os_context_pc_addr(context)));
+ int register_offset = code >> 5 & 0x1f;
+ handle_single_step_trap(context, trap, register_offset);
+ arch_skip_instruction(context);
+}
static void
sigtrap_handler(int signal, siginfo_t *siginfo, os_context_t *context)
/* twllei reg_ZERO,N will always trap if reg_ZERO = 0 */
int trap = code & 0x1f;
- switch (trap) {
- case trap_Halt:
- fake_foreign_function_call(context);
- lose("%%primitive halt called; the party is over.\n");
-
- case trap_Error:
- case trap_Cerror:
- interrupt_internal_error(signal, code, context, trap == trap_Cerror);
- break;
-
- case trap_PendingInterrupt:
- /* This is supposed run after WITHOUT-INTERRUPTS if there
- * were pending signals. */
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- break;
-
- case trap_Breakpoint:
- handle_breakpoint(signal, code, context);
- break;
-
- case trap_FunEndBreakpoint:
- *os_context_pc_addr(context)
- =(int)handle_fun_end_breakpoint(signal, code, context);
- break;
-
- case trap_AfterBreakpoint:
- *skipped_break_addr = trap_Breakpoint;
- skipped_break_addr = NULL;
- *(unsigned int *)*os_context_pc_addr(context)
- = displaced_after_inst;
- *os_context_sigmask_addr(context)= orig_sigmask;
-
- os_flush_icache((os_vm_address_t) *os_context_pc_addr(context),
- sizeof(unsigned int));
- break;
-
- case trap_SingleStepAround:
- case trap_SingleStepBefore:
- {
- int register_offset = code >> 5 & 0x1f;
-
- handle_single_step_trap(context, trap, register_offset);
-
- arch_skip_instruction(context);
- break;
- }
- default:
- interrupt_handle_now(signal, code, context);
- break;
- }
+ if (!maybe_handle_trap(context,trap))
+ interrupt_handle_now(signal, siginfo, context);
+
#ifdef LISP_FEATURE_DARWIN
DARWIN_FIX_CONTEXT(context);
#endif
return;
}
if (((code >> 26) == 3) && (((code >> 21) & 31) == 24)) {
- interrupt_internal_error(signal, code, context, 0);
+ interrupt_internal_error(context, 0);
#ifdef LISP_FEATURE_DARWIN
DARWIN_FIX_CONTEXT(context);
#endif
static void print_unknown(lispobj obj)
{
- printf("unknown object: %p", obj);
+ printf("unknown object: %p", (void *)obj);
+}
+
+static void print_unknown(lispobj obj)
+{
+ printf("unknown object: %p", (void *)obj);
}
static void print_list(lispobj obj)
return result;
}
+void
+arch_handle_breakpoint(os_context_t *context)
+{
+ handle_breakpoint(context);
+}
+
+void
+arch_handle_fun_end_breakpoint(os_context_t *context)
+{
+ *os_context_pc_addr(context) = (int) handle_fun_end_breakpoint(context);
+ *os_context_npc_addr(context) = *os_context_pc_addr(context) + 4;
+}
+
+void
+arch_handle_after_breakpoint(os_context_t *context)
+{
+ *skipped_break_addr = trap_Breakpoint;
+ os_flush_icache(skipped_break_addr, sizeof(unsigned int));
+ skipped_break_addr = NULL;
+ *(unsigned long *) os_context_pc_addr(context) = displaced_after_inst;
+ /* context->sigmask = orig_sigmask; */
+ os_flush_icache((os_vm_address_t) os_context_pc_addr(context), sizeof(unsigned int));
+}
+
static void sigill_handler(int signal, siginfo_t *siginfo, void *void_context)
{
os_context_t *context = arch_os_get_context(&void_context);
inst = *pc;
trap = inst & 0x3fffff;
-
- switch (trap) {
- case trap_PendingInterrupt:
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- break;
-
- case trap_Halt:
- fake_foreign_function_call(context);
- lose("%%primitive halt called; the party is over.\n");
-
- case trap_Error:
- case trap_Cerror:
- interrupt_internal_error(signal, siginfo, context, trap == trap_Cerror);
- break;
-
- case trap_Breakpoint:
- handle_breakpoint(signal, siginfo, context);
- break;
-
- case trap_FunEndBreakpoint:
- *os_context_pc_addr(context) = (int) handle_fun_end_breakpoint(signal, siginfo, context);
- *os_context_npc_addr(context) = *os_context_pc_addr(context) + 4;
- break;
-
- case trap_AfterBreakpoint:
- *skipped_break_addr = trap_Breakpoint;
- os_flush_icache(skipped_break_addr, sizeof(unsigned int));
- skipped_break_addr = NULL;
- *(unsigned long *) os_context_pc_addr(context) = displaced_after_inst;
- /* context->sigmask = orig_sigmask; */
- os_flush_icache((os_vm_address_t) os_context_pc_addr(context), sizeof(unsigned int));
- break;
-
- default:
+ if (!maybe_handle_trap(context,trap))
interrupt_handle_now(signal, siginfo, context);
- break;
- }
}
else if ((siginfo->si_code) == ILL_ILLTRP
#ifdef LISP_FEATURE_LINUX
interrupt_handle_pending(context);
}
else {
- interrupt_internal_error(signal, siginfo, context, 0);
+ interrupt_internal_error(context, 0);
}
}
else {
if ((op1 & 3) != 0) {
/* The first arg wan't a fixnum. */
- interrupt_internal_error(signal, siginfo, context, 0);
+ interrupt_internal_error(context, 0);
return;
}
if ((op2 & 3) != 0) {
/* The second arg wan't a fixnum. */
- interrupt_internal_error(signal, siginfo, context, 0);
+ interrupt_internal_error(context, 0);
return;
}
#endif
}
+void
+arch_handle_breakpoint(os_context_t *context)
+{
+ --*os_context_pc_addr(context);
+ handle_breakpoint(context);
+}
+
+void
+arch_handle_fun_end_breakpoint(os_context_t *context)
+{
+ --*os_context_pc_addr(context);
+ *os_context_pc_addr(context) =
+ (unsigned long)handle_fun_end_breakpoint(context);
+}
+
+void
+arch_handle_single_step_trap(os_context_t *context, int trap)
+{
+ arch_skip_instruction(context);
+ /* On x86-64 the fdefn / function is always in RAX, so we pass
+ * 0 as the register_offset. */
+ handle_single_step_trap(context, trap, 0);
+}
+
\f
void
sigtrap_handler(int signal, siginfo_t *info, void *void_context)
* number of bytes will follow, the first is the length of the byte
* arguments to follow. */
trap = *(unsigned char *)(*os_context_pc_addr(context));
- switch (trap) {
-
- case trap_PendingInterrupt:
- FSHOW((stderr, "/<trap pending interrupt>\n"));
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- break;
-
- case trap_Halt:
- /* Note: the old CMU CL code tried to save FPU state
- * here, and restore it after we do our thing, but there
- * seems to be no point in doing that, since we're just
- * going to lose(..) anyway. */
- fake_foreign_function_call(context);
- lose("%%PRIMITIVE HALT called; the party is over.\n");
-
- case trap_Error:
- case trap_Cerror:
- FSHOW((stderr, "<trap error/cerror %d>\n", trap));
- interrupt_internal_error(signal, info, context, trap==trap_Cerror);
- break;
-
- case trap_Breakpoint:
- --*os_context_pc_addr(context);
- handle_breakpoint(signal, info, context);
- break;
-
- case trap_FunEndBreakpoint:
- --*os_context_pc_addr(context);
- *os_context_pc_addr(context) =
- (unsigned long)handle_fun_end_breakpoint(signal, info, context);
- break;
-
- case trap_SingleStepAround:
- case trap_SingleStepBefore:
- arch_skip_instruction(context);
- /* On x86-64 the fdefn / function is always in RAX, so we pass
- * 0 as the register_offset. */
- handle_single_step_trap(context, trap, 0);
- break;
-
- default:
- FSHOW((stderr,"/[C--trap default %d %d %x]\n",
- signal, code, context));
+
+ if (!maybe_handle_trap(context, trap))
interrupt_handle_now(signal, info, context);
- break;
- }
}
void
#elif defined __OpenBSD__
return &context->sc_eflags;
#elif defined LISP_FEATURE_DARWIN
- return &context->uc_mcontext->ss.eflags;
+ return (int *)(&context->uc_mcontext->ss.eflags);
#elif defined __NetBSD__
return &(context->uc_mcontext.__gregs[_REG_EFL]);
#elif defined LISP_FEATURE_WIN32
}
void
+arch_handle_breakpoint(os_context_t *context)
+{
+ --*os_context_pc_addr(context);
+ handle_breakpoint(context);
+}
+
+void
+arch_handle_fun_end_breakpoint(os_context_t *context)
+{
+ --*os_context_pc_addr(context);
+ *os_context_pc_addr(context) =
+ (int)handle_fun_end_breakpoint(context);
+}
+
+void
+arch_handle_single_step_trap(os_context_t *context, int trap)
+{
+ arch_skip_instruction(context);
+ /* On x86 the fdefn / function is always in EAX, so we pass 0
+ * as the register_offset. */
+ handle_single_step_trap(context, trap, 0);
+}
+
+void
sigtrap_handler(int signal, siginfo_t *info, void *void_context)
{
os_context_t *context = (os_context_t*)void_context;
* number of bytes will follow, the first is the length of the byte
* arguments to follow. */
trap = *(unsigned char *)(*os_context_pc_addr(context));
- /* FSHOW((stderr, "/<sigtrap trap %d at pc_addr: %p>\n", trap, *os_context_pc_addr(context))); */
- switch (trap) {
-
- case trap_PendingInterrupt:
- FSHOW((stderr, "/<trap pending interrupt>\n"));
- arch_skip_instruction(context);
- interrupt_handle_pending(context);
- break;
-
- case trap_Halt:
- /* Note: the old CMU CL code tried to save FPU state
- * here, and restore it after we do our thing, but there
- * seems to be no point in doing that, since we're just
- * going to lose(..) anyway. */
- fake_foreign_function_call(context);
- lose("%%PRIMITIVE HALT called; the party is over.\n");
-
- case trap_Error:
- case trap_Cerror:
- FSHOW((stderr, "<trap error/cerror %d>\n", trap));
- interrupt_internal_error(signal, info, context, trap==trap_Cerror);
- break;
-
- case trap_Breakpoint:
- --*os_context_pc_addr(context);
- handle_breakpoint(signal, info, context);
- break;
-
- case trap_FunEndBreakpoint:
- --*os_context_pc_addr(context);
- *os_context_pc_addr(context) =
- (int)handle_fun_end_breakpoint(signal, info, context);
- break;
-
- case trap_SingleStepAround:
- case trap_SingleStepBefore:
- arch_skip_instruction(context);
- /* On x86 the fdefn / function is always in EAX, so we pass 0
- * as the register_offset. */
- handle_single_step_trap(context, trap, 0);
- break;
-
- default:
- FSHOW((stderr,"/[C--trap default %d %d %x]\n",
- signal, trap, context));
+ if (!maybe_handle_trap(context, trap))
interrupt_handle_now(signal, info, context);
- break;
- }
}
void
{
switch(offset) {
case 0:
- return CONTEXT_ADDR_FROM_STEM(eax);
+ return (int *)CONTEXT_ADDR_FROM_STEM(eax);
case 2:
- return CONTEXT_ADDR_FROM_STEM(ecx);
+ return (int *)CONTEXT_ADDR_FROM_STEM(ecx);
case 4:
- return CONTEXT_ADDR_FROM_STEM(edx);
+ return (int *)CONTEXT_ADDR_FROM_STEM(edx);
case 6:
- return CONTEXT_ADDR_FROM_STEM(ebx);
+ return (int *)CONTEXT_ADDR_FROM_STEM(ebx);
case 8:
- return CONTEXT_ADDR_FROM_STEM(esp);
+ return (int *)CONTEXT_ADDR_FROM_STEM(esp);
case 10:
- return CONTEXT_ADDR_FROM_STEM(ebp);
+ return (int *)CONTEXT_ADDR_FROM_STEM(ebp);
case 12:
- return CONTEXT_ADDR_FROM_STEM(esi);
+ return (int *)CONTEXT_ADDR_FROM_STEM(esi);
case 14:
- return CONTEXT_ADDR_FROM_STEM(edi);
+ return (int *)CONTEXT_ADDR_FROM_STEM(edi);
default:
return 0;
}
int *
os_context_sp_addr(os_context_t *context)
{
- return CONTEXT_ADDR_FROM_STEM(esp);
+ return (int *)CONTEXT_ADDR_FROM_STEM(esp);
}
#endif /* __FreeBSD__ || __OpenBSD__ */
#elif defined __NetBSD__
return CONTEXT_ADDR_FROM_STEM(EIP);
#elif defined(LISP_FEATURE_DARWIN) && defined(LISP_FEATURE_X86)
- return CONTEXT_ADDR_FROM_STEM(eip);
+ return (int *)CONTEXT_ADDR_FROM_STEM(eip);
#elif defined LISP_FEATURE_DARWIN
return &context->uc_mcontext->ss.srr0;
#else
DEFTYPE("off-t", off_t);
DEFTYPE("size-t", size_t);
DEFTYPE("time-t", time_t);
+#if defined(LISP_FEATURE_DARWIN) && defined(LISP_FEATURE_PPC)
+ /* No idea if this is an issue with PPC versions of OS X, or just
+ * 10.3, but at any rate on some Darwin versions suseconds_t seems
+ * to be missing... Similar kludge in sb-posix. */
+ DEFTYPE("suseconds-t", int);
+#else
DEFTYPE("suseconds-t", suseconds_t);
+#endif
DEFTYPE("uid-t", uid_t);
printf("\n");
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.4.12"
+"1.0.4.13"