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