summaryrefslogtreecommitdiffstats
path: root/lib/efi_loader/efi_file.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2018-08-08 03:54:32 -0600
committerAlexander Graf <agraf@suse.de>2018-09-23 21:55:28 +0200
commitd5a5a5a7473359a86f925506213b832067995a48 (patch)
tree73680b7929c789596480cf89d0bd9a578c37066f /lib/efi_loader/efi_file.c
parent9dff49008919b235bf93d078c531f2779fff975e (diff)
downloadu-boot-d5a5a5a7473359a86f925506213b832067995a48.tar.gz
u-boot-d5a5a5a7473359a86f925506213b832067995a48.tar.xz
u-boot-d5a5a5a7473359a86f925506213b832067995a48.zip
efi_loader: Pass address to fs_read()
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>
Diffstat (limited to 'lib/efi_loader/efi_file.c')
-rw-r--r--lib/efi_loader/efi_file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_file.c b/lib/efi_loader/efi_file.c
index e6a15bcb52..2107730ba5 100644
--- a/lib/efi_loader/efi_file.c
+++ b/lib/efi_loader/efi_file.c
@@ -9,6 +9,7 @@
#include <charset.h>
#include <efi_loader.h>
#include <malloc.h>
+#include <mapmem.h>
#include <fs.h>
/* GUID for file system information */
@@ -232,8 +233,10 @@ static efi_status_t file_read(struct file_handle *fh, u64 *buffer_size,
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;