efi/libstub/x86: Avoid EFI map buffer alloc in allocate_e820()
[linux-2.6-microblaze.git] / drivers / firmware / efi / libstub / efistub.h
index 67d2694..6294399 100644 (file)
@@ -92,6 +92,19 @@ extern __pure efi_system_table_t  *efi_system_table(void);
 #define EFI_LOCATE_BY_REGISTER_NOTIFY          1
 #define EFI_LOCATE_BY_PROTOCOL                 2
 
+/*
+ * An efi_boot_memmap is used by efi_get_memory_map() to return the
+ * EFI memory map in a dynamically allocated buffer.
+ *
+ * The buffer allocated for the EFI memory map includes extra room for
+ * a minimum of EFI_MMAP_NR_SLACK_SLOTS additional EFI memory descriptors.
+ * This facilitates the reuse of the EFI memory map buffer when a second
+ * call to ExitBootServices() is needed because of intervening changes to
+ * the EFI memory map. Other related structures, e.g. x86 e820ext, need
+ * to factor in this headroom requirement as well.
+ */
+#define EFI_MMAP_NR_SLACK_SLOTS        8
+
 struct efi_boot_memmap {
        efi_memory_desc_t       **map;
        unsigned long           *map_size;