summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Include/Library
diff options
context:
space:
mode:
authorRuiyu Ni <ruiyu.ni@intel.com>2018-01-18 14:13:32 +0800
committerRuiyu Ni <ruiyu.ni@intel.com>2018-01-24 11:13:17 +0800
commitbc6a8b78aa77cf63aa896c5dba0d948d4eebfa73 (patch)
tree534c8a6d5b2996e018ee545ac256a9a52d9d3fd6 /UefiCpuPkg/Include/Library
parent8b2eb7b3f62b1946cdd76e6f7758e106fcf71477 (diff)
downloadedk2-bc6a8b78aa77cf63aa896c5dba0d948d4eebfa73.tar.gz
edk2-bc6a8b78aa77cf63aa896c5dba0d948d4eebfa73.tar.bz2
edk2-bc6a8b78aa77cf63aa896c5dba0d948d4eebfa73.zip
UefiCpuPkg/MtrrLib: Add comments to recommend to use batch-set API
MtrrSetMemoryAttributesInMtrrSettings() is a batch-set API. When setting multiple ranges of memory attributes, the single-set API (MtrrSetMemoryAttributeInMtrrSettings and MtrrSetMemoryAttribute) may fail, but batch-set API may succeed. Add comments to recommend caller to use batch-set API when setting multiple ranges. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Ming Shao <ming.shao@intel.com>
Diffstat (limited to 'UefiCpuPkg/Include/Library')
-rw-r--r--UefiCpuPkg/Include/Library/MtrrLib.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/UefiCpuPkg/Include/Library/MtrrLib.h b/UefiCpuPkg/Include/Library/MtrrLib.h
index d56f1057e1..f82c27ea0c 100644
--- a/UefiCpuPkg/Include/Library/MtrrLib.h
+++ b/UefiCpuPkg/Include/Library/MtrrLib.h
@@ -157,6 +157,11 @@ GetFirmwareVariableMtrrCount (
@retval RETURN_OUT_OF_RESOURCES There are not enough system resources to
modify the attributes of the memory
resource range.
+ Multiple memory range attributes setting by calling this API multiple
+ times may fail with status RETURN_OUT_OF_RESOURCES. It may not mean
+ the number of CPU MTRRs are too small to set such memory attributes.
+ Pass the multiple memory range attributes to one call of
+ MtrrSetMemoryAttributesInMtrrSettings() may succeed.
@retval RETURN_BUFFER_TOO_SMALL The fixed internal scratch buffer is too small for MTRR calculation.
Caller should use MtrrSetMemoryAttributesInMtrrSettings() to specify
external scratch buffer.
@@ -354,6 +359,11 @@ MtrrGetDefaultMemoryType (
BaseAddress and Length cannot be modified.
@retval RETURN_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of
the memory resource range.
+ Multiple memory range attributes setting by calling this API multiple
+ times may fail with status RETURN_OUT_OF_RESOURCES. It may not mean
+ the number of CPU MTRRs are too small to set such memory attributes.
+ Pass the multiple memory range attributes to one call of
+ MtrrSetMemoryAttributesInMtrrSettings() may succeed.
@retval RETURN_BUFFER_TOO_SMALL The fixed internal scratch buffer is too small for MTRR calculation.
Caller should use MtrrSetMemoryAttributesInMtrrSettings() to specify
external scratch buffer.