val = (opc >> 9) & 0x0007;
off = *(uint16_t*)(xpc+1);
} else {
- fprintf(stderr, "SEGV: short instructions %x\n", opc);
+
+ /*fprintf(stderr, "SEGV: short instructions %x\n", opc);
+ */
/* now check the 32 bit sized instructions */
if ((opc & (2<<3)) == (2<<3)) {
if (opc & (1<<6)) adrreg = true; /* M_L*X */
}*/
- fprintf(stderr, "SEGV: sp=%x, xpc=%x, regval=%x\n", sp, xpc, regval);
+ /*fprintf(stderr, "SEGV: sp=%x, xpc=%x, regval=%x\n", sp, xpc, regval);
+ */
e = exceptions_new_hardware_exception(0, sp, xpc, xpc, EXCEPTION_HARDWARE_NULLPOINTER, regval);
_mc->gregs[GREGS_ADRREG_OFF + REG_ATMP1] = (ptrint) e;
/* Figure out in which register the object causing the exception resides for appropiate exceptions
*/
switch (type) {
+ case EXCEPTION_HARDWARE_ARITHMETIC:
case EXCEPTION_HARDWARE_EXCEPTION:
/* nothing */
break;
regval = _mc->gregs[ GREGS_ADRREG_OFF + (regval & 0x7) ];
break;
case EXCEPTION_HARDWARE_ARRAYINDEXOUTOFBOUNDS:
- regval = 0; /* FIXME */
+ regval = *(uint16_t*)(xpc-4);
+ assert( (regval&0xfff0) == 0x4a00 );
+ /* was a data register */
+ regval = _mc->gregs[regval & 0x7];
break;
case M68K_EXCEPTION_HARDWARE_NULLPOINTER:
type = EXCEPTION_HARDWARE_NULLPOINTER;
default: assert(0);
}
- /*fprintf(stderr, "NEW HWE: sp=%x, xpc=%x, tpye=%x, regval=%x\n", sp, xpc, type, regval);*/
+ /*fprintf(stderr, "NEW HWE: sp=%x, xpc=%x, tpye=%x, regval=%x\n", sp, xpc, type, regval);
+ */
e = exceptions_new_hardware_exception(0, sp, xpc, xpc, type, regval);
_mc->gregs[GREGS_ADRREG_OFF + REG_ATMP1] = (ptrint) e;
_mc->gregs[GREGS_ADRREG_OFF + REG_ATMP2_XPC] = (ptrint) xpc;
_mc->gregs[R_PC] = (ptrint) asm_handle_exception;
}
+
+
+/*
+ * These are local overrides for various environment variables in Emacs.
+ * Please do not remove this and leave it at the end of the file, where
+ * Emacs will automagically detect them.
+ * ---------------------------------------------------------------------
+ * Local variables:
+ * mode: c
+ * indent-tabs-mode: t
+ * c-basic-offset: 4
+ * tab-width: 4
+ * End:
+ * vim:noexpandtab:sw=4:ts=4:
+ */