block_device.h 676 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "../../common/glib.h"
  3. #include "stdint.h"
  4. struct block_device_operation
  5. {
  6. long (*open)();
  7. long (*close)();
  8. long (*ioctl)(long cmd, long arg);
  9. long (*transfer)(long cmd, ul LBA_start, ul count, uchar* buffer);
  10. };
  11. /**
  12. * @brief 块设备请求队列内的packet
  13. *
  14. */
  15. struct block_device_request_packet
  16. {
  17. uchar cmd;
  18. uint32_t LBA_start;
  19. uint32_t count;
  20. uchar *buffer;
  21. void (*end_handler)(ul num, ul arg);
  22. struct List list;
  23. };
  24. /**
  25. * @brief 块设备的请求队列
  26. *
  27. */
  28. struct block_device_request_queue
  29. {
  30. struct List queue_list;
  31. struct block_device_request_packet * entry;
  32. ul request_count;
  33. };