/** @file\r
Ia32-specific functionality for DxeLoad.\r
\r
-Copyright (c) 2006 - 2010, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
http://opensource.org/licenses/bsd-license.php\r
#include "DxeIpl.h"\r
#include "VirtualMemory.h"\r
\r
+#define IDT_ENTRY_COUNT 32\r
+\r
//\r
// Global Descriptor Table (GDT)\r
//\r
};\r
\r
GLOBAL_REMOVE_IF_UNREFERENCED IA32_DESCRIPTOR gLidtDescriptor = {\r
- sizeof (X64_IDT_GATE_DESCRIPTOR) * 32 - 1,\r
+ sizeof (X64_IDT_GATE_DESCRIPTOR) * IDT_ENTRY_COUNT - 1,\r
0\r
};\r
\r
\r
Status = PeiServicesAllocatePages (\r
EfiBootServicesData,\r
- EFI_SIZE_TO_PAGES((SizeOfTemplate + sizeof (X64_IDT_GATE_DESCRIPTOR)) * 32),\r
+ EFI_SIZE_TO_PAGES((SizeOfTemplate + sizeof (X64_IDT_GATE_DESCRIPTOR)) * IDT_ENTRY_COUNT),\r
&VectorAddress\r
);\r
ASSERT_EFI_ERROR (Status);\r
\r
- IdtTable = (X64_IDT_GATE_DESCRIPTOR *) (UINTN) (VectorAddress + SizeOfTemplate * 32);\r
- for (Index = 0; Index < 32; Index++) {\r
+ IdtTable = (X64_IDT_GATE_DESCRIPTOR *) (UINTN) (VectorAddress + SizeOfTemplate * IDT_ENTRY_COUNT);\r
+ for (Index = 0; Index < IDT_ENTRY_COUNT; Index++) {\r
IdtTable[Index].Ia32IdtEntry.Bits.GateType = 0x8e;\r
IdtTable[Index].Ia32IdtEntry.Bits.Reserved_0 = 0;\r
IdtTable[Index].Ia32IdtEntry.Bits.Selector = SYS_CODE64_SEL;\r
\r
gLidtDescriptor.Base = (UINTN) IdtTable;\r
\r
+ //\r
+ // Disable interrupt of Debug timer, since new IDT table cannot handle it.\r
+ //\r
+ SaveAndSetDebugTimerInterrupt (FALSE);\r
+\r
AsmWriteIdtr (&gLidtDescriptor);\r
\r
//\r