diff options
author | Andrzej Zaborowski <balrog@zabor.org> | 2011-03-03 15:06:03 +0100 |
---|---|---|
committer | Andrzej Zaborowski <balrog@zabor.org> | 2011-03-03 15:06:03 +0100 |
commit | f114c826122759c619ef3ca55b6cfbe7d4d35bc3 (patch) | |
tree | 3fd0bfde3d1c12745b492b251adb69a7b0575c90 /hw/pxa2xx_dma.c | |
parent | 2115c01924ff355c48c10ef08fe5a87c958eb54a (diff) |
pxa2xx_dma: Get rid of a forward declaration.
Diffstat (limited to 'hw/pxa2xx_dma.c')
-rw-r--r-- | hw/pxa2xx_dma.c | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/hw/pxa2xx_dma.c b/hw/pxa2xx_dma.c index 6c599a0b07..a67498b2bc 100644 --- a/hw/pxa2xx_dma.c +++ b/hw/pxa2xx_dma.c @@ -426,7 +426,30 @@ static CPUWriteMemoryFunc * const pxa2xx_dma_writefn[] = { pxa2xx_dma_write }; -static void pxa2xx_dma_request(void *opaque, int req_num, int on); +static void pxa2xx_dma_request(void *opaque, int req_num, int on) +{ + PXA2xxDMAState *s = opaque; + int ch; + if (req_num < 0 || req_num >= PXA2XX_DMA_NUM_REQUESTS) + hw_error("%s: Bad DMA request %i\n", __FUNCTION__, req_num); + + if (!(s->req[req_num] & DRCMR_MAPVLD)) + return; + ch = s->req[req_num] & DRCMR_CHLNUM; + + if (!s->chan[ch].request && on) + s->chan[ch].state |= DCSR_RASINTR; + else + s->chan[ch].state &= ~DCSR_RASINTR; + if (s->chan[ch].request && !on) + s->chan[ch].state |= DCSR_EORINT; + + s->chan[ch].request = on; + if (on) { + pxa2xx_dma_run(s); + pxa2xx_dma_update(s, ch); + } +} static int pxa2xx_dma_init(SysBusDevice *dev) { @@ -484,31 +507,6 @@ DeviceState *pxa255_dma_init(target_phys_addr_t base, qemu_irq irq) return dev; } -static void pxa2xx_dma_request(void *opaque, int req_num, int on) -{ - PXA2xxDMAState *s = opaque; - int ch; - if (req_num < 0 || req_num >= PXA2XX_DMA_NUM_REQUESTS) - hw_error("%s: Bad DMA request %i\n", __FUNCTION__, req_num); - - if (!(s->req[req_num] & DRCMR_MAPVLD)) - return; - ch = s->req[req_num] & DRCMR_CHLNUM; - - if (!s->chan[ch].request && on) - s->chan[ch].state |= DCSR_RASINTR; - else - s->chan[ch].state &= ~DCSR_RASINTR; - if (s->chan[ch].request && !on) - s->chan[ch].state |= DCSR_EORINT; - - s->chan[ch].request = on; - if (on) { - pxa2xx_dma_run(s); - pxa2xx_dma_update(s, ch); - } -} - static bool is_version_0(void *opaque, int version_id) { return version_id == 0; |