\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
{\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
//\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