mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
cris: improve passing PIC interrupt vector to the CPU
Instead of accessing cpu interrupt vector directly from PIC, send the vector value over the qemu_irq. Suggested-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
3cff81733d
commit
f4f643882d
4 changed files with 10 additions and 29 deletions
|
@ -147,6 +147,14 @@ static void cris_cpu_set_irq(void *opaque, int irq, int level)
|
|||
CPUState *cs = CPU(cpu);
|
||||
int type = irq == CRIS_CPU_IRQ ? CPU_INTERRUPT_HARD : CPU_INTERRUPT_NMI;
|
||||
|
||||
if (irq == CRIS_CPU_IRQ) {
|
||||
/*
|
||||
* The PIC passes us the vector for the IRQ as the value it sends
|
||||
* over the qemu_irq line
|
||||
*/
|
||||
cpu->env.interrupt_vector = level;
|
||||
}
|
||||
|
||||
if (level) {
|
||||
cpu_interrupt(cs, type);
|
||||
} else {
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#define CPU_INTERRUPT_NMI CPU_INTERRUPT_TGT_EXT_3
|
||||
|
||||
/* CRUS CPU device objects interrupt lines. */
|
||||
/* PIC passes the vector for the IRQ as the value of it sends over qemu_irq */
|
||||
#define CRIS_CPU_IRQ 0
|
||||
#define CRIS_CPU_NMI 1
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue