]>
Commit | Line | Data |
---|---|---|
79383c9c BS |
1 | #ifndef HW_ISA_H |
2 | #define HW_ISA_H | |
f915a115 | 3 | |
87ecb68b PB |
4 | /* ISA bus */ |
5 | ||
32993977 | 6 | #include "ioport.h" |
af956cad | 7 | #include "memory.h" |
f915a115 GH |
8 | #include "qdev.h" |
9 | ||
10 | typedef struct ISABus ISABus; | |
11 | typedef struct ISADevice ISADevice; | |
12 | typedef struct ISADeviceInfo ISADeviceInfo; | |
13 | ||
14 | struct ISADevice { | |
15 | DeviceState qdev; | |
78e20593 | 16 | MemoryRegion *io[32]; |
2091ba23 | 17 | uint32_t isairq[2]; |
dee41d58 | 18 | uint16_t ioports[32]; |
78e20593 | 19 | int nirqs; |
dee41d58 | 20 | int nioports; |
78e20593 | 21 | int nio; |
f915a115 GH |
22 | }; |
23 | ||
81a322d4 | 24 | typedef int (*isa_qdev_initfn)(ISADevice *dev); |
f915a115 GH |
25 | struct ISADeviceInfo { |
26 | DeviceInfo qdev; | |
27 | isa_qdev_initfn init; | |
28 | }; | |
29 | ||
c2d0d012 | 30 | ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io); |
2091ba23 | 31 | void isa_bus_irqs(qemu_irq *irqs); |
ee951a37 | 32 | qemu_irq isa_get_irq(int isairq); |
2e15e23b | 33 | void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq); |
78e20593 | 34 | void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start); |
dee41d58 GN |
35 | void isa_init_ioport(ISADevice *dev, uint16_t ioport); |
36 | void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length); | |
f915a115 | 37 | void isa_qdev_register(ISADeviceInfo *info); |
c839adec | 38 | MemoryRegion *isa_address_space(ISADevice *dev); |
924f6d72 | 39 | ISADevice *isa_create(const char *name); |
86f4a9a5 | 40 | ISADevice *isa_try_create(const char *name); |
2e15e23b | 41 | ISADevice *isa_create_simple(const char *name); |
87ecb68b | 42 | |
c227f099 | 43 | extern target_phys_addr_t isa_mem_base; |
87ecb68b | 44 | |
af956cad | 45 | void isa_mmio_setup(MemoryRegion *mr, target_phys_addr_t size); |
968d683c | 46 | void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size); |
87ecb68b PB |
47 | |
48 | /* dma.c */ | |
49 | int DMA_get_channel_mode (int nchan); | |
50 | int DMA_read_memory (int nchan, void *buf, int pos, int size); | |
51 | int DMA_write_memory (int nchan, void *buf, int pos, int size); | |
52 | void DMA_hold_DREQ (int nchan); | |
53 | void DMA_release_DREQ (int nchan); | |
54 | void DMA_schedule(int nchan); | |
4556bd8b | 55 | void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit); |
87ecb68b PB |
56 | void DMA_register_channel (int nchan, |
57 | DMA_transfer_handler transfer_handler, | |
58 | void *opaque); | |
79383c9c | 59 | #endif |