diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-10-12 09:33:51 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-10-12 10:28:32 +0200 |
commit | 839d934c79aee95a7d67d2f8dceacbfd0e5ea848 (patch) | |
tree | 07983024016ad25ae42895b03455fc7959d565a4 /include | |
parent | e563d9723963d4468bd6a60f603d827941c7ff77 (diff) | |
download | barebox-839d934c79aee95a7d67d2f8dceacbfd0e5ea848.tar.gz barebox-839d934c79aee95a7d67d2f8dceacbfd0e5ea848.tar.xz |
cdev: Add function to get unallocated space at start of device
On several SoCs barebox is written to the raw device in front of the
first partition. So far we blindly trust that there is enough space
available for the barebox image. Start changing this by adding a
function that retrieves the available space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20211012073352.4071559-8-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/driver.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/driver.h b/include/driver.h index c7f5903fce..4f6d40e17c 100644 --- a/include/driver.h +++ b/include/driver.h @@ -494,6 +494,7 @@ ssize_t cdev_read(struct cdev *cdev, void *buf, size_t count, loff_t offset, ulo ssize_t cdev_write(struct cdev *cdev, const void *buf, size_t count, loff_t offset, ulong flags); int cdev_ioctl(struct cdev *cdev, int cmd, void *buf); int cdev_erase(struct cdev *cdev, loff_t count, loff_t offset); +loff_t cdev_unallocated_space(struct cdev *cdev); #define DEVFS_PARTITION_FIXED (1U << 0) #define DEVFS_PARTITION_READONLY (1U << 1) |