TianoCore EDK2 master
Loading...
Searching...
No Matches
Allocate.c
Go to the documentation of this file.
1
10#include <PiDxe.h>
13
29VOID *
30EFIAPI
32 IN EFI_MEMORY_TYPE MemoryType,
33 IN UINTN Pages
34 )
35{
36 EFI_STATUS Status;
38
39 if (Pages == 0) {
40 return NULL;
41 }
42
43 Status = gBS->AllocatePages (AllocateAnyPages, MemoryType, Pages, &Memory);
44 if (EFI_ERROR (Status)) {
45 return NULL;
46 }
47
48 return (VOID *)(UINTN)Memory;
49}
UINT64 UINTN
VOID *EFIAPI AllocatePeiAccessiblePages(IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages)
Definition: Allocate.c:31
#define NULL
Definition: Base.h:319
#define IN
Definition: Base.h:279
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
EFI_BOOT_SERVICES * gBS
EFI_MEMORY_TYPE
@ AllocateAnyPages
Definition: UefiSpec.h:33