blob: c99e8c7c6a1a84bf470861c6152d6b156e24acef [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
Antonio Nino Diaze0f90632018-12-14 00:18:21 +000010#include <drivers/io/io_storage.h>
Haojian Zhuang12ade162016-03-18 15:14:19 +080011
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 */