From 474bf4782c1bed4568b18c66bdff57454916d8ff Mon Sep 17 00:00:00 2001 From: Giovanni Bajo Date: Sun, 29 May 2022 01:02:19 +0200 Subject: [PATCH] vr4300: implement DADE exception. Very likely to be wrong in details, but still better than an abort. --- vr4300/fault.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vr4300/fault.c b/vr4300/fault.c index 7fc8f65..8eff8b3 100644 --- a/vr4300/fault.c +++ b/vr4300/fault.c @@ -223,7 +223,14 @@ void VR4300_CPU(struct vr4300 *vr4300) { // DADE: Data address error exception. void VR4300_DADE(struct vr4300 *vr4300) { - abort(); // Hammertime! + struct vr4300_latch *common = &vr4300->pipeline.exdc_latch.common; + uint32_t cause, status; + uint64_t epc; + + vr4300_ex_fault(vr4300, VR4300_FAULT_CPU); + vr4300_exception_prolog(vr4300, common, &cause, &status, &epc); + vr4300_exception_epilogue(vr4300, (cause & ~0xFF) | (1 << 28) | 0x10, + status, epc, 0x180); } // DCB: Data cache busy interlock.