MdeModulePkg: Enhance the comments for PiSmmCoreMemoryAllocationLib instance.

Per PI spec all allocation of SMRAM should use EfiRuntimeServicesCode or EfiRuntimeServicesData. 
So SMM instance use EfiRuntimeServicesCode as the default memory allocation type instead of EfiBootServicesData. 
This patch clarify this usage in comments.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17667 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Qiu Shumin 2015-06-19 01:58:09 +00:00 committed by shenshushi
parent 25d7db8cc4
commit 2d28f3b73e
1 changed files with 21 additions and 12 deletions

View File

@ -1,5 +1,14 @@
/** @file
Support routines for memory allocation routines based on SMM Core internal functions.
The PI System Management Mode Core Interface Specification only allows the use
of EfiRuntimeServicesCode and EfiRuntimeServicesData memory types for memory
allocations as the SMRAM space should be reserved after BDS phase. The functions
in the Memory Allocation Library use EfiBootServicesData as the default memory
allocation type. For this SMM specific instance of the Memory Allocation Library,
EfiRuntimeServicesData is used as the default memory type for all allocations.
In addition, allocation for the Reserved memory types are not supported and will
always return NULL.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
@ -84,9 +93,9 @@ InternalAllocatePages (
}
/**
Allocates one or more 4KB pages of type EfiBootServicesData.
Allocates one or more 4KB pages of type EfiRuntimeServicesData.
Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the
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.
@ -279,9 +288,9 @@ InternalAllocateAlignedPages (
}
/**
Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.
Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.
Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an
Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData 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.
@ -437,9 +446,9 @@ InternalAllocatePool (
}
/**
Allocates a buffer of type EfiBootServicesData.
Allocates a buffer of type EfiRuntimeServicesData.
Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a
Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData 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.
@ -529,9 +538,9 @@ InternalAllocateZeroPool (
}
/**
Allocates and zeros a buffer of type EfiBootServicesData.
Allocates and zeros a buffer of type EfiRuntimeServicesData.
Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the
Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the
buffer with zeros, 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.
@ -631,9 +640,9 @@ InternalAllocateCopyPool (
}
/**
Copies a buffer to an allocated buffer of type EfiBootServicesData.
Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.
Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies
Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies
AllocationSize bytes from Buffer to the newly allocated buffer, 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.
@ -752,10 +761,10 @@ InternalReallocatePool (
}
/**
Reallocates a buffer of type EfiBootServicesData.
Reallocates a buffer of type EfiRuntimeServicesData.
Allocates and zeros the number bytes specified by NewSize from memory of type
EfiBootServicesData. If OldBuffer is not NULL, then the smaller of OldSize and
EfiRuntimeServicesData. If OldBuffer is not NULL, then the smaller of OldSize and
NewSize bytes are copied from OldBuffer to the newly allocated buffer, and
OldBuffer is freed. A pointer to the newly allocated buffer is returned.
If NewSize is 0, then a valid buffer of 0 size is returned. If there is not