diff options
author | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-06 16:07:54 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-07-06 16:07:54 +0000 |
commit | a6caee65ac3bba2ac649f20bf1c63f0a87050f17 (patch) | |
tree | 7a0a4cdaad7bf2c1f140621b6bc876e738c12893 /EmbeddedPkg | |
parent | 70aa21d5d6a91877d26d71ec5c6b7956825d7245 (diff) | |
download | edk2-platforms-a6caee65ac3bba2ac649f20bf1c63f0a87050f17.tar.xz |
ArmPlatformPkg: Remove PcdStandalone from Sec module and Introduce ArmPlatformSecExtraAction()
The PcdStandalone is a PCD ARM Ltd uses to make the difference between a standalone UEFI (boot
from cold boot to Boot Manager without user intervention) and a Debug UEFI firmware (the firmware
engineer has to copy the Normale World image into the DRAM to enable his/her firmware).
By coping the firmware into DRAM in the non standalone version it is much faster than reflashing
the NOR Flash after each build.
ArmPlatformSecExtraAction() function is called just before the Sec module jump to normal world.
The platform firmware can run extra actions at this stage.
The 'ARM Standalone' concept has moved to the implementation of ArmPlatformSecExtraAction() for
the ARM development boards (in ArmPlatformPkg/Library/DebugSecExtraActionLib).
ArmPlatformPkg: Enable DebugAgentLib in Sec and PrePeiCore
ArmPlatformPkg: Fix line endings in some source files
Use CR+LF line endings as defined by the EDK2 coding convention
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11991 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/Ebl/Variable.c | 244 | ||||
-rw-r--r-- | EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c | 384 |
2 files changed, 314 insertions, 314 deletions
diff --git a/EmbeddedPkg/Ebl/Variable.c b/EmbeddedPkg/Ebl/Variable.c index 3fd688bee1..5c00122cdb 100644 --- a/EmbeddedPkg/Ebl/Variable.c +++ b/EmbeddedPkg/Ebl/Variable.c @@ -1,20 +1,20 @@ -/** @file -* -* Copyright (c) 2011, ARM Limited. All rights reserved. -* -* This program and the accompanying materials -* are licensed and made available under the terms and conditions of the BSD License -* which accompanies this distribution. The full text of the license may be found at -* http://opensource.org/licenses/bsd-license.php -* -* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. -* -**/ +/** @file
+*
+* Copyright (c) 2011, ARM Limited. All rights reserved.
+*
+* This program and the accompanying materials
+* are licensed and made available under the terms and conditions of the BSD License
+* which accompanies this distribution. The full text of the license may be found at
+* http://opensource.org/licenses/bsd-license.php
+*
+* THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+* WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+*
+**/
#include "Ebl.h"
- -#include <Guid/GlobalVariable.h> +
+#include <Guid/GlobalVariable.h>
EFI_STATUS
EblGetCmd (
@@ -23,55 +23,55 @@ EblGetCmd ( )
{
EFI_STATUS Status = EFI_INVALID_PARAMETER;
- UINTN Size; - VOID* Value; - CHAR8* AsciiVariableName = NULL; - CHAR16* VariableName; - UINT32 Index; - - if (Argc == 1) { - AsciiPrint("Variable name is missing.\n"); - return Status; - } - - for (Index = 1; Index < Argc; Index++) { - if (Argv[Index][0] == '-') { - AsciiPrint("Warning: '%a' not recognized.\n",Argv[Index]); - } else { - AsciiVariableName = Argv[Index]; - } - } - - if (AsciiVariableName == NULL) { - AsciiPrint("Variable name is missing.\n"); - return Status; - } else { - VariableName = AllocatePool((AsciiStrLen (AsciiVariableName) + 1) * sizeof (CHAR16)); - AsciiStrToUnicodeStr (AsciiVariableName,VariableName); - } - - // Try to get the variable size. - Value = NULL; - Size = 0; - Status = gRT->GetVariable (VariableName, &gEfiGlobalVariableGuid, NULL, &Size, Value); - if (Status == EFI_NOT_FOUND) { - AsciiPrint("Variable name '%s' not found.\n",VariableName); - } else if (Status == EFI_BUFFER_TOO_SMALL) { - // Get the environment variable value - Value = AllocatePool (Size); - if (Value == NULL) { - return EFI_OUT_OF_RESOURCES; - } - - Status = gRT->GetVariable ((CHAR16 *)VariableName, &gEfiGlobalVariableGuid, NULL, &Size, Value); - if (EFI_ERROR (Status)) { - AsciiPrint("Error: '%r'\n",Status); - } else { - AsciiPrint("%a=%a\n",AsciiVariableName,Value); - } - FreePool(Value); - } else { - AsciiPrint("Error: '%r'\n",Status); + UINTN Size;
+ VOID* Value;
+ CHAR8* AsciiVariableName = NULL;
+ CHAR16* VariableName;
+ UINT32 Index;
+
+ if (Argc == 1) {
+ AsciiPrint("Variable name is missing.\n");
+ return Status;
+ }
+
+ for (Index = 1; Index < Argc; Index++) {
+ if (Argv[Index][0] == '-') {
+ AsciiPrint("Warning: '%a' not recognized.\n",Argv[Index]);
+ } else {
+ AsciiVariableName = Argv[Index];
+ }
+ }
+
+ if (AsciiVariableName == NULL) {
+ AsciiPrint("Variable name is missing.\n");
+ return Status;
+ } else {
+ VariableName = AllocatePool((AsciiStrLen (AsciiVariableName) + 1) * sizeof (CHAR16));
+ AsciiStrToUnicodeStr (AsciiVariableName,VariableName);
+ }
+
+ // Try to get the variable size.
+ Value = NULL;
+ Size = 0;
+ Status = gRT->GetVariable (VariableName, &gEfiGlobalVariableGuid, NULL, &Size, Value);
+ if (Status == EFI_NOT_FOUND) {
+ AsciiPrint("Variable name '%s' not found.\n",VariableName);
+ } else if (Status == EFI_BUFFER_TOO_SMALL) {
+ // Get the environment variable value
+ Value = AllocatePool (Size);
+ if (Value == NULL) {
+ return EFI_OUT_OF_RESOURCES;
+ }
+
+ Status = gRT->GetVariable ((CHAR16 *)VariableName, &gEfiGlobalVariableGuid, NULL, &Size, Value);
+ if (EFI_ERROR (Status)) {
+ AsciiPrint("Error: '%r'\n",Status);
+ } else {
+ AsciiPrint("%a=%a\n",AsciiVariableName,Value);
+ }
+ FreePool(Value);
+ } else {
+ AsciiPrint("Error: '%r'\n",Status);
}
FreePool(VariableName);
@@ -85,60 +85,60 @@ EblSetCmd ( )
{
EFI_STATUS Status = EFI_INVALID_PARAMETER;
- CHAR8* AsciiVariableSetting = NULL; - CHAR8* AsciiVariableName; - CHAR8* AsciiValue; - UINT32 AsciiValueLength; - CHAR16* VariableName; + CHAR8* AsciiVariableSetting = NULL;
+ CHAR8* AsciiVariableName;
+ CHAR8* AsciiValue;
+ UINT32 AsciiValueLength;
+ CHAR16* VariableName;
UINT32 Index;
UINT32 EscapedQuotes = 0;
BOOLEAN Volatile = FALSE;
- if (Argc == 1) { - AsciiPrint("Variable name is missing.\n"); - return Status; - } - - for (Index = 1; Index < Argc; Index++) { - if (AsciiStrCmp(Argv[Index],"-v") == 0) { - Volatile = 0; - } else if (Argv[Index][0] == '-') { - AsciiPrint("Warning: '%a' not recognized.\n",Argv[Index]); - } else { - AsciiVariableSetting = Argv[Index]; - } - } - - if (AsciiVariableSetting == NULL) { - AsciiPrint("Variable name is missing.\n"); - return Status; - } - - // Check if it is a valid variable setting + if (Argc == 1) {
+ AsciiPrint("Variable name is missing.\n");
+ return Status;
+ }
+
+ for (Index = 1; Index < Argc; Index++) {
+ if (AsciiStrCmp(Argv[Index],"-v") == 0) {
+ Volatile = 0;
+ } else if (Argv[Index][0] == '-') {
+ AsciiPrint("Warning: '%a' not recognized.\n",Argv[Index]);
+ } else {
+ AsciiVariableSetting = Argv[Index];
+ }
+ }
+
+ if (AsciiVariableSetting == NULL) {
+ AsciiPrint("Variable name is missing.\n");
+ return Status;
+ }
+
+ // Check if it is a valid variable setting
AsciiValue = AsciiStrStr (AsciiVariableSetting,"=");
- if (AsciiValue == NULL) { - // - // There is no value. It means this variable will be deleted - // - - // Convert VariableName into Unicode - VariableName = AllocatePool((AsciiStrLen (AsciiVariableSetting) + 1) * sizeof (CHAR16)); - AsciiStrToUnicodeStr (AsciiVariableSetting,VariableName); - - Status = gRT->SetVariable ( - VariableName, - &gEfiGlobalVariableGuid, - ( !Volatile ? EFI_VARIABLE_NON_VOLATILE : 0) | - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, - 0, - NULL - ); - if (!EFI_ERROR(Status)) { - AsciiPrint("Variable '%s' deleted\n",VariableName); - } else { - AsciiPrint("Variable setting is incorrect. It should be VariableName=Value\n"); - } - return Status; + if (AsciiValue == NULL) {
+ //
+ // There is no value. It means this variable will be deleted
+ //
+
+ // Convert VariableName into Unicode
+ VariableName = AllocatePool((AsciiStrLen (AsciiVariableSetting) + 1) * sizeof (CHAR16));
+ AsciiStrToUnicodeStr (AsciiVariableSetting,VariableName);
+
+ Status = gRT->SetVariable (
+ VariableName,
+ &gEfiGlobalVariableGuid,
+ ( !Volatile ? EFI_VARIABLE_NON_VOLATILE : 0) |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ 0,
+ NULL
+ );
+ if (!EFI_ERROR(Status)) {
+ AsciiPrint("Variable '%s' deleted\n",VariableName);
+ } else {
+ AsciiPrint("Variable setting is incorrect. It should be VariableName=Value\n");
+ }
+ return Status;
}
AsciiValue[0] = '\0';
@@ -167,20 +167,20 @@ EblSetCmd ( }
// Convert VariableName into Unicode
- VariableName = AllocatePool((AsciiStrLen (AsciiVariableName) + 1) * sizeof (CHAR16)); + VariableName = AllocatePool((AsciiStrLen (AsciiVariableName) + 1) * sizeof (CHAR16));
AsciiStrToUnicodeStr (AsciiVariableName,VariableName);
- Status = gRT->SetVariable ( - VariableName, - &gEfiGlobalVariableGuid, - ( !Volatile ? EFI_VARIABLE_NON_VOLATILE : 0) | - EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS, - AsciiStrLen (AsciiValue)+1, - AsciiValue + Status = gRT->SetVariable (
+ VariableName,
+ &gEfiGlobalVariableGuid,
+ ( !Volatile ? EFI_VARIABLE_NON_VOLATILE : 0) |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,
+ AsciiStrLen (AsciiValue)+1,
+ AsciiValue
);
if (!EFI_ERROR(Status)) {
AsciiPrint("'%a'='%a'\n",AsciiVariableName,AsciiValue);
- } + }
return Status;
}
diff --git a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c index 7cfc28e1e7..85a32b7362 100644 --- a/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c +++ b/EmbeddedPkg/Library/PrePiMemoryAllocationLib/MemoryAllocationLib.c @@ -1,192 +1,192 @@ -/** @file - Implementation of the 6 PEI Ffs (FV) APIs in library form. - - Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR> - - This program and the accompanying materials - are licensed and made available under the terms and conditions of the BSD License - which accompanies this distribution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php - - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#include <PiPei.h> - -#include <Library/BaseLib.h> -#include <Library/PrePiLib.h> -#include <Library/DebugLib.h> - - - -/** - Allocates one or more 4KB pages of type EfiBootServicesData. - - Allocates the number of 4KB pages of MemoryType 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 -AllocatePages ( - IN UINTN Pages - ) -{ - EFI_PEI_HOB_POINTERS Hob; - EFI_PHYSICAL_ADDRESS Offset; - - Hob.Raw = GetHobList (); - - // Check to see if on 4k boundary - Offset = Hob.HandoffInformationTable->EfiFreeMemoryTop & 0xFFF; - if (Offset != 0) { - // If not aligned, make the allocation aligned. - Hob.HandoffInformationTable->EfiFreeMemoryTop -= Offset; - } - - // - // Verify that there is sufficient memory to satisfy the allocation - // - if (Hob.HandoffInformationTable->EfiFreeMemoryTop - ((Pages * EFI_PAGE_SIZE) + sizeof (EFI_HOB_MEMORY_ALLOCATION)) < Hob.HandoffInformationTable->EfiFreeMemoryBottom) { - return 0; - } else { - // - // Update the PHIT to reflect the memory usage - // - Hob.HandoffInformationTable->EfiFreeMemoryTop -= Pages * EFI_PAGE_SIZE; - - // This routine used to create a memory allocation HOB a la PEI, but that's not - // necessary for us. - - // - // Create a memory allocation HOB. - // - BuildMemoryAllocationHob ( - Hob.HandoffInformationTable->EfiFreeMemoryTop, - Pages * EFI_PAGE_SIZE, - EfiBootServicesData - ); - return (VOID *)(UINTN)Hob.HandoffInformationTable->EfiFreeMemoryTop; - } -} - - -/** - Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment. - - Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an - alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is - returned. If there is not enough memory at the specified alignment remaining to satisfy the - request, then NULL is returned. - If Alignment is not a power of two and Alignment is not zero, then ASSERT(). - - @param Pages The number of 4 KB pages to allocate. - @param Alignment The requested alignment of the allocation. Must be a power of two. - If Alignment is zero, then byte alignment is used. - - @return A pointer to the allocated buffer or NULL if allocation fails. - -**/ -VOID * -EFIAPI -AllocateAlignedPages ( - IN UINTN Pages, - IN UINTN Alignment - ) -{ - VOID *Memory; - UINTN AlignmentMask; - - // - // Alignment must be a power of two or zero. - // - ASSERT ((Alignment & (Alignment - 1)) == 0); - - if (Pages == 0) { - return NULL; - } - // - // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow. - // - ASSERT (Pages <= (MAX_ADDRESS - EFI_SIZE_TO_PAGES (Alignment))); - // - // We would rather waste some memory to save PEI code size. - // - Memory = (VOID *)(UINTN)AllocatePages (Pages + EFI_SIZE_TO_PAGES (Alignment)); - if (Alignment == 0) { - AlignmentMask = Alignment; - } else { - AlignmentMask = Alignment - 1; - } - return (VOID *) (UINTN) (((UINTN) Memory + AlignmentMask) & ~AlignmentMask); -} - - - - -/** - Allocates a buffer of type EfiBootServicesData. - - Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a - pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is - returned. If there is not enough memory remaining to satisfy the request, then NULL is returned. - - @param AllocationSize The number of bytes to allocate. - - @return A pointer to the allocated buffer or NULL if allocation fails. - -**/ -VOID * -EFIAPI -AllocatePool ( - IN UINTN AllocationSize - ) -{ - EFI_HOB_MEMORY_POOL *Hob; - - Hob = GetHobList (); - - - // - // Verify that there is sufficient memory to satisfy the allocation - // - if (AllocationSize > 0x10000) { - // Please call AllcoatePages for big allocations - return 0; - } else { - - Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, (UINT16)(sizeof (EFI_HOB_TYPE_MEMORY_POOL) + AllocationSize)); - return (VOID *)(Hob + 1); - } -} - -/** - Frees a buffer that was previously allocated with one of the pool allocation functions in the - Memory Allocation Library. - - Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the - pool allocation services of the Memory Allocation Library. If it is not possible to free pool - resources, then this function will perform no actions. - - If Buffer was not allocated with a pool allocation function in the Memory Allocation Library, - then ASSERT(). - - @param Buffer Pointer to the buffer to free. - -**/ -VOID -EFIAPI -FreePool ( - IN VOID *Buffer - ) -{ - // Not implemented yet -} +/** @file
+ Implementation of the 6 PEI Ffs (FV) APIs in library form.
+
+ Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.<BR>
+
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <PiPei.h>
+
+#include <Library/BaseLib.h>
+#include <Library/PrePiLib.h>
+#include <Library/DebugLib.h>
+
+
+
+/**
+ Allocates one or more 4KB pages of type EfiBootServicesData.
+
+ Allocates the number of 4KB pages of MemoryType 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
+AllocatePages (
+ IN UINTN Pages
+ )
+{
+ EFI_PEI_HOB_POINTERS Hob;
+ EFI_PHYSICAL_ADDRESS Offset;
+
+ Hob.Raw = GetHobList ();
+
+ // Check to see if on 4k boundary
+ Offset = Hob.HandoffInformationTable->EfiFreeMemoryTop & 0xFFF;
+ if (Offset != 0) {
+ // If not aligned, make the allocation aligned.
+ Hob.HandoffInformationTable->EfiFreeMemoryTop -= Offset;
+ }
+
+ //
+ // Verify that there is sufficient memory to satisfy the allocation
+ //
+ if (Hob.HandoffInformationTable->EfiFreeMemoryTop - ((Pages * EFI_PAGE_SIZE) + sizeof (EFI_HOB_MEMORY_ALLOCATION)) < Hob.HandoffInformationTable->EfiFreeMemoryBottom) {
+ return 0;
+ } else {
+ //
+ // Update the PHIT to reflect the memory usage
+ //
+ Hob.HandoffInformationTable->EfiFreeMemoryTop -= Pages * EFI_PAGE_SIZE;
+
+ // This routine used to create a memory allocation HOB a la PEI, but that's not
+ // necessary for us.
+
+ //
+ // Create a memory allocation HOB.
+ //
+ BuildMemoryAllocationHob (
+ Hob.HandoffInformationTable->EfiFreeMemoryTop,
+ Pages * EFI_PAGE_SIZE,
+ EfiBootServicesData
+ );
+ return (VOID *)(UINTN)Hob.HandoffInformationTable->EfiFreeMemoryTop;
+ }
+}
+
+
+/**
+ Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
+
+ Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
+ alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is
+ returned. If there is not enough memory at the specified alignment remaining to satisfy the
+ request, then NULL is returned.
+ If Alignment is not a power of two and Alignment is not zero, then ASSERT().
+
+ @param Pages The number of 4 KB pages to allocate.
+ @param Alignment The requested alignment of the allocation. Must be a power of two.
+ If Alignment is zero, then byte alignment is used.
+
+ @return A pointer to the allocated buffer or NULL if allocation fails.
+
+**/
+VOID *
+EFIAPI
+AllocateAlignedPages (
+ IN UINTN Pages,
+ IN UINTN Alignment
+ )
+{
+ VOID *Memory;
+ UINTN AlignmentMask;
+
+ //
+ // Alignment must be a power of two or zero.
+ //
+ ASSERT ((Alignment & (Alignment - 1)) == 0);
+
+ if (Pages == 0) {
+ return NULL;
+ }
+ //
+ // Make sure that Pages plus EFI_SIZE_TO_PAGES (Alignment) does not overflow.
+ //
+ ASSERT (Pages <= (MAX_ADDRESS - EFI_SIZE_TO_PAGES (Alignment)));
+ //
+ // We would rather waste some memory to save PEI code size.
+ //
+ Memory = (VOID *)(UINTN)AllocatePages (Pages + EFI_SIZE_TO_PAGES (Alignment));
+ if (Alignment == 0) {
+ AlignmentMask = Alignment;
+ } else {
+ AlignmentMask = Alignment - 1;
+ }
+ return (VOID *) (UINTN) (((UINTN) Memory + AlignmentMask) & ~AlignmentMask);
+}
+
+
+
+
+/**
+ Allocates a buffer of type EfiBootServicesData.
+
+ Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
+ pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is
+ returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.
+
+ @param AllocationSize The number of bytes to allocate.
+
+ @return A pointer to the allocated buffer or NULL if allocation fails.
+
+**/
+VOID *
+EFIAPI
+AllocatePool (
+ IN UINTN AllocationSize
+ )
+{
+ EFI_HOB_MEMORY_POOL *Hob;
+
+ Hob = GetHobList ();
+
+
+ //
+ // Verify that there is sufficient memory to satisfy the allocation
+ //
+ if (AllocationSize > 0x10000) {
+ // Please call AllcoatePages for big allocations
+ return 0;
+ } else {
+
+ Hob = (EFI_HOB_MEMORY_POOL *)CreateHob (EFI_HOB_TYPE_MEMORY_POOL, (UINT16)(sizeof (EFI_HOB_TYPE_MEMORY_POOL) + AllocationSize));
+ return (VOID *)(Hob + 1);
+ }
+}
+
+/**
+ Frees a buffer that was previously allocated with one of the pool allocation functions in the
+ Memory Allocation Library.
+
+ Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the
+ pool allocation services of the Memory Allocation Library. If it is not possible to free pool
+ resources, then this function will perform no actions.
+
+ If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,
+ then ASSERT().
+
+ @param Buffer Pointer to the buffer to free.
+
+**/
+VOID
+EFIAPI
+FreePool (
+ IN VOID *Buffer
+ )
+{
+ // Not implemented yet
+}
|