]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/DxeIplPeim/Ia32/DxeLoadFunc.c
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Core / DxeIplPeim / Ia32 / DxeLoadFunc.c
index 7e99ac5e02f243465306a6e4b902de766511b411..6898bd9c92a1a55189eaafb163513d411e0a99b2 100644 (file)
@@ -1,8 +1,8 @@
 /** @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
@@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include "DxeIpl.h"\r
 #include "VirtualMemory.h"\r
 \r
+#define IDT_ENTRY_COUNT       32\r
+\r
 //\r
 // Global Descriptor Table (GDT)\r
 //\r
@@ -40,7 +42,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST IA32_DESCRIPTOR gGdt = {
   };\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
@@ -118,13 +120,13 @@ HandOffToDxeCore (
 \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
@@ -142,6 +144,11 @@ HandOffToDxeCore (
 \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