6 #include "exec/ioport.h"
7 #include "exec/memory.h"
10 #define ISA_NUM_IRQS 16
12 #define TYPE_ISA_DEVICE "isa-device"
13 #define ISA_DEVICE(obj) \
14 OBJECT_CHECK(ISADevice, (obj), TYPE_ISA_DEVICE)
15 #define ISA_DEVICE_CLASS(klass) \
16 OBJECT_CLASS_CHECK(ISADeviceClass, (klass), TYPE_ISA_DEVICE)
17 #define ISA_DEVICE_GET_CLASS(obj) \
18 OBJECT_GET_CLASS(ISADeviceClass, (obj), TYPE_ISA_DEVICE)
20 #define TYPE_ISA_BUS "ISA"
21 #define ISA_BUS(obj) OBJECT_CHECK(ISABus, (obj), TYPE_ISA_BUS)
23 typedef struct ISADeviceClass
{
24 DeviceClass parent_class
;
32 MemoryRegion
*address_space_io
;
38 DeviceState parent_obj
;
46 ISABus
*isa_bus_new(DeviceState
*dev
, MemoryRegion
*address_space_io
);
47 void isa_bus_irqs(ISABus
*bus
, qemu_irq
*irqs
);
48 qemu_irq
isa_get_irq(ISADevice
*dev
, int isairq
);
49 void isa_init_irq(ISADevice
*dev
, qemu_irq
*p
, int isairq
);
50 MemoryRegion
*isa_address_space(ISADevice
*dev
);
51 MemoryRegion
*isa_address_space_io(ISADevice
*dev
);
52 ISADevice
*isa_create(ISABus
*bus
, const char *name
);
53 ISADevice
*isa_try_create(ISABus
*bus
, const char *name
);
54 ISADevice
*isa_create_simple(ISABus
*bus
, const char *name
);
56 ISADevice
*isa_vga_init(ISABus
*bus
);
59 * isa_register_ioport: Install an I/O port region on the ISA bus.
61 * Register an I/O port region via memory_region_add_subregion
62 * inside the ISA I/O address space.
64 * @dev: the ISADevice against which these are registered; may be NULL.
65 * @io: the #MemoryRegion being registered.
66 * @start: the base I/O port.
68 void isa_register_ioport(ISADevice
*dev
, MemoryRegion
*io
, uint16_t start
);
71 * isa_register_portio_list: Initialize a set of ISA io ports
73 * Several ISA devices have many dis-joint I/O ports. Worse, these I/O
74 * ports can be interleaved with I/O ports from other devices. This
75 * function makes it easy to create multiple MemoryRegions for a single
76 * device and use the legacy portio routines.
78 * @dev: the ISADevice against which these are registered; may be NULL.
79 * @start: the base I/O port against which the portio->offset is applied.
80 * @portio: the ports, sorted by offset.
81 * @opaque: passed into the old_portio callbacks.
82 * @name: passed into memory_region_init_io.
84 void isa_register_portio_list(ISADevice
*dev
, uint16_t start
,
85 const MemoryRegionPortio
*portio
,
86 void *opaque
, const char *name
);
88 static inline ISABus
*isa_bus_from_device(ISADevice
*d
)
90 return ISA_BUS(qdev_get_parent_bus(DEVICE(d
)));
93 extern hwaddr isa_mem_base
;
96 int DMA_get_channel_mode (int nchan
);
97 int DMA_read_memory (int nchan
, void *buf
, int pos
, int size
);
98 int DMA_write_memory (int nchan
, void *buf
, int pos
, int size
);
99 void DMA_hold_DREQ (int nchan
);
100 void DMA_release_DREQ (int nchan
);
101 void DMA_schedule(int nchan
);
102 void DMA_init(int high_page_enable
, qemu_irq
*cpu_request_exit
);
103 void DMA_register_channel (int nchan
,
104 DMA_transfer_handler transfer_handler
,