2
0

i8257.h 957 B

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