mirror of
https://github.com/mii443/qemu.git
synced 2025-12-17 01:28:52 +00:00
SH4: Use qemu_irq in timer emulation.
* hw/sh.h (tmu012_init): Accept qemu_irq, not intc_source.
* hw/sh7750.c (sh7750_init): Pass qemu_irq to tmu012_init.
* hw/sh_intc.c (sh_intc_set_irq): New.
(sh_intc_init): Allocate irqs.
* hw/sh_intc.h (struct intc_desc): New field irqs.
* hw/sh_timer.c (sh_timer_state): Use qemu_irq, not intc_source.
(sh_timer_update): Use qemu_set_irq, not sh_intc_toggle_source.
(sh_timer_init, tmu012_init): Adjust.
(Vladimir Prus)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5768 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
10
hw/sh_intc.c
10
hw/sh_intc.c
@@ -73,6 +73,14 @@ void sh_intc_toggle_source(struct intc_source *source,
|
||||
}
|
||||
}
|
||||
|
||||
void sh_intc_set_irq (void *opaque, int n, int level)
|
||||
{
|
||||
struct intc_desc *desc = opaque;
|
||||
struct intc_source *source = &(desc->sources[n]);
|
||||
|
||||
sh_intc_toggle_source(source, 0, level ? 1 : -1);
|
||||
}
|
||||
|
||||
int sh_intc_get_pending_vector(struct intc_desc *desc, int imask)
|
||||
{
|
||||
unsigned int i;
|
||||
@@ -428,6 +436,8 @@ int sh_intc_init(struct intc_desc *desc,
|
||||
|
||||
source->parent = desc;
|
||||
}
|
||||
|
||||
desc->irqs = qemu_allocate_irqs(sh_intc_set_irq, desc, nr_sources);
|
||||
|
||||
desc->iomemtype = cpu_register_io_memory(0, sh_intc_readfn,
|
||||
sh_intc_writefn, desc);
|
||||
|
||||
Reference in New Issue
Block a user