Merge remote-tracking branch 'stefanha/tracing' into staging
[qemu.git] / hw / isa.h
blobf344699722fc4668a4d1e5b519cf421777edced8
1 #ifndef HW_ISA_H
2 #define HW_ISA_H
4 /* ISA bus */
6 #include "ioport.h"
7 #include "memory.h"
8 #include "qdev.h"
10 typedef struct ISABus ISABus;
11 typedef struct ISADevice ISADevice;
12 typedef struct ISADeviceInfo ISADeviceInfo;
14 struct ISADevice {
15 DeviceState qdev;
16 uint32_t isairq[2];
17 int nirqs;
18 uint16_t ioports[32];
19 int nioports;
22 typedef int (*isa_qdev_initfn)(ISADevice *dev);
23 struct ISADeviceInfo {
24 DeviceInfo qdev;
25 isa_qdev_initfn init;
28 ISABus *isa_bus_new(DeviceState *dev);
29 void isa_bus_irqs(qemu_irq *irqs);
30 qemu_irq isa_get_irq(int isairq);
31 void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
32 void isa_init_ioport(ISADevice *dev, uint16_t ioport);
33 void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length);
34 void isa_qdev_register(ISADeviceInfo *info);
35 MemoryRegion *isa_address_space(ISADevice *dev);
36 ISADevice *isa_create(const char *name);
37 ISADevice *isa_try_create(const char *name);
38 ISADevice *isa_create_simple(const char *name);
40 extern target_phys_addr_t isa_mem_base;
42 void isa_mmio_setup(MemoryRegion *mr, target_phys_addr_t size);
43 void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size);
45 /* dma.c */
46 int DMA_get_channel_mode (int nchan);
47 int DMA_read_memory (int nchan, void *buf, int pos, int size);
48 int DMA_write_memory (int nchan, void *buf, int pos, int size);
49 void DMA_hold_DREQ (int nchan);
50 void DMA_release_DREQ (int nchan);
51 void DMA_schedule(int nchan);
52 void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit);
53 void DMA_register_channel (int nchan,
54 DMA_transfer_handler transfer_handler,
55 void *opaque);
56 #endif