root / hw / isa.h @ 795928f6
History | View | Annotate | Download (2.7 kB)
1 | 79383c9c | blueswir1 | #ifndef HW_ISA_H
|
---|---|---|---|
2 | 79383c9c | blueswir1 | #define HW_ISA_H
|
3 | f915a115 | Gerd Hoffmann | |
4 | 87ecb68b | pbrook | /* ISA bus */
|
5 | 87ecb68b | pbrook | |
6 | 32993977 | Isaku Yamahata | #include "ioport.h" |
7 | af956cad | Avi Kivity | #include "memory.h" |
8 | f915a115 | Gerd Hoffmann | #include "qdev.h" |
9 | f915a115 | Gerd Hoffmann | |
10 | b881fbe9 | Jan Kiszka | #define ISA_NUM_IRQS 16 |
11 | b881fbe9 | Jan Kiszka | |
12 | f915a115 | Gerd Hoffmann | typedef struct ISABus ISABus; |
13 | f915a115 | Gerd Hoffmann | typedef struct ISADevice ISADevice; |
14 | f915a115 | Gerd Hoffmann | typedef struct ISADeviceInfo ISADeviceInfo; |
15 | f915a115 | Gerd Hoffmann | |
16 | f915a115 | Gerd Hoffmann | struct ISADevice {
|
17 | f915a115 | Gerd Hoffmann | DeviceState qdev; |
18 | 2091ba23 | Gerd Hoffmann | uint32_t isairq[2];
|
19 | 78e20593 | Richard Henderson | int nirqs;
|
20 | ebf47c24 | Richard Henderson | int ioport_id;
|
21 | f915a115 | Gerd Hoffmann | }; |
22 | f915a115 | Gerd Hoffmann | |
23 | 81a322d4 | Gerd Hoffmann | typedef int (*isa_qdev_initfn)(ISADevice *dev); |
24 | f915a115 | Gerd Hoffmann | struct ISADeviceInfo {
|
25 | f915a115 | Gerd Hoffmann | DeviceInfo qdev; |
26 | f915a115 | Gerd Hoffmann | isa_qdev_initfn init; |
27 | f915a115 | Gerd Hoffmann | }; |
28 | f915a115 | Gerd Hoffmann | |
29 | c2d0d012 | Richard Henderson | ISABus *isa_bus_new(DeviceState *dev, MemoryRegion *address_space_io); |
30 | 2091ba23 | Gerd Hoffmann | void isa_bus_irqs(qemu_irq *irqs);
|
31 | ee951a37 | Jan Kiszka | qemu_irq isa_get_irq(int isairq);
|
32 | 2e15e23b | Gerd Hoffmann | void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq); |
33 | f915a115 | Gerd Hoffmann | void isa_qdev_register(ISADeviceInfo *info);
|
34 | c839adec | Avi Kivity | MemoryRegion *isa_address_space(ISADevice *dev); |
35 | 924f6d72 | Gerd Hoffmann | ISADevice *isa_create(const char *name); |
36 | 86f4a9a5 | Blue Swirl | ISADevice *isa_try_create(const char *name); |
37 | 2e15e23b | Gerd Hoffmann | ISADevice *isa_create_simple(const char *name); |
38 | 87ecb68b | pbrook | |
39 | d7500734 | Avi Kivity | /**
|
40 | d7500734 | Avi Kivity | * isa_register_ioport: Install an I/O port region on the ISA bus.
|
41 | d7500734 | Avi Kivity | *
|
42 | d7500734 | Avi Kivity | * Register an I/O port region via memory_region_add_subregion
|
43 | d7500734 | Avi Kivity | * inside the ISA I/O address space.
|
44 | d7500734 | Avi Kivity | *
|
45 | d7500734 | Avi Kivity | * @dev: the ISADevice against which these are registered; may be NULL.
|
46 | d7500734 | Avi Kivity | * @io: the #MemoryRegion being registered.
|
47 | d7500734 | Avi Kivity | * @start: the base I/O port.
|
48 | d7500734 | Avi Kivity | */
|
49 | d7500734 | Avi Kivity | void isa_register_ioport(ISADevice *dev, MemoryRegion *io, uint16_t start);
|
50 | d7500734 | Avi Kivity | |
51 | d7500734 | Avi Kivity | /**
|
52 | d7500734 | Avi Kivity | * isa_register_portio_list: Initialize a set of ISA io ports
|
53 | d7500734 | Avi Kivity | *
|
54 | d7500734 | Avi Kivity | * Several ISA devices have many dis-joint I/O ports. Worse, these I/O
|
55 | d7500734 | Avi Kivity | * ports can be interleaved with I/O ports from other devices. This
|
56 | d7500734 | Avi Kivity | * function makes it easy to create multiple MemoryRegions for a single
|
57 | d7500734 | Avi Kivity | * device and use the legacy portio routines.
|
58 | d7500734 | Avi Kivity | *
|
59 | d7500734 | Avi Kivity | * @dev: the ISADevice against which these are registered; may be NULL.
|
60 | d7500734 | Avi Kivity | * @start: the base I/O port against which the portio->offset is applied.
|
61 | d7500734 | Avi Kivity | * @portio: the ports, sorted by offset.
|
62 | d7500734 | Avi Kivity | * @opaque: passed into the old_portio callbacks.
|
63 | d7500734 | Avi Kivity | * @name: passed into memory_region_init_io.
|
64 | d7500734 | Avi Kivity | */
|
65 | d7500734 | Avi Kivity | void isa_register_portio_list(ISADevice *dev, uint16_t start,
|
66 | d7500734 | Avi Kivity | const MemoryRegionPortio *portio,
|
67 | d7500734 | Avi Kivity | void *opaque, const char *name); |
68 | d7500734 | Avi Kivity | |
69 | c227f099 | Anthony Liguori | extern target_phys_addr_t isa_mem_base;
|
70 | 87ecb68b | pbrook | |
71 | af956cad | Avi Kivity | void isa_mmio_setup(MemoryRegion *mr, target_phys_addr_t size);
|
72 | 968d683c | Alexander Graf | void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size);
|
73 | 87ecb68b | pbrook | |
74 | 87ecb68b | pbrook | /* dma.c */
|
75 | 87ecb68b | pbrook | int DMA_get_channel_mode (int nchan); |
76 | 87ecb68b | pbrook | int DMA_read_memory (int nchan, void *buf, int pos, int size); |
77 | 87ecb68b | pbrook | int DMA_write_memory (int nchan, void *buf, int pos, int size); |
78 | 87ecb68b | pbrook | void DMA_hold_DREQ (int nchan); |
79 | 87ecb68b | pbrook | void DMA_release_DREQ (int nchan); |
80 | 87ecb68b | pbrook | void DMA_schedule(int nchan); |
81 | 4556bd8b | Blue Swirl | void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit); |
82 | 87ecb68b | pbrook | void DMA_register_channel (int nchan, |
83 | 87ecb68b | pbrook | DMA_transfer_handler transfer_handler, |
84 | 87ecb68b | pbrook | void *opaque);
|
85 | 79383c9c | blueswir1 | #endif |