From fb008dbe01f9d30bba4ff84f1825722644da40be Mon Sep 17 00:00:00 2001 From: Min M Xu Date: Wed, 22 Jun 2022 09:00:23 +0800 Subject: EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLib AllocateRuntimePages is used to allocate one or more 4KB pages of type EfiRuntimeServicesData. Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Abner Chang Cc: Daniel Schaefer Cc: Gerd Hoffmann Reviewed-by: Ard Biesheuvel Acked-by: Gerd Hoffmann Signed-off-by: Min Xu --- EmbeddedPkg/Include/Library/PrePiLib.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'EmbeddedPkg/Include') diff --git a/EmbeddedPkg/Include/Library/PrePiLib.h b/EmbeddedPkg/Include/Library/PrePiLib.h index 7b2cea2..3741b08 100644 --- a/EmbeddedPkg/Include/Library/PrePiLib.h +++ b/EmbeddedPkg/Include/Library/PrePiLib.h @@ -666,6 +666,25 @@ AllocatePages ( ); /** + Allocates one or more 4KB pages of type EfiRuntimeServicesData. + + Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the + allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL + is returned. If there is not enough memory remaining to satisfy the request, then NULL is + returned. + + @param Pages The number of 4 KB pages to allocate. + + @return A pointer to the allocated buffer or NULL if allocation fails. + +**/ +VOID * +EFIAPI +AllocateRuntimePages ( + IN UINTN Pages + ); + +/** Allocates a buffer of type EfiBootServicesData. Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a -- cgit v1.1