typedef enum {\r
KernelBlobTypeKernel,\r
KernelBlobTypeInitrd,\r
- KernelBlobTypeCommandLine,\r
KernelBlobTypeMax\r
} KERNEL_BLOB_TYPE;\r
\r
STATIC KERNEL_BLOB mKernelBlob[KernelBlobTypeMax] = {\r
{ QemuFwCfgItemKernelSize, QemuFwCfgItemKernelData, L"kernel" },\r
{ QemuFwCfgItemInitrdSize, QemuFwCfgItemInitrdData, L"initrd" },\r
- { QemuFwCfgItemCommandLineSize, QemuFwCfgItemCommandLineData, L"cmdline" }\r
};\r
\r
STATIC UINT64 mTotalBlobBytes;\r
//\r
// Read blob.\r
//\r
- Blob->Data = AllocatePool (Blob->Size);\r
+ Blob->Data = AllocatePages (EFI_SIZE_TO_PAGES ((UINTN)Blob->Size));\r
if (Blob->Data == NULL) {\r
DEBUG ((DEBUG_ERROR, "%a: failed to allocate %Ld bytes for \"%s\"\n",\r
__FUNCTION__, (INT64)Blob->Size, Blob->Name));\r
while (BlobType > 0) {\r
CurrentBlob = &mKernelBlob[--BlobType];\r
if (CurrentBlob->Data != NULL) {\r
- FreePool (CurrentBlob->Data);\r
+ FreePages (CurrentBlob->Data,\r
+ EFI_SIZE_TO_PAGES ((UINTN)CurrentBlob->Size));\r
CurrentBlob->Size = 0;\r
CurrentBlob->Data = NULL;\r
}\r