[Milkymist-devel] QEMU/LM32
Michael Walle
michael at walle.cc
Sat Mar 20 14:17:50 PDT 2010
Hi Fabrice,
i finally found time to redesign the irq stuff.
Am Friday 05 March 2010 00:19:46 schrieben Sie:
> In order to have a clearer view, you should consider the PIC as external
> to the CPU and IM/IP/irq_state as a state of the PIC, not the CPU (you
> can implement CSR_IM and CSR_IP as callbacks to the PIC code).
>
> The CPU only "sees" CPU_INTERRUPT_HARD = ((im & ip) != 0), which is set
> by the PIC as in your code. It also sees "IE".
>
> In order to let IRQs be handled by the CPU, then you must terminate the
> translated block after instructions modifying IE/IP/IM (this is another
> problem in your code I forgot to spot).
Could you please have a quick look at the sources again. I changed the irq
handling according to your suggestions.
The lm32_pic.c now handles the IM and IP registers. There are four new op
helper functions, calling the approriate methods within the lm32_pic module.
These need the lm32_pic state object, which is referenced in the CPUState.
Is there any better way than doing the following in the machine initializer:
dev = sysbus_create_simple("lm32,pic", -1, *cpu_irq);
env->pic_handle = (struct lm32_pic*)dev;
> Then helper_update_interrupt() can be removed.
it is now ;)
--
wkr,
Michael
More information about the Devel
mailing list