]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: provide efi_mem_desc version
authorMian Yousaf Kaukab <yousaf.kaukab@gmail.com>
Mon, 5 Sep 2016 21:59:22 +0000 (23:59 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 7 Sep 2016 12:49:07 +0000 (08:49 -0400)
Provide version of struct efi_mem_desc in efi_get_memory_map().

EFI_BOOT_SERVICES.GetMemoryMap() in UEFI specification v2.6 defines
memory descriptor version to 1. Linux kernel also expects descriptor
version to be 1 and prints following warning during boot if its not:

Unexpected EFI_MEMORY_DESCRIPTOR version 0

Signed-off-by: Mian Yousaf Kaukab <yousaf.kaukab@gmail.com>
include/efi.h
lib/efi_loader/efi_memory.c

index 83de2d479e9a98b003c83039acbe8bb6c6d95d54..5a3b8cf69ac101b87b53bcb23d67b79b4b3584d4 100644 (file)
@@ -159,6 +159,8 @@ struct efi_mem_desc {
        u64 attribute;
 };
 
+#define EFI_MEMORY_DESCRIPTOR_VERSION 1
+
 /* Allocation types for calls to boottime->allocate_pages*/
 #define EFI_ALLOCATE_ANY_PAGES         0
 #define EFI_ALLOCATE_MAX_ADDRESS       1
index df3547c47f7e83498068b3c1b0d4d713a7da53b3..80e4e26e05ea266f182d545eb6491a4d9f7810d5 100644 (file)
@@ -339,6 +339,9 @@ efi_status_t efi_get_memory_map(unsigned long *memory_map_size,
        if (descriptor_size)
                *descriptor_size = sizeof(struct efi_mem_desc);
 
+       if (descriptor_version)
+               *descriptor_version = EFI_MEMORY_DESCRIPTOR_VERSION;
+
        if (*memory_map_size < map_size)
                return EFI_BUFFER_TOO_SMALL;