block: sandbox: Add support for SYS_64BIT_LBA

In order to use SYS_64BIT_LBA with this driver we need for "start" to
also be of type lbaint_t and to then use the correct printf format
characters.

Reviewed-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Signed-off-by: Tom Rini <trini@konsulko.com>
This commit is contained in:
Tom Rini 2025-07-04 15:46:12 -06:00
parent 7adb9b03a6
commit 53bd87651e

View File

@ -18,7 +18,7 @@
DECLARE_GLOBAL_DATA_PTR;
static unsigned long host_block_read(struct udevice *dev,
unsigned long start, lbaint_t blkcnt,
lbaint_t start, lbaint_t blkcnt,
void *buffer)
{
struct blk_desc *desc = dev_get_uclass_plat(dev);
@ -26,7 +26,7 @@ static unsigned long host_block_read(struct udevice *dev,
struct host_sb_plat *plat = dev_get_plat(host_dev);
if (os_lseek(plat->fd, start * desc->blksz, OS_SEEK_SET) < 0) {
printf("ERROR: Invalid block %lx\n", start);
printf("ERROR: Invalid block " LBAF "\n", start);
return -1;
}
ssize_t len = os_read(plat->fd, buffer, blkcnt * desc->blksz);
@ -37,7 +37,7 @@ static unsigned long host_block_read(struct udevice *dev,
}
static unsigned long host_block_write(struct udevice *dev,
unsigned long start, lbaint_t blkcnt,
lbaint_t start, lbaint_t blkcnt,
const void *buffer)
{
struct blk_desc *desc = dev_get_uclass_plat(dev);
@ -45,7 +45,7 @@ static unsigned long host_block_write(struct udevice *dev,
struct host_sb_plat *plat = dev_get_plat(host_dev);
if (os_lseek(plat->fd, start * desc->blksz, OS_SEEK_SET) < 0) {
printf("ERROR: Invalid block %lx\n", start);
printf("ERROR: Invalid block " LBAF "\n", start);
return -1;
}
ssize_t len = os_write(plat->fd, buffer, blkcnt * desc->blksz);