io_block.h 634 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef IO_BLOCK_H
  7. #define IO_BLOCK_H
  8. #include <drivers/io/io_storage.h>
  9. /* block devices ops */
  10. typedef struct io_block_ops {
  11. size_t (*read)(int lba, uintptr_t buf, size_t size);
  12. size_t (*write)(int lba, const uintptr_t buf, size_t size);
  13. } io_block_ops_t;
  14. typedef struct io_block_dev_spec {
  15. io_block_spec_t buffer;
  16. io_block_ops_t ops;
  17. size_t block_size;
  18. } io_block_dev_spec_t;
  19. struct io_dev_connector;
  20. int register_io_dev_block(const struct io_dev_connector **dev_con);
  21. #endif /* IO_BLOCK_H */