Implement BlEfiMemoryAllocatePages() and BlEfiMemoryFreePages() for manipulating memory pages
ステータスチェックはすべて成功しました
ci/woodpecker/push/build Pipeline was successful

このコミットが含まれているのは:
2022-10-30 22:24:21 +01:00
コミット f5e9bd11f1
2個のファイルの変更49行の追加0行の削除

ファイルの表示

@@ -162,6 +162,27 @@ BlDbgPrint(IN PUINT16 Format,
}
}
/**
* This routine allocates one or more 4KB pages.
*
* @param Size
* The number of contiguous 4KB pages to allocate.
*
* @param Memory
* The pointer to a physical address.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
EFI_STATUS
BlEfiMemoryAllocatePages(IN UINT64 Size,
OUT PEFI_PHYSICAL_ADDRESS Memory)
{
return EfiSystemTable->BootServices->AllocatePages(AllocateAnyPages, EfiRuntimeServicesData,
EFI_SIZE_TO_PAGES(Size), Memory);
}
/**
* This routine allocates a pool memory.
*
@@ -183,6 +204,26 @@ BlEfiMemoryAllocatePool(IN UINT_PTR Size,
return EfiSystemTable->BootServices->AllocatePool(EfiLoaderData, Size, Memory);
}
/**
* This routine frees memory pages.
*
* @param Size
* The number of contiguous 4 KB pages to free.
*
* @param Memory
* The base physical address of the pages to be freed.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
EFI_STATUS
BlEfiMemoryFreePages(IN UINT64 Size,
IN EFI_PHYSICAL_ADDRESS Memory)
{
return EfiSystemTable->BootServices->FreePages(Memory, Size);
}
/**
* Returns pool memory to the system.
*

ファイルの表示

@@ -58,10 +58,18 @@ EFI_STATUS
BlEfiGetSystemConfigurationTable(IN PEFI_GUID TableGuid,
OUT PVOID *Table);
EFI_STATUS
BlEfiMemoryAllocatePages(IN UINT64 Size,
OUT PEFI_PHYSICAL_ADDRESS Memory);
EFI_STATUS
BlEfiMemoryAllocatePool(IN UINT_PTR Size,
OUT PVOID *Memory);
EFI_STATUS
BlEfiMemoryFreePages(IN UINT64 Size,
IN EFI_PHYSICAL_ADDRESS Memory);
EFI_STATUS
BlEfiMemoryFreePool(IN PVOID Memory);