2016-03-18 07:14:19 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
|
|
|
|
*
|
2017-05-03 09:38:09 +01:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2016-03-18 07:14:19 +00:00
|
|
|
*/
|
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#ifndef IO_BLOCK_H
|
|
|
|
#define IO_BLOCK_H
|
2016-03-18 07:14:19 +00:00
|
|
|
|
2018-12-14 00:18:21 +00:00
|
|
|
#include <drivers/io/io_storage.h>
|
2016-03-18 07:14:19 +00:00
|
|
|
|
|
|
|
/* block devices ops */
|
|
|
|
typedef struct io_block_ops {
|
|
|
|
size_t (*read)(int lba, uintptr_t buf, size_t size);
|
|
|
|
size_t (*write)(int lba, const uintptr_t buf, size_t size);
|
|
|
|
} io_block_ops_t;
|
|
|
|
|
|
|
|
typedef struct io_block_dev_spec {
|
|
|
|
io_block_spec_t buffer;
|
|
|
|
io_block_ops_t ops;
|
|
|
|
size_t block_size;
|
|
|
|
} io_block_dev_spec_t;
|
|
|
|
|
|
|
|
struct io_dev_connector;
|
|
|
|
|
|
|
|
int register_io_dev_block(const struct io_dev_connector **dev_con);
|
|
|
|
|
2018-11-08 10:20:19 +00:00
|
|
|
#endif /* IO_BLOCK_H */
|