Re: [hatari-devel] Re: Hatari 040/060 + MMU exception handling regression

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Le 02/04/2020 à 23:18, Eero Tamminen a écrit :
Hi,

Git bisect gave this as the Hatari commit breaking
040/060 + MMU exception handling for EmuTOS:
-----------------------------------------------
6476cca9daf6e3ab114d75474f5fb76b1580107c is the first bad commit
commit 6476cca9daf6e3ab114d75474f5fb76b1580107c
Author: Nicolas Pomarede <npomarede@xxxxxxxxxxxx>
Date:   Mon Feb 17 18:11:40 2020 +0100

    Enable the new bus error handler in WinUAE's cpu core and set 'hardware_bus_error=1' on bus error

diff --git a/src/m68000.c b/src/m68000.c
index 4bf3b3d1..bea402d5 100644
--- a/src/m68000.c
+++ b/src/m68000.c
@@ -651,11 +651,16 @@ void M68000_BusError ( Uint32 addr , int ReadWrite , int Size , int AccessType )
                 bBusErrorReadWrite = ReadWrite;
                M68000_SetSpecial(SPCFLAG_BUSERROR);            /* The exception will be done in newcpu.c */
         }
+#else
+#define WINUAE_HANDLE_BUS_ERROR
+#ifdef WINUAE_HANDLE_BUS_ERROR
+       hardware_bus_error = 1;
  #else
        /* With WinUAE's cpu, on a bus error instruction will be correctly aborted before completing, */         /* so we don't need to check if the opcode already generated a bus error or not */
         exception2 ( addr , ReadWrite , Size , AccessType );
  #endif
+#endif
  }

-----------------------------------------------

Grepping for the new variable shows:
-----------------------------------------------
$ git grep -l hardware_bus_error
src/cpu/cpummu030.c
src/cpu/debug.c
src/cpu/gencpu.c
src/cpu/newcpu.c
src/cpu/newcpu.h
src/m68000.c
-----------------------------------------------

I.e. that variable isn't used in the cpummu.c
file where 040 & 060 MMU emulation is.

Nicolas, Toni?


Attached patch is a workaround fixing 512k EmuTOS
boot with 040/060 + MMU.

(EmuTOS calibration loop seems to take quite long
long on 060.)


Hi

thanks for looking into this.

As Amiga doesn't really need bus error emulation to work (except maybe some very specific accelerator board), it's possible some case were forgotten and not noticed in 68040/60 when adding support for "hardware_bus_error"

I will try check this.

Nicolas




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/