blob: 77256aaba97d3943242e666f9e09567ef48c36eb [file] [log] [blame]
Thomas Heijligen62268ee2023-11-27 15:10:41 +00001#ifndef BLOCKDEV_H
2#define BLOCKDEV_H
3
4/** devopen
5 * @param name Filename to be used as blockdevice
6 * @param reopen Unused, set NULL
7 * @return 1 on success, 0 on failure !CAUTION
8 */
9int devopen(const char *name, int *reopen);
10
11/** devclose
12 */
13void devclose(void);
14
15/** devread
16 * @param sector 512 byte sector of the block device
17 * @param byte_offset Offset in the block
18 * @param byte_len Buffer length
19 * @param buf Buffer
20 * @return 1 on sucess, 0 on failure !CAUTION
21 */
22int devread(unsigned long sector, unsigned long byte_offset,
23 unsigned long byte_len, void *buf);
24
25
26//void dev_set_partition(unsigned long start, unsigned long size);
27//void dev_get_partition(unsigned long *start, unsigned long *size);
28
29//int file_open(const char *filename);
30//int file_read(void *buf, unsigned long len);
31//unsigned long file_seek(unsigned long offset);
32//unsigned long file_size(void);
33//void file_set_size(unsigned long size);
34//void file_close(void);
35
36#endif /* BLOCKDEV_H */