summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Core
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2015-05-18 01:30:04 +0000
committerlzeng14 <lzeng14@Edk2>2015-05-18 01:30:04 +0000
commitdb9b00f1d58516fec77df359e99ee60ed3da0278 (patch)
treeb62600bc67c24dbb280263bdc616f6d2e1e49bb8 /MdeModulePkg/Core
parentca949d9d2d538ee21dbc7caadbbd0eaadad9fe28 (diff)
downloadedk2-platforms-db9b00f1d58516fec77df359e99ee60ed3da0278.tar.xz
MdeModulePkg: Update memory profile for OEM reserved memory type.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17462 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Core')
-rw-r--r--MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
index 1ae991b702..2c6713f5e9 100644
--- a/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
+++ b/MdeModulePkg/Core/Dxe/Mem/MemoryProfileRecord.c
@@ -13,6 +13,7 @@
**/
#include "DxeMain.h"
+#include "Imem.h"
#define IS_UEFI_MEMORY_PROFILE_ENABLED ((PcdGet8 (PcdMemoryProfilePropertyMask) & BIT0) != 0)
@@ -737,8 +738,9 @@ UnregisterMemoryProfileImage (
/**
Return if this memory type needs to be recorded into memory profile.
- If BIOS memory type (0 ~ EfiMaxMemoryType), it checks bit (1 << MemoryType).
+ If BIOS memory type (0 ~ EfiMaxMemoryType - 1), it checks bit (1 << MemoryType).
If OS memory type (0x80000000 ~ 0xFFFFFFFF), it checks bit63 - 0x8000000000000000.
+ If OEM memory type (0x70000000 ~ 0x7FFFFFFF), it checks bit62 - 0x4000000000000000.
@param MemoryType Memory type.
@@ -753,8 +755,10 @@ CoreNeedRecordProfile (
{
UINT64 TestBit;
- if ((UINT32) MemoryType >= 0x80000000) {
+ if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
TestBit = BIT63;
+ } else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
+ TestBit = BIT62;
} else {
TestBit = LShiftU64 (1, MemoryType);
}
@@ -768,8 +772,9 @@ CoreNeedRecordProfile (
/**
Convert EFI memory type to profile memory index. The rule is:
- If BIOS memory type (0 ~ EfiMaxMemoryType), ProfileMemoryIndex = MemoryType.
+ If BIOS memory type (0 ~ EfiMaxMemoryType - 1), ProfileMemoryIndex = MemoryType.
If OS memory type (0x80000000 ~ 0xFFFFFFFF), ProfileMemoryIndex = EfiMaxMemoryType.
+ If OEM memory type (0x70000000 ~ 0x7FFFFFFF), ProfileMemoryIndex = EfiMaxMemoryType + 1.
@param MemoryType Memory type.
@@ -781,8 +786,10 @@ GetProfileMemoryIndex (
IN EFI_MEMORY_TYPE MemoryType
)
{
- if ((UINT32) MemoryType >= 0x80000000) {
+ if ((UINT32) MemoryType >= MEMORY_TYPE_OS_RESERVED_MIN) {
return EfiMaxMemoryType;
+ } else if ((UINT32) MemoryType >= MEMORY_TYPE_OEM_RESERVED_MIN) {
+ return EfiMaxMemoryType + 1;
} else {
return MemoryType;
}