]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/X64/SetIdtEntry.c
Fix ICC11(VS2005) build failure.
[mirror_edk2.git] / MdeModulePkg / Universal / Acpi / BootScriptExecutorDxe / X64 / SetIdtEntry.c
index 54ea20aa7ecf6b2988dfcb3773899bb540358433..a8944e600c64b711073db916b9ee920cc8944ea2 100644 (file)
@@ -3,7 +3,7 @@
 \r
   Set a IDT entry for interrupt vector 3 for debug purpose for x64 platform\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
@@ -48,6 +48,7 @@ HookPageFaultHandler (
 {\r
   UINT32         RegEax;\r
   UINT32         RegEdx;\r
+  UINTN          PageFaultHandlerHookAddress;\r
 \r
   AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);\r
   mPhyMask = LShiftU64 (1, (UINT8)RegEax) - 1;\r
@@ -67,13 +68,14 @@ HookPageFaultHandler (
   //\r
   // Set Page Fault entry to catch >4G access\r
   //\r
+  PageFaultHandlerHookAddress = (UINTN)PageFaultHandlerHook;\r
   mOriginalHandler = (VOID *)(UINTN)(LShiftU64 (IdtEntry->Bits.OffsetUpper, 32) + IdtEntry->Bits.OffsetLow + (IdtEntry->Bits.OffsetHigh << 16));\r
-  IdtEntry->Bits.OffsetLow      = (UINT16)((UINTN)PageFaultHandlerHook);\r
+  IdtEntry->Bits.OffsetLow      = (UINT16)PageFaultHandlerHookAddress;\r
   IdtEntry->Bits.Selector       = (UINT16)AsmReadCs ();\r
   IdtEntry->Bits.Reserved_0     = 0;\r
   IdtEntry->Bits.GateType       = IA32_IDT_GATE_TYPE_INTERRUPT_32;\r
-  IdtEntry->Bits.OffsetHigh     = (UINT16)((UINTN)PageFaultHandlerHook >> 16);\r
-  IdtEntry->Bits.OffsetUpper    = (UINT32)((UINTN)PageFaultHandlerHook >> 32);\r
+  IdtEntry->Bits.OffsetHigh     = (UINT16)(PageFaultHandlerHookAddress >> 16);\r
+  IdtEntry->Bits.OffsetUpper    = (UINT32)(PageFaultHandlerHookAddress >> 32);\r
   IdtEntry->Bits.Reserved_1     = 0;\r
 \r
   if (mPage1GSupport) {\r