Implement BlEfiMemoryAllocatePool() and BlEfiMemoryFreePool()
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
Rafal Kupiec 2022-08-21 17:05:05 +02:00
parent e61108d9b5
commit d369a5e163
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 45 additions and 0 deletions

View File

@ -155,6 +155,44 @@ BlDbgPrint(IN PUINT16 Format,
}
}
/**
* This routine allocates a pool memory.
*
* @param Size
* The number of bytes to allocate from the pool.
*
* @param Memory
* The pointer to a physical address.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
EFI_STATUS
BlEfiMemoryAllocatePool(IN UINT_PTR Size,
OUT PVOID *Memory)
{
/* Allocate pool */
return EfiSystemTable->BootServices->AllocatePool(EfiLoaderData, Size, Memory);
}
/**
* Returns pool memory to the system.
*
* @param Memory
* The pointer to the buffer to free.
*
* @return This routine returns a status code.
*
* @since XT 1.0
*/
EFI_STATUS
BlEfiMemoryFreePool(IN PVOID Memory)
{
/* Free pool */
return EfiSystemTable->BootServices->FreePool(Memory);
}
/**
* This routine formats the input string and prints it out to the stdout and serial console.
*

View File

@ -41,6 +41,13 @@ VOID
BlDbgPrint(IN PUINT16 Format,
IN ...);
EFI_STATUS
BlEfiMemoryAllocatePool(IN UINT_PTR Size,
OUT PVOID *Memory);
EFI_STATUS
BlEfiMemoryFreePool(IN PVOID Memory);
VOID
BlEfiPrint(IN PUINT16 Format,
IN ...);