]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuDxe/CpuDxe.c
Add DEBUG() macros for DEBUG_CACHE to MTRR Library show all changes memory caches...
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / CpuDxe.c
index 9e40b4d03858bfeb22bb992655e26576a51fbde6..99fdbd7757055c34c3d0172c6321f3cad3a1d6c7 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   CPU DXE Module.\r
 \r
-  Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2008 - 2011, 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
@@ -114,6 +114,14 @@ UINT32 mErrorCodeFlag = 0x00027d00;
 //\r
 // Local function prototypes\r
 //\r
+\r
+/**\r
+  Set Interrupt Descriptor Table Handler Address.\r
+\r
+  @param Index        The Index of the interrupt descriptor table handle.\r
+  @param Handler      Handler address.\r
+\r
+**/\r
 VOID\r
 SetInterruptDescriptorTableHandlerAddress (\r
   IN UINTN Index,\r
@@ -513,7 +521,7 @@ CpuRegisterInterruptHandler (
     return EFI_ALREADY_STARTED;\r
   }\r
 \r
-  SetInterruptDescriptorTableHandlerAddress (InterruptType, NULL);\r
+  SetInterruptDescriptorTableHandlerAddress ((UINTN)InterruptType, NULL);\r
   ExternalVectorTable[InterruptType] = InterruptHandler;\r
   return EFI_SUCCESS;\r
 }\r
@@ -604,8 +612,6 @@ CpuSetMemoryAttributes (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  DEBUG((EFI_D_ERROR, "CpuAp: SetMemorySpaceAttributes(BA=%08x, Len=%08x, Attr=%08x)\n", BaseAddress, Length, Attributes));\r
-\r
   //\r
   // If this function is called because GCD SetMemorySpaceAttributes () is called\r
   // by RefreshGcdMemoryAttributes (), then we are just synchronzing GCD memory\r
@@ -644,15 +650,12 @@ CpuSetMemoryAttributes (
   //\r
   // call MTRR libary function\r
   //\r
-  DEBUG((EFI_D_ERROR, "  MtrrSetMemoryAttribute()\n"));\r
-  Status = MtrrSetMemoryAttribute(\r
+  Status = MtrrSetMemoryAttribute (\r
              BaseAddress,\r
              Length,\r
              CacheType\r
              );\r
 \r
-  MtrrDebugPrintAllMtrrs ();\r
-\r
   return (EFI_STATUS) Status;\r
 }\r
 \r
@@ -1014,7 +1017,13 @@ RefreshGcdMemoryAttributes (
   mIsFlushingGCD = FALSE;\r
 }\r
 \r
+/**\r
+  Set Interrupt Descriptor Table Handler Address.\r
 \r
+  @param Index        The Index of the interrupt descriptor table handle.\r
+  @param Handler      Handler address.\r
+\r
+**/\r
 VOID\r
 SetInterruptDescriptorTableHandlerAddress (\r
   IN UINTN Index,\r
@@ -1068,7 +1077,7 @@ InitInterruptDescriptorTable (
 \r
   if ((OldIdtPtr.Base != 0) && ((OldIdtPtr.Limit & 7) == 7)) {\r
     OldIdt = (IA32_IDT_GATE_DESCRIPTOR*) OldIdtPtr.Base;\r
-    OldIdtSize = (OldIdtPtr.Limit + 1) / 8;\r
+    OldIdtSize = (OldIdtPtr.Limit + 1) / sizeof (IA32_IDT_GATE_DESCRIPTOR);\r
   } else {\r
     OldIdt = NULL;\r
     OldIdtSize = 0;\r