The fs_read() function wants to get an address rather than the
pointer to a buffer.
So let's convert the passed buffer from pointer back a the address
to make efi_loader on sandbox happier.
Signed-off-by: Alexander Graf <agraf@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>
#include <charset.h>
#include <efi_loader.h>
#include <malloc.h>
+#include <mapmem.h>
#include <fs.h>
/* GUID for file system information */
void *buffer)
{
loff_t actread;
+ /* fs_read expects buffer address, not pointer */
+ uintptr_t buffer_addr = (uintptr_t)map_to_sysmem(buffer);
- if (fs_read(fh->path, (ulong)buffer, fh->offset,
+ if (fs_read(fh->path, buffer_addr, fh->offset,
*buffer_size, &actread))
return EFI_DEVICE_ERROR;