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

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

6
#include "ioport.h"
7 8 9 10 11 12 13 14
#include "qdev.h"

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

struct ISADevice {
    DeviceState qdev;
G
Gerd Hoffmann 已提交
15
    uint32_t isairq[2];
16 17 18
    int nirqs;
};

19
typedef int (*isa_qdev_initfn)(ISADevice *dev);
20 21 22 23 24 25
struct ISADeviceInfo {
    DeviceInfo qdev;
    isa_qdev_initfn init;
};

ISABus *isa_bus_new(DeviceState *dev);
G
Gerd Hoffmann 已提交
26
void isa_bus_irqs(qemu_irq *irqs);
J
Jes Sorensen 已提交
27
qemu_irq isa_reserve_irq(int isairq);
28
void isa_init_irq(ISADevice *dev, qemu_irq *p, int isairq);
29
void isa_qdev_register(ISADeviceInfo *info);
G
Gerd Hoffmann 已提交
30
ISADevice *isa_create(const char *name);
31
ISADevice *isa_create_simple(const char *name);
P
pbrook 已提交
32

A
Anthony Liguori 已提交
33
extern target_phys_addr_t isa_mem_base;
P
pbrook 已提交
34

A
Anthony Liguori 已提交
35
void isa_mmio_init(target_phys_addr_t base, target_phys_addr_t size);
P
pbrook 已提交
36 37 38 39 40 41 42 43 44 45 46 47

/* 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);
void DMA_init (int high_page_enable);
void DMA_register_channel (int nchan,
                           DMA_transfer_handler transfer_handler,
                           void *opaque);
48
#endif