summaryrefslogtreecommitdiff
path: root/include/pbl
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-08-05 10:21:37 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-08-08 14:45:05 +0200
commitf905cd88f916a638f4b7acefc687dab92135adb2 (patch)
tree745da007cdbe64733a5a922c108d9f7569a84d17 /include/pbl
parent47d6b05305e5b899c1e0fb7d0a8ecd3be2e6a07e (diff)
downloadbarebox-f905cd88f916a638f4b7acefc687dab92135adb2.tar.gz
pbl: factor out pbl_bio API into pbl/bio.h
We'll be adding more PBL driver interface definitions into include/pbl, so move the block I/O stuff there as well. No functional change. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220805082137.2202560-1-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/pbl')
-rw-r--r--include/pbl/bio.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/pbl/bio.h b/include/pbl/bio.h
new file mode 100644
index 0000000000..79e47451a0
--- /dev/null
+++ b/include/pbl/bio.h
@@ -0,0 +1,19 @@
+#ifndef __PBL_BIO_H__
+#define __PBL_BIO_H__
+
+#include <linux/types.h>
+
+struct pbl_bio {
+ void *priv;
+ int (*read)(struct pbl_bio *bio, off_t block_off, void *buf, unsigned nblocks);
+};
+
+static inline int pbl_bio_read(struct pbl_bio *bio, off_t block_off,
+ void *buf, unsigned nblocks)
+{
+ return bio->read(bio, block_off, buf, nblocks);
+}
+
+ssize_t pbl_fat_load(struct pbl_bio *, const char *filename, void *dest, size_t len);
+
+#endif /* __PBL_H__ */