summaryrefslogtreecommitdiffstats
path: root/lib/efi_loader/efi_boottime.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-03-24 01:37:37 +0100
committerTom Rini <trini@konsulko.com>2016-03-27 09:13:02 -0400
commit1cd29f0abd787eb881523452a77e12dab1cb32c5 (patch)
treea23d6d161fe43ba552d0e3880672b9f5299dfe38 /lib/efi_loader/efi_boottime.c
parentedc498c651d97e4b2cbd9a83a93a7f815a93e272 (diff)
downloadtalos-obmc-uboot-1cd29f0abd787eb881523452a77e12dab1cb32c5.tar.gz
talos-obmc-uboot-1cd29f0abd787eb881523452a77e12dab1cb32c5.zip
efi_loader: Fix some entry/exit points
When switching between EFI context and U-Boot context we need to swap the register that "gd" resides in. Some functions slipped through here, with efi_allocate_pool / efi_free_pool not doing the switch correctly and efi_return_handle switching too often. Fix them all up to make sure we always have consistent register state. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'lib/efi_loader/efi_boottime.c')
-rw-r--r--lib/efi_loader/efi_boottime.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 87400dee1a..9daca50a72 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -137,12 +137,20 @@ efi_status_t EFIAPI efi_get_memory_map_ext(unsigned long *memory_map_size,
static efi_status_t EFIAPI efi_allocate_pool(int pool_type, unsigned long size,
void **buffer)
{
- return efi_allocate_pages(0, pool_type, (size + 0xfff) >> 12, (void*)buffer);
+ efi_status_t r;
+
+ EFI_ENTRY("%d, %ld, %p", pool_type, size, buffer);
+ r = efi_allocate_pages(0, pool_type, (size + 0xfff) >> 12, (void*)buffer);
+ return EFI_EXIT(r);
}
static efi_status_t EFIAPI efi_free_pool(void *buffer)
{
- return efi_free_pages((ulong)buffer, 0);
+ efi_status_t r;
+
+ EFI_ENTRY("%p", buffer);
+ r = efi_free_pages((ulong)buffer, 0);
+ return EFI_EXIT(r);
}
/*
@@ -706,7 +714,6 @@ static efi_status_t EFIAPI efi_handle_protocol(void *handle,
efi_guid_t *protocol,
void **protocol_interface)
{
- EFI_ENTRY("%p, %p, %p", handle, protocol, protocol_interface);
return efi_open_protocol(handle, protocol, protocol_interface,
NULL, NULL, 0);
}
OpenPOWER on IntegriCloud