Revision 47103572 hw/openpic.c
b/hw/openpic.c | ||
---|---|---|
164 | 164 |
|
165 | 165 |
struct openpic_t { |
166 | 166 |
PCIDevice pci_dev; |
167 |
SetIRQFunc *set_irq; |
|
167 | 168 |
int mem_index; |
168 | 169 |
/* Global registers */ |
169 | 170 |
uint32_t frep; /* Feature reporting register */ |
... | ... | |
264 | 265 |
IRQ_setbit(&dst->raised, n_IRQ); |
265 | 266 |
if (priority > dst->raised.priority) { |
266 | 267 |
IRQ_get_next(opp, &dst->raised); |
267 |
DPRINTF("Raise CPU IRQ\n");
|
|
268 |
cpu_interrupt(dst->env, CPU_INTERRUPT_HARD);
|
|
268 |
DPRINTF("Raise CPU IRQ fn %p env %p\n", opp->set_irq, dst->env);
|
|
269 |
opp->set_irq(dst->env, OPENPIC_EVT_INT, 1);
|
|
269 | 270 |
} |
270 | 271 |
} |
271 | 272 |
|
... | ... | |
532 | 533 |
/* XXX: Should be able to reset any CPU */ |
533 | 534 |
if (val & 1) { |
534 | 535 |
DPRINTF("Reset CPU IRQ\n"); |
535 |
// cpu_interrupt(first_cpu, CPU_INTERRUPT_RESET);
|
|
536 |
// opp->set_irq(dst->env, OPENPIC_EVT_RESET, 1);
|
|
536 | 537 |
} |
537 | 538 |
break; |
538 | 539 |
#if MAX_IPI > 0 |
... | ... | |
781 | 782 |
src = &opp->src[n_IRQ]; |
782 | 783 |
if (IPVP_PRIORITY(src->ipvp) > dst->servicing.priority) { |
783 | 784 |
DPRINTF("Raise CPU IRQ\n"); |
784 |
cpu_interrupt(dst->env, CPU_INTERRUPT_HARD);
|
|
785 |
opp->set_irq(dst->env, OPENPIC_EVT_INT, 1);
|
|
785 | 786 |
} |
786 | 787 |
} |
787 | 788 |
break; |
... | ... | |
963 | 964 |
#endif |
964 | 965 |
} |
965 | 966 |
|
966 |
openpic_t *openpic_init (PCIBus *bus, int *pmem_index, int nb_cpus,
|
|
967 |
CPUPPCState **envp) |
|
967 |
openpic_t *openpic_init (PCIBus *bus, SetIRQFunc *set_irq,
|
|
968 |
int *pmem_index, int nb_cpus, CPUPPCState **envp)
|
|
968 | 969 |
{ |
969 | 970 |
openpic_t *opp; |
970 | 971 |
uint8_t *pci_conf; |
... | ... | |
994 | 995 |
} else { |
995 | 996 |
opp = qemu_mallocz(sizeof(openpic_t)); |
996 | 997 |
} |
997 |
|
|
998 |
opp->set_irq = set_irq; |
|
998 | 999 |
opp->mem_index = cpu_register_io_memory(0, openpic_read, |
999 | 1000 |
openpic_write, opp); |
1000 | 1001 |
|
Also available in: Unified diff