diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-28 06:04:01 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2011-10-28 06:04:01 +0000 |
commit | e8e5cd4a5e0e85382d5fc4d1eb469e8c52d58f18 (patch) | |
tree | 2a09df6ae1b18e68b6e4e9bed27fadbac83ff1c2 /OvmfPkg/PlatformPei/MemDetect.c | |
parent | 4bf8ffc3fbff9dedb390821905b1631b2fb4157c (diff) | |
download | edk2-platforms-e8e5cd4a5e0e85382d5fc4d1eb469e8c52d58f18.tar.xz |
Set MTRR registers.
Signed-off-by: vanjeff
Reviewed-by: rsun3
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12589 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'OvmfPkg/PlatformPei/MemDetect.c')
-rw-r--r-- | OvmfPkg/PlatformPei/MemDetect.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetect.c index 78b43d22b7..5070c79c0d 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -1,7 +1,7 @@ /**@file
Memory Detection for Virtual Machines.
- Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2011, Intel Corporation. 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
@@ -30,6 +30,7 @@ Module Name: #include <Library/PcdLib.h>
#include <Library/PeimEntryPoint.h>
#include <Library/ResourcePublicationLib.h>
+#include <Library/MtrrLib.h>
#include "Platform.h"
#include "Cmos.h"
@@ -130,8 +131,17 @@ MemDetect ( AddMemoryRangeHob (BASE_1MB, MemoryBase);
AddMemoryRangeHob (0, BASE_512KB + BASE_128KB);
+ Status = MtrrSetMemoryAttribute (BASE_1MB, MemoryBase + MemorySize - BASE_1MB, CacheWriteBack);
+ ASSERT_EFI_ERROR(Status);
+
+ Status = MtrrSetMemoryAttribute (0, BASE_512KB + BASE_128KB, CacheWriteBack);
+ ASSERT_EFI_ERROR(Status);
+
if (UpperMemorySize != 0) {
AddUntestedMemoryBaseSizeHob (BASE_4GB, UpperMemorySize);
+
+ Status = MtrrSetMemoryAttribute (BASE_4GB, UpperMemorySize, CacheWriteBack);
+ ASSERT_EFI_ERROR(Status);
}
return MemoryBase + MemorySize;
|