]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: Enhance the comments for SmmMemoryAllocationLib instance.
authorQiu Shumin <shumin.qiu@intel.com>
Fri, 19 Jun 2015 01:56:15 +0000 (01:56 +0000)
committershenshushi <shenshushi@Edk2>
Fri, 19 Jun 2015 01:56:15 +0000 (01:56 +0000)
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@17666 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Library/SmmMemoryAllocationLib/MemoryAllocationLib.c

index ab27ac65832c62df67ebea93092b0519c4aacb90..30670bf071e669de51f0cc43bec366414a459118 100644 (file)
@@ -4,12 +4,13 @@
   \r
   The PI System Management Mode Core Interface Specification only allows the use\r
   of EfiRuntimeServicesCode and EfiRuntimeServicesData memory types for memory \r
-  allocations through the SMM Services Table.  The functions in the Memory \r
-  Allocation Library use EfiBootServicesData as the default memory allocation\r
-  type.  For this SMM specific instance of the Memory Allocation Library, \r
-  EfiRuntimeServicesData is used as the default memory type for all allocations.\r
-  In addition, allocation for the Reserved memory types are not supported and \r
-  will always return NULL.\r
+  allocations through the SMM Services Table as the SMRAM space should be \r
+  reserved after BDS phase.  The functions in the Memory Allocation Library use\r
+  EfiBootServicesData as the default memory allocation type.  For this SMM \r
+  specific instance of the Memory Allocation Library, EfiRuntimeServicesData \r
+  is used as the default memory type for all allocations. In addition, \r
+  allocation for the Reserved memory types are not supported and will always \r
+  return NULL.\r
 \r
   Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials                          \r
@@ -169,9 +170,9 @@ InternalAllocatePages (
 }\r
 \r
 /**\r
-  Allocates one or more 4KB pages of type EfiBootServicesData.\r
+  Allocates one or more 4KB pages of type EfiRuntimeServicesData.\r
 \r
-  Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer \r
+  Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer \r
   to the allocated buffer.  The buffer returned is aligned on a 4KB boundary.  If \r
   Pages is 0, then NULL is returned.  If there is not enough memory remaining to \r
   satisfy the request, then NULL is returned.\r
@@ -365,9 +366,9 @@ InternalAllocateAlignedPages (
 }\r
 \r
 /**\r
-  Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.\r
+  Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.\r
 \r
-  Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData \r
+  Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData \r
   with an alignment specified by Alignment.  The allocated buffer is returned.  \r
   If Pages is 0, then NULL is returned.  If there is not enough memory at the \r
   specified alignment remaining to satisfy the request, then NULL is returned.\r
@@ -525,9 +526,9 @@ InternalAllocatePool (
 }\r
 \r
 /**\r
-  Allocates a buffer of type EfiBootServicesData.\r
+  Allocates a buffer of type EfiRuntimeServicesData.\r
 \r
-  Allocates the number bytes specified by AllocationSize of type EfiBootServicesData \r
+  Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData \r
   and returns a pointer to the allocated buffer.  If AllocationSize is 0, then a \r
   valid buffer of 0 size is returned.  If there is not enough memory remaining to \r
   satisfy the request, then NULL is returned.\r
@@ -620,9 +621,9 @@ InternalAllocateZeroPool (
 }\r
 \r
 /**\r
-  Allocates and zeros a buffer of type EfiBootServicesData.\r
+  Allocates and zeros a buffer of type EfiRuntimeServicesData.\r
 \r
-  Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, \r
+  Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, \r
   clears the buffer with zeros, and returns a pointer to the allocated buffer.  \r
   If AllocationSize is 0, then a valid buffer of 0 size is returned.  If there is \r
   not enough memory remaining to satisfy the request, then NULL is returned.\r
@@ -722,9 +723,9 @@ InternalAllocateCopyPool (
 } \r
 \r
 /**\r
-  Copies a buffer to an allocated buffer of type EfiBootServicesData.\r
+  Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.\r
 \r
-  Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, \r
+  Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, \r
   copies AllocationSize bytes from Buffer to the newly allocated buffer, and returns \r
   a pointer to the allocated buffer.  If AllocationSize is 0, then a valid buffer \r
   of 0 size is returned.  If there is not enough memory remaining to satisfy the \r
@@ -846,10 +847,10 @@ InternalReallocatePool (
 }\r
 \r
 /**\r
-  Reallocates a buffer of type EfiBootServicesData.\r
+  Reallocates a buffer of type EfiRuntimeServicesData.\r
 \r
   Allocates and zeros the number bytes specified by NewSize from memory of type\r
-  EfiBootServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and \r
+  EfiRuntimeServicesData.  If OldBuffer is not NULL, then the smaller of OldSize and \r
   NewSize bytes are copied from OldBuffer to the newly allocated buffer, and \r
   OldBuffer is freed.  A pointer to the newly allocated buffer is returned.  \r
   If NewSize is 0, then a valid buffer of 0 size is  returned.  If there is not \r