blob: d6d32f9b74ae19d50a3ad62756a660a76c64ff98 [file] [log] [blame]
Haojian Zhuang12ade162016-03-18 15:14:19 +08001/*
2 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
3 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Haojian Zhuang12ade162016-03-18 15:14:19 +08005 */
6
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +00007#ifndef IO_BLOCK_H
8#define IO_BLOCK_H
Haojian Zhuang12ade162016-03-18 15:14:19 +08009
10#include <io_storage.h>
11
12/* block devices ops */
13typedef 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
18typedef 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
24struct io_dev_connector;
25
26int register_io_dev_block(const struct io_dev_connector **dev_con);
27
Antonio Nino Diaz5eb88372018-11-08 10:20:19 +000028#endif /* IO_BLOCK_H */