Haojian Zhuang | 12ade16 | 2016-03-18 15:14:19 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Haojian Zhuang | 12ade16 | 2016-03-18 15:14:19 +0800 | [diff] [blame] | 5 | */ |
| 6 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 7 | #ifndef IO_BLOCK_H |
| 8 | #define IO_BLOCK_H |
Haojian Zhuang | 12ade16 | 2016-03-18 15:14:19 +0800 | [diff] [blame] | 9 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 10 | #include <drivers/io/io_storage.h> |
Haojian Zhuang | 12ade16 | 2016-03-18 15:14:19 +0800 | [diff] [blame] | 11 | |
| 12 | /* block devices ops */ |
| 13 | typedef struct io_block_ops { |
| 14 | size_t (*read)(int lba, uintptr_t buf, size_t size); |
| 15 | size_t (*write)(int lba, const uintptr_t buf, size_t size); |
| 16 | } io_block_ops_t; |
| 17 | |
| 18 | typedef struct io_block_dev_spec { |
| 19 | io_block_spec_t buffer; |
| 20 | io_block_ops_t ops; |
| 21 | size_t block_size; |
| 22 | } io_block_dev_spec_t; |
| 23 | |
| 24 | struct io_dev_connector; |
| 25 | |
| 26 | int register_io_dev_block(const struct io_dev_connector **dev_con); |
| 27 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 28 | #endif /* IO_BLOCK_H */ |