10 #define ISA_NUM_IRQS 16
12 typedef struct ISADevice ISADevice
;
14 #define TYPE_ISA_DEVICE "isa-device"
15 #define ISA_DEVICE(obj) \
16 OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE)
17 #define ISA_DEVICE_CLASS(klass) \
18 OBJECT_CLASS_CHECK(ISADeviceClass, (klass), TYPE_ISA_DEVICE)
19 #define ISA_DEVICE_GET_CLASS(obj) \
20 OBJECT_GET_CLASS(ISADeviceClass, (obj), TYPE_ISA_DEVICE)
22 typedef struct ISADeviceClass
{
23 DeviceClass parent_class
;
24 int (*init
)(ISADevice
*dev
);
29 MemoryRegion
*address_space_io
;
40 ISABus
*isa_bus_new(DeviceState
*dev
, MemoryRegion
*address_space_io
);
41 void isa_bus_irqs(ISABus
*bus
, qemu_irq
*irqs
);
42 qemu_irq
isa_get_irq(ISADevice
*dev
, int isairq
);
43 void isa_init_irq(ISADevice
*dev
, qemu_irq
*p
, int isairq
);
44 MemoryRegion
*isa_address_space(ISADevice
*dev
);
45 ISADevice
*isa_create(ISABus
*bus
, const char *name
);
46 ISADevice
*isa_try_create(ISABus
*bus
, const char *name
);
47 ISADevice
*isa_create_simple(ISABus
*bus
, const char *name
);
50 * isa_register_ioport: Install an I/O port region on the ISA bus.
52 * Register an I/O port region via memory_region_add_subregion
53 * inside the ISA I/O address space.
55 * @dev: the ISADevice against which these are registered; may be NULL.
56 * @io: the #MemoryRegion being registered.
57 * @start: the base I/O port.
59 void isa_register_ioport(ISADevice
*dev
, MemoryRegion
*io
, uint16_t start
);
62 * isa_register_portio_list: Initialize a set of ISA io ports
64 * Several ISA devices have many dis-joint I/O ports. Worse, these I/O
65 * ports can be interleaved with I/O ports from other devices. This
66 * function makes it easy to create multiple MemoryRegions for a single
67 * device and use the legacy portio routines.
69 * @dev: the ISADevice against which these are registered; may be NULL.
70 * @start: the base I/O port against which the portio->offset is applied.
71 * @portio: the ports, sorted by offset.
72 * @opaque: passed into the old_portio callbacks.
73 * @name: passed into memory_region_init_io.
75 void isa_register_portio_list(ISADevice
*dev
, uint16_t start
,
76 const MemoryRegionPortio
*portio
,
77 void *opaque
, const char *name
);
79 extern target_phys_addr_t isa_mem_base
;
81 void isa_mmio_setup(MemoryRegion
*mr
, target_phys_addr_t size
);
82 void isa_mmio_init(target_phys_addr_t base
, target_phys_addr_t size
);
85 int DMA_get_channel_mode (int nchan
);
86 int DMA_read_memory (int nchan
, void *buf
, int pos
, int size
);
87 int DMA_write_memory (int nchan
, void *buf
, int pos
, int size
);
88 void DMA_hold_DREQ (int nchan
);
89 void DMA_release_DREQ (int nchan
);
90 void DMA_schedule(int nchan
);
91 void DMA_init(int high_page_enable
, qemu_irq
*cpu_request_exit
);
92 void DMA_register_channel (int nchan
,
93 DMA_transfer_handler transfer_handler
,