io_block.h 634 Bytes
Newer Older
Haojian Zhuang's avatar
Haojian Zhuang committed
1
2
3
/*
 * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved.
 *
dp-arm's avatar
dp-arm committed
4
 * SPDX-License-Identifier: BSD-3-Clause
Haojian Zhuang's avatar
Haojian Zhuang committed
5
6
 */

7
8
#ifndef IO_BLOCK_H
#define IO_BLOCK_H
Haojian Zhuang's avatar
Haojian Zhuang committed
9

10
#include <drivers/io/io_storage.h>
Haojian Zhuang's avatar
Haojian Zhuang committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27

/* 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);

28
#endif /* IO_BLOCK_H */