On Wed, Oct 28, 2026 at 7:54 AM Laurent Vivier <[email protected]> wrote:
>
> Le 03/09/2026 à 06:45, 54weasels a écrit :
> > Why this change is made & How it will be used:
> > The Sun-3 ROM expects the Cache Control Register (CAAR) to exist on the 
> > 68020. Reading/writing this register currently aborts QEMU. This patch 
> > provides a dummy implementation that simply ignores writes and returns 0 on 
> > reads, allowing the ROM to continue booting.
> >
> > Impact on existing functionality:
> > No impact on existing targets. ColdFire and Mac targets do not access CAAR 
> > in a way that currently aborts, and providing a safe dummy implementation 
> > ensures robustness across M68k boards.
> >
> > Signed-off-by: 54weasels <[email protected]>
> > ---
> >   target/m68k/helper.c | 8 ++++++--
> >   1 file changed, 6 insertions(+), 2 deletions(-)
> >
> > diff --git a/target/m68k/helper.c b/target/m68k/helper.c
> > index 5f91d206f5..68f523ea84 100644
> > --- a/target/m68k/helper.c
> > +++ b/target/m68k/helper.c
> > @@ -281,8 +281,10 @@ void HELPER(m68k_movec_to)(CPUM68KState *env, uint32_t 
> > reg, uint32_t val)
> >               return;
> >           }
> >           break;
> > -    /* Unimplemented Registers */
> > +    /* Dummy implementation for CAAR */
> >       case M68K_CR_CAAR:
>
> CAAR is only supported on 020 and 030, use m68k_feature() here to check them 
> and return. Otherwise
> use break to go to raise_exception_ra()
>
> > +        return;
> > +    /* Unimplemented Registers */
> >       case M68K_CR_PCR:
> >       case M68K_CR_BUSCR:
> >           cpu_abort(env_cpu(env),
> > @@ -385,8 +387,10 @@ uint32_t HELPER(m68k_movec_from)(CPUM68KState *env, 
> > uint32_t reg)
> >               return env->mmu.ttr[M68K_DTTR1];
> >           }
> >           break;
> > -    /* Unimplemented Registers */
> > +    /* Dummy implementation for CAAR */
> >       case M68K_CR_CAAR:
> > +        return 0;
>
> Same comment as for m68k_movec_to()
>
> > +    /* Unimplemented Registers */
> >       case M68K_CR_PCR:
> >       case M68K_CR_BUSCR:
> >           cpu_abort(env_cpu(env), "Unimplemented control register read 
> > 0x%x\n",
>
> Thanks,
> Laurent
>

Thanks Laurent, will do in v6: CAAR is accepted only when M68020 or M68030
is set, and every other CPU falls through to raise_exception_ra(). Same
change in m68k_movec_from().

Reply via email to