diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-10 21:26:55 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-04-10 21:26:55 +0000 |
commit | 68238a9e90708740200e652631ee1356dd55147d (patch) | |
tree | ec40170ed3aa80c84da08d1d65c77cfe41532ad5 /hw/rc4030.c | |
parent | c2c5104b226f7fdcfa8e9bb9d62bd934c09da5f0 (diff) |
Clean up rc4030 init function
At the moment, rc4030 init function is returning some function pointers.
Mark them non-static and define them in header file instead.
Export also a function to read/write DMA memory, it will be required by
the netcard.
Signed-off-by: Hervé Poussineau <hpoussin@reactos.org>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@7072 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/rc4030.c')
-rw-r--r-- | hw/rc4030.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/hw/rc4030.c b/hw/rc4030.c index d83f111c21..2f9bb0e43c 100644 --- a/hw/rc4030.c +++ b/hw/rc4030.c @@ -675,7 +675,7 @@ static void rc4030_save(QEMUFile *f, void *opaque) qemu_put_be32(f, s->itr); } -static void rc4030_dma_memory_rw(void *opaque, target_phys_addr_t addr, uint8_t *buf, int len, int is_write) +void rc4030_dma_memory_rw(void *opaque, target_phys_addr_t addr, uint8_t *buf, int len, int is_write) { rc4030State *s = opaque; target_phys_addr_t entry_addr; @@ -766,13 +766,13 @@ struct rc4030DMAState { int n; }; -static void rc4030_dma_read(void *dma, uint8_t *buf, int len) +void rc4030_dma_read(void *dma, uint8_t *buf, int len) { rc4030_dma s = dma; rc4030_do_dma(s->opaque, s->n, buf, len, 0); } -static void rc4030_dma_write(void *dma, uint8_t *buf, int len) +void rc4030_dma_write(void *dma, uint8_t *buf, int len) { rc4030_dma s = dma; rc4030_do_dma(s->opaque, s->n, buf, len, 1); @@ -795,18 +795,16 @@ static rc4030_dma *rc4030_allocate_dmas(void *opaque, int n) return s; } -qemu_irq *rc4030_init(qemu_irq timer, qemu_irq jazz_bus, - rc4030_dma **dmas, - rc4030_dma_function *dma_read, rc4030_dma_function *dma_write) +void *rc4030_init(qemu_irq timer, qemu_irq jazz_bus, + qemu_irq **irqs, rc4030_dma **dmas) { rc4030State *s; int s_chipset, s_jazzio; s = qemu_mallocz(sizeof(rc4030State)); + *irqs = qemu_allocate_irqs(rc4030_irq_jazz_request, s, 16); *dmas = rc4030_allocate_dmas(s, 4); - *dma_read = rc4030_dma_read; - *dma_write = rc4030_dma_write; s->periodic_timer = qemu_new_timer(vm_clock, rc4030_periodic_timer, s); s->timer_irq = timer; @@ -821,5 +819,5 @@ qemu_irq *rc4030_init(qemu_irq timer, qemu_irq jazz_bus, s_jazzio = cpu_register_io_memory(0, jazzio_read, jazzio_write, s); cpu_register_physical_memory(0xf0000000, 0x00001000, s_jazzio); - return qemu_allocate_irqs(rc4030_irq_jazz_request, s, 16); + return s; } |