sparc32_dma: introduce new SPARC32_DMA type container object
[qemu.git] / include / hw / sparc / sparc32_dma.h
blob5deeca6c127531450dfe9ea7377f849716991778
1 #ifndef SPARC32_DMA_H
2 #define SPARC32_DMA_H
4 #include "hw/sysbus.h"
5 #include "hw/scsi/esp.h"
6 #include "hw/net/lance.h"
8 #define DMA_REGS 4
10 #define TYPE_SPARC32_DMA_DEVICE "sparc32-dma-device"
11 #define SPARC32_DMA_DEVICE(obj) OBJECT_CHECK(DMADeviceState, (obj), \
12 TYPE_SPARC32_DMA_DEVICE)
14 typedef struct DMADeviceState DMADeviceState;
16 struct DMADeviceState {
17 SysBusDevice parent_obj;
19 MemoryRegion iomem;
20 uint32_t dmaregs[DMA_REGS];
21 qemu_irq irq;
22 void *iommu;
23 qemu_irq gpio[2];
24 uint32_t is_ledma;
27 #define TYPE_SPARC32_ESPDMA_DEVICE "sparc32-espdma"
28 #define SPARC32_ESPDMA_DEVICE(obj) OBJECT_CHECK(ESPDMADeviceState, (obj), \
29 TYPE_SPARC32_ESPDMA_DEVICE)
31 typedef struct ESPDMADeviceState {
32 DMADeviceState parent_obj;
34 SysBusESPState *esp;
35 } ESPDMADeviceState;
37 #define TYPE_SPARC32_LEDMA_DEVICE "sparc32-ledma"
38 #define SPARC32_LEDMA_DEVICE(obj) OBJECT_CHECK(LEDMADeviceState, (obj), \
39 TYPE_SPARC32_LEDMA_DEVICE)
41 typedef struct LEDMADeviceState {
42 DMADeviceState parent_obj;
44 SysBusPCNetState *lance;
45 } LEDMADeviceState;
47 #define TYPE_SPARC32_DMA "sparc32-dma"
48 #define SPARC32_DMA(obj) OBJECT_CHECK(SPARC32DMAState, (obj), \
49 TYPE_SPARC32_DMA)
51 typedef struct SPARC32DMAState {
52 SysBusDevice parent_obj;
54 MemoryRegion dmamem;
55 ESPDMADeviceState *espdma;
56 LEDMADeviceState *ledma;
57 } SPARC32DMAState;
59 /* sparc32_dma.c */
60 void ledma_memory_read(void *opaque, hwaddr addr,
61 uint8_t *buf, int len, int do_bswap);
62 void ledma_memory_write(void *opaque, hwaddr addr,
63 uint8_t *buf, int len, int do_bswap);
64 void espdma_memory_read(void *opaque, uint8_t *buf, int len);
65 void espdma_memory_write(void *opaque, uint8_t *buf, int len);
67 #endif