x86: efi: Update efi_get_next_mem_desc() to avoid needing a map
At present this function requires a pointer to struct efi_entry_memmap
but the only field used in there is the desc_size. We want to be able
to use it from the app, so update it to use desc_size directly.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/x86/cpu/efi/payload.c b/arch/x86/cpu/efi/payload.c
index 04ce188..b777856 100644
--- a/arch/x86/cpu/efi/payload.c
+++ b/arch/x86/cpu/efi/payload.c
@@ -51,7 +51,7 @@
end = (struct efi_mem_desc *)((ulong)map + size);
desc = map->desc;
- for (; desc < end; desc = efi_get_next_mem_desc(map, desc)) {
+ for (; desc < end; desc = efi_get_next_mem_desc(desc, map->desc_size)) {
if (desc->type != EFI_CONVENTIONAL_MEMORY ||
desc->physical_start >= 1ULL << 32)
continue;
@@ -89,7 +89,7 @@
end = (struct efi_mem_desc *)((ulong)map + size);
gd->ram_size = 0;
desc = map->desc;
- for (; desc < end; desc = efi_get_next_mem_desc(map, desc)) {
+ for (; desc < end; desc = efi_get_next_mem_desc(desc, map->desc_size)) {
if (desc->type < EFI_MMAP_IO)
gd->ram_size += desc->num_pages << EFI_PAGE_SHIFT;
}
@@ -114,7 +114,7 @@
desc = map->desc;
for (num_banks = 0;
desc < end && num_banks < CONFIG_NR_DRAM_BANKS;
- desc = efi_get_next_mem_desc(map, desc)) {
+ desc = efi_get_next_mem_desc(desc, map->desc_size)) {
/*
* We only use conventional memory and ignore
* anything less than 1MB.
@@ -197,7 +197,7 @@
end = (struct efi_mem_desc *)((ulong)map + size);
for (desc = map->desc; desc < end;
- desc = efi_get_next_mem_desc(map, desc)) {
+ desc = efi_get_next_mem_desc(desc, map->desc_size)) {
if (desc->num_pages == 0)
continue;