[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4] m68k: implement movep instruction
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v4] m68k: implement movep instruction |
Date: |
Tue, 6 Feb 2018 14:36:58 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 |
Le 06/02/2018 à 14:30, Pavel Dovgalyuk a écrit :
>> From: Laurent Vivier [mailto:address@hidden
>> Le 06/02/2018 à 13:44, Pavel Dovgalyuk a écrit :
>>> This patch implements movep instruction. It moves data between a data
>>> register
>>> and alternate bytes within the address space starting at the location
>>> specified and incrementing by two.
>>>
>>> It was designed for the original 68000 and used in firmwares for
>>> interfacing the 8-bit peripherals through the 16-bit data bus.
>>
>> Did you test this change with some kind of firmware?
>
> Yes, we implemented this instruction when tried to emulate Macintosh-128k on
> Qemu.
>
>>> Without this patch opcode for this instruction is recognized as some bitop.
>>>
>>> Signed-off-by: Pavel Dovgalyuk <address@hidden>
>>> Signed-off-by: Mihail Abakumov <address@hidden>
>>>
>>> --
>>>
>>> v4: - fixed offset calculation misprint
>>>
>>> v3: - simplified movep function code
>>> - joined movep masks
>>>
>>> v2: - disabled movep for Coldfire
>>> - fixed gen_store/load usage
>>> ---
>>> target/m68k/cpu.c | 2 ++
>>> target/m68k/cpu.h | 1 +
>>> target/m68k/translate.c | 46
>>> ++++++++++++++++++++++++++++++++++++++++++++++
>>> 3 files changed, 49 insertions(+)
>>
>> Tested-by: Laurent Vivier <address@hidden>
>>
>> I've checked we have the same result on a real 68040
>>
>> Reviewed-by: Laurent Vivier <address@hidden>
>
> Thanks!
>
> By the way, we also handled reset interrupt, but it is not compatible with
> other m68k platforms:
>
> @@ -66,8 +66,9 @@ static void m68k_cpu_reset(CPUState *s)
> cpu_m68k_set_fpcr(env, 0);
> env->fpsr = 0;
>
> - /* TODO: We should set PC from the interrupt vector. */
> - env->pc = 0;
> + env->vbr = 0;
> + /* PC and SP (for m68k) will be initialized by the reset handler */
> + s->exception_index = EXCP_RESET;
> }
>
> @@ -378,6 +380,8 @@ static void m68k_interrupt_all(CPUM68KState *env, int
> is_hw)
> cpu_m68k_set_sr(env, sr &= ~SR_M);
> sp = env->aregs[7] & ~1;
> do_stack_frame(env, &sp, 1, oldsr, 0, retaddr);
> + } else if (cs->exception_index == EXCP_RESET) {
> + sp = cpu_ldl_kernel(env, env->vbr + vector - 4);
> } else {
> do_stack_frame(env, &sp, 0, oldsr, 0, retaddr);
> }
It looks better of what I have already coded :)
Do you work using code in
https://github.com/vivier/qemu-m68k , branch q800-dev ?
I'm already emulating a Quadra 800, it can help for Macintosh-128k
Thanks,
Laurent