The UEFI specification prescribes that AllocatePages() checks the memory
type.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* part of the processor.
*/
EFI_PAL_CODE,
+ /*
+ * Non-volatile memory.
+ */
+ EFI_PERSISTENT_MEMORY_TYPE,
EFI_MAX_MEMORY_TYPE,
EFI_TABLE_END, /* For efi_build_mem_table() */
efi_status_t r = EFI_SUCCESS;
uint64_t addr;
+ /* Check import parameters */
+ if (memory_type >= EFI_PERSISTENT_MEMORY_TYPE &&
+ memory_type <= 0x6FFFFFFF)
+ return EFI_INVALID_PARAMETER;
if (!memory)
return EFI_INVALID_PARAMETER;