diff options
Diffstat (limited to 'lib/efi_loader')
-rw-r--r-- | lib/efi_loader/efi_bootmgr.c | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_boottime.c | 2 | ||||
-rw-r--r-- | lib/efi_loader/efi_device_path.c | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_firmware.c | 1 | ||||
-rw-r--r-- | lib/efi_loader/efi_memory.c | 22 | ||||
-rw-r--r-- | lib/efi_loader/efi_net.c | 1 |
6 files changed, 17 insertions, 11 deletions
diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c index 1a3461f5a9d..b9437a81c64 100644 --- a/lib/efi_loader/efi_bootmgr.c +++ b/lib/efi_loader/efi_bootmgr.c @@ -13,6 +13,7 @@ #include <dm.h> #include <efi.h> #include <efi_device_path.h> +#include <env.h> #include <log.h> #include <malloc.h> #include <net.h> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 24b0e52a2a2..754bc6a6519 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -58,7 +58,7 @@ static efi_handle_t current_image; * restriction so we need to manually swap its and our view of that register on * EFI callback entry/exit. */ -static volatile gd_t *efi_gd, *app_gd; +static gd_t *efi_gd, *app_gd; #endif efi_status_t efi_uninstall_protocol diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c index 7316a76f462..b3fb20b2501 100644 --- a/lib/efi_loader/efi_device_path.c +++ b/lib/efi_loader/efi_device_path.c @@ -11,6 +11,7 @@ #include <dm.h> #include <dm/root.h> #include <efi_device_path.h> +#include <ide.h> #include <log.h> #include <net.h> #include <usb.h> diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index d44dc09813e..75501e21557 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib/efi_loader/efi_firmware.c @@ -12,6 +12,7 @@ #include <dfu.h> #include <efi_loader.h> #include <efi_variable.h> +#include <env.h> #include <fwu.h> #include <image.h> #include <signatures.h> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c index 0abb1f6159a..0828a47da61 100644 --- a/lib/efi_loader/efi_memory.c +++ b/lib/efi_loader/efi_memory.c @@ -454,6 +454,7 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type, enum efi_memory_type memory_type, efi_uintn_t pages, uint64_t *memory) { + int err; u64 efi_addr, len; uint flags; efi_status_t ret; @@ -475,17 +476,18 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type, switch (type) { case EFI_ALLOCATE_ANY_PAGES: /* Any page */ - addr = (u64)lmb_alloc_base(len, EFI_PAGE_SIZE, - LMB_ALLOC_ANYWHERE, flags); - if (!addr) + err = lmb_alloc_mem(LMB_MEM_ALLOC_ANY, EFI_PAGE_SIZE, &addr, + len, flags); + if (err) return EFI_OUT_OF_RESOURCES; break; case EFI_ALLOCATE_MAX_ADDRESS: /* Max address */ addr = map_to_sysmem((void *)(uintptr_t)*memory); - addr = (u64)lmb_alloc_base(len, EFI_PAGE_SIZE, addr, - flags); - if (!addr) + + err = lmb_alloc_mem(LMB_MEM_ALLOC_MAX, EFI_PAGE_SIZE, &addr, + len, flags); + if (err) return EFI_OUT_OF_RESOURCES; break; case EFI_ALLOCATE_ADDRESS: @@ -493,7 +495,7 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type, return EFI_NOT_FOUND; addr = map_to_sysmem((void *)(uintptr_t)*memory); - if (lmb_alloc_addr(addr, len, flags)) + if (lmb_alloc_mem(LMB_MEM_ALLOC_ADDR, 0, &addr, len, flags)) return EFI_NOT_FOUND; break; default: @@ -506,7 +508,7 @@ efi_status_t efi_allocate_pages(enum efi_allocate_type type, ret = efi_update_memory_map(efi_addr, pages, memory_type, true, false); if (ret != EFI_SUCCESS) { /* Map would overlap, bail out */ - lmb_free_flags(addr, (u64)pages << EFI_PAGE_SHIFT, flags); + lmb_free(addr, (u64)pages << EFI_PAGE_SHIFT, flags); unmap_sysmem((void *)(uintptr_t)efi_addr); return EFI_OUT_OF_RESOURCES; } @@ -546,8 +548,8 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages) * been mapped with map_sysmem() from efi_allocate_pages(). Convert * it back to an address LMB understands */ - status = lmb_free_flags(map_to_sysmem((void *)(uintptr_t)memory), len, - LMB_NOOVERWRITE); + status = lmb_free(map_to_sysmem((void *)(uintptr_t)memory), len, + LMB_NOOVERWRITE); if (status) return EFI_NOT_FOUND; diff --git a/lib/efi_loader/efi_net.c b/lib/efi_loader/efi_net.c index 8e708d8d350..86f0af9538c 100644 --- a/lib/efi_loader/efi_net.c +++ b/lib/efi_loader/efi_net.c @@ -19,6 +19,7 @@ #include <efi_device_path.h> #include <efi_loader.h> +#include <env.h> #include <dm.h> #include <linux/sizes.h> #include <malloc.h> |