xref: /openbmc/qemu/include/hw/dma/i8257.h (revision 423edd9a)
1 #ifndef HW_I8257_H
2 #define HW_I8257_H
3 
4 #include "hw/isa/isa.h"
5 #include "exec/ioport.h"
6 
7 #define TYPE_I8257 "i8257"
8 
9 typedef struct I8257Regs {
10     int now[2];
11     uint16_t base[2];
12     uint8_t mode;
13     uint8_t page;
14     uint8_t pageh;
15     uint8_t dack;
16     uint8_t eop;
17     IsaDmaTransferHandler transfer_handler;
18     void *opaque;
19 } I8257Regs;
20 
21 typedef struct I8257State {
22     /* <private> */
23     ISADevice parent_obj;
24 
25     /* <public> */
26     int32_t base;
27     int32_t page_base;
28     int32_t pageh_base;
29     int32_t dshift;
30 
31     uint8_t status;
32     uint8_t command;
33     uint8_t mask;
34     uint8_t flip_flop;
35     I8257Regs regs[4];
36     MemoryRegion channel_io;
37     MemoryRegion cont_io;
38 
39     QEMUBH *dma_bh;
40     bool dma_bh_scheduled;
41     int running;
42     PortioList portio_page;
43     PortioList portio_pageh;
44 } I8257State;
45 
46 void i8257_dma_init(ISABus *bus, bool high_page_enable);
47 
48 #endif
49