diff --git a/drivers/lpmemmap/lpmemmap.c b/drivers/lpmemmap/lpmemmap.c index ed23833..e9e6e9c 100644 --- a/drivers/lpmemmap/lpmemmap.c +++ b/drivers/lpmemmap/lpmemmap.c @@ -46,6 +46,7 @@ static EFI_MEMORY_DESCRIPTOR *efimemmap; #define E820_ACPI 3 #define E820_NVS 4 #define E820_UNUSABLE 5 +#define E820_VENDOR_RSVD 6 #define EFI_MAX_ADDRESS ((UINTN)~0) static EFI_STATUS e820_to_efi(unsigned int e820, UINT32 *efi) @@ -71,6 +72,10 @@ static EFI_STATUS e820_to_efi(unsigned int e820, UINT32 *efi) *efi = EfiUnusableMemory; return EFI_SUCCESS; + case E820_VENDOR_RSVD: + *efi = EfiLoaderCode; + return EFI_SUCCESS; + default: return EFI_NOT_FOUND; } @@ -400,7 +405,9 @@ static EFI_GET_MEMORY_MAP saved_memmap_bs; static EFI_STATUS lpmemmap_init(EFI_SYSTEM_TABLE *st) { EFI_STATUS ret; +#ifndef __CRASH_DUMP EFI_PHYSICAL_ADDRESS start, data, end; +#endif if (!st) return EFI_INVALID_PARAMETER; @@ -413,6 +420,7 @@ static EFI_STATUS lpmemmap_init(EFI_SYSTEM_TABLE *st) if (EFI_ERROR(ret)) return ret; +#ifndef __CRASH_DUMP start = ALIGN_DOWN((EFI_PHYSICAL_ADDRESS)(UINTN)_start, EFI_PAGE_SIZE); data = ALIGN_UP((EFI_PHYSICAL_ADDRESS)(UINTN)_heap, EFI_PAGE_SIZE); ret = insert_mem_descr(start, data, EfiLoaderCode); @@ -423,7 +431,7 @@ static EFI_STATUS lpmemmap_init(EFI_SYSTEM_TABLE *st) ret = insert_mem_descr(data, end, EfiLoaderData); if (EFI_ERROR(ret)) goto err; - +#endif saved_memmap_bs = st->BootServices->GetMemoryMap; st->BootServices->GetMemoryMap = get_memory_map; st->BootServices->AllocatePages = allocate_pages; @@ -432,9 +440,11 @@ static EFI_STATUS lpmemmap_init(EFI_SYSTEM_TABLE *st) return EFI_SUCCESS; +#ifndef __CRASH_DUMP err: free_efimemmap(); return ret; +#endif } static EFI_STATUS lpmemmap_exit(EFI_SYSTEM_TABLE *st)