isa.h 1.6 KB
Newer Older
1 2
#ifndef HW_ISA_H
#define HW_ISA_H
3

P
pbrook 已提交
4 5
/* ISA bus */

6
#include "ioport.h"
A
Avi Kivity 已提交
7
#include "memory.h"
8 9 10 11 12 13 14 15
#include "qdev.h"

typedef struct ISABus ISABus;
typedef struct ISADevice ISADevice;
typedef struct ISADeviceInfo ISADeviceInfo;

struct ISADevice {
    DeviceState qdev;
G
Gerd Hoffmann 已提交
16
    uint32_t isairq[2];
17
    int nirqs;
18 19
    uint16_t ioports[32];
    int nioports;
20 21
};

22
typedef int (*isa_qdev_initfn)(ISADevice *dev);
23 24 25 26 27 28
struct ISADeviceInfo {
    DeviceInfo qdev;
    isa_qdev_initfn init;
};

ISABus *isa_bus_new(DeviceState *dev);
G
Gerd Hoffmann 已提交
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 33
void isa_init_ioport(ISADevice *dev, uint16_t ioport);
void isa_init_ioport_range(ISADevice *dev, uint16_t start, uint16_t length);
34
void isa_qdev_register(ISADeviceInfo *info);
A
Avi Kivity 已提交
35
MemoryRegion *isa_address_space(ISADevice *dev);
G
Gerd Hoffmann 已提交
36
ISADevice *isa_create(const char *name);
37
ISADevice *isa_try_create(const char *name);
38
ISADevice *isa_create_simple(const char *name);
P
pbrook 已提交
39

A
Anthony Liguori 已提交
40
extern target_phys_addr_t isa_mem_base;
P
pbrook 已提交
41

A
Avi Kivity 已提交
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);
P
pbrook 已提交
44 45 46 47 48 49 50 51

/* dma.c */
int DMA_get_channel_mode (int nchan);
int DMA_read_memory (int nchan, void *buf, int pos, int size);
int DMA_write_memory (int nchan, void *buf, int pos, int size);
void DMA_hold_DREQ (int nchan);
void DMA_release_DREQ (int nchan);
void DMA_schedule(int nchan);
B
Blue Swirl 已提交
52
void DMA_init(int high_page_enable, qemu_irq *cpu_request_exit);
P
pbrook 已提交
53 54 55
void DMA_register_channel (int nchan,
                           DMA_transfer_handler transfer_handler,
                           void *opaque);
56
#endif