summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg/Compatibility/SmmBaseHelper
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-04-09 09:15:50 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2010-04-09 09:15:50 +0000
commite9ba23c77d5b29ce7581c178ec3a1c04e937e9e4 (patch)
tree1937375780720fdfc35922068e2c6d6be240c3b9 /EdkCompatibilityPkg/Compatibility/SmmBaseHelper
parenta58cc068b6d6b62395f29e264f911892560705c6 (diff)
downloadedk2-platforms-e9ba23c77d5b29ce7581c178ec3a1c04e937e9e4.tar.xz
1. Add the missing function headers.
2. Update local variable name to match coding style. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10355 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg/Compatibility/SmmBaseHelper')
-rw-r--r--EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
index 08ac649b3b..9310e5afdb 100644
--- a/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
+++ b/EdkCompatibilityPkg/Compatibility/SmmBaseHelper/SmmBaseHelper.c
@@ -106,6 +106,10 @@ CPU_SAVE_STATE_CONVERSION mCpuSaveStateConvTable[] = {
{EFI_SMM_SAVE_STATE_REGISTER_CR3 , CPU_SAVE_STATE_GET_OFFSET(CR3)}
};
+/**
+ Page fault handler.
+
+**/
VOID
PageFaultHandlerHook (
VOID
@@ -391,9 +395,9 @@ InitCpuStatePageTable (
{
UINTN Index;
UINT64 *PageTable;
- UINT64 *PDPTE;
+ UINT64 *Pdpte;
UINT64 HookAddress;
- UINT64 PDE;
+ UINT64 Pde;
UINT64 Address;
//
@@ -409,21 +413,21 @@ InitCpuStatePageTable (
PageTable = (UINT64 *)(UINTN)(PageTable[BitFieldRead64 (HookAddress, 39, 47)] & mPhyMask);
PageTable = (UINT64 *)(UINTN)(PageTable[BitFieldRead64 (HookAddress, 30, 38)] & mPhyMask);
- PDPTE = (UINT64 *)(UINTN)PageTable;
- PDE = PDPTE[BitFieldRead64 (HookAddress, 21, 29)];
- ASSERT ((PDE & BIT0) != 0); // Present and 2M Page
+ Pdpte = (UINT64 *)(UINTN)PageTable;
+ Pde = Pdpte[BitFieldRead64 (HookAddress, 21, 29)];
+ ASSERT ((Pde & BIT0) != 0); // Present and 2M Page
- if ((PDE & BIT7) == 0) { // 4KB Page Directory
- PageTable = (UINT64 *)(UINTN)(PDE & mPhyMask);
+ if ((Pde & BIT7) == 0) { // 4KB Page Directory
+ PageTable = (UINT64 *)(UINTN)(Pde & mPhyMask);
} else {
- ASSERT ((PDE & mPhyMask) == (HookAddress & ~(SIZE_2MB-1))); // 2MB Page Point to HookAddress
+ ASSERT ((Pde & mPhyMask) == (HookAddress & ~(SIZE_2MB-1))); // 2MB Page Point to HookAddress
PageTable = AllocatePages (1);
Address = HookAddress & ~(SIZE_2MB-1);
for (Index = 0; Index < 512; Index++) {
PageTable[Index] = Address | BIT0 | BIT1; // Present and RW
Address += SIZE_4KB;
}
- PDPTE[BitFieldRead64 (HookAddress, 21, 29)] = (UINT64)(UINTN)PageTable | BIT0 | BIT1; // Present and RW
+ Pdpte[BitFieldRead64 (HookAddress, 21, 29)] = (UINT64)(UINTN)PageTable | BIT0 | BIT1; // Present and RW
}
return PageTable;
}