Merge tag 'qemu-macppc-20230206' of https://github.com/mcayland/qemu into staging
[qemu.git] / include / hw / dma / i8257.h
blobf652345d65a27d4b802af39ad74818c34f03e376
1 #ifndef HW_I8257_H
2 #define HW_I8257_H
4 #include "hw/isa/isa.h"
5 #include "exec/ioport.h"
6 #include "qom/object.h"
8 #define TYPE_I8257 "i8257"
9 OBJECT_DECLARE_SIMPLE_TYPE(I8257State, I8257)
11 typedef struct I8257Regs {
12 int now[2];
13 uint16_t base[2];
14 uint8_t mode;
15 uint8_t page;
16 uint8_t pageh;
17 uint8_t dack;
18 uint8_t eop;
19 IsaDmaTransferHandler transfer_handler;
20 void *opaque;
21 } I8257Regs;
23 struct I8257State {
24 /* <private> */
25 ISADevice parent_obj;
27 /* <public> */
28 int32_t base;
29 int32_t page_base;
30 int32_t pageh_base;
31 int32_t dshift;
33 uint8_t status;
34 uint8_t command;
35 uint8_t mask;
36 uint8_t flip_flop;
37 I8257Regs regs[4];
38 MemoryRegion channel_io;
39 MemoryRegion cont_io;
41 QEMUBH *dma_bh;
42 bool dma_bh_scheduled;
43 int running;
44 PortioList portio_page;
45 PortioList portio_pageh;
48 void i8257_dma_init(ISABus *bus, bool high_page_enable);
50 #endif