]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1. Use Mde library for Debug Port Module
authorvanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Dec 2008 07:10:46 +0000 (07:10 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 30 Dec 2008 07:10:46 +0000 (07:10 +0000)
2. Minimum changed for Debug Support Module.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7153 6f19259b-4bc3-4df7-8a09-765794883524

MdeModulePkg/Universal/DebugPortDxe/DebugPort.c
MdeModulePkg/Universal/DebugSupportDxe/Ia32/PlDebugSupportIa32.c
MdeModulePkg/Universal/DebugSupportDxe/X64/PlDebugSupportX64.c

index 5881668d7fe3569866a1d83fdef457ca3c19ffc0..a63ef84a3040be8cf60024613b0d26cc177674f0 100644 (file)
@@ -37,9 +37,9 @@ DEBUGPORT_DEVICE mDebugPortDevice = {
   (EFI_DEVICE_PATH_PROTOCOL *) NULL,\r
   {\r
     DebugPortReset,\r
-    DebugPortRead, \r
-    DebugPortWrite, \r
-    DebugPortPoll \r
+    DebugPortRead,\r
+    DebugPortWrite,\r
+    DebugPortPoll\r
   },\r
   (EFI_HANDLE) 0,\r
   (EFI_SERIAL_IO_PROTOCOL *) NULL,\r
@@ -127,15 +127,15 @@ GetDebugPortVariable (
 }\r
 \r
 /**\r
-  Debug Port Driver entry point. \r
+  Debug Port Driver entry point.\r
 \r
   Reads DebugPort variable to determine what device and settings to use as the\r
   debug port.  Binds exclusively to SerialIo. Reverts to defaults if no variable\r
   is found.\r
 \r
-  @param[in] ImageHandle       The firmware allocated handle for the EFI image.  \r
+  @param[in] ImageHandle       The firmware allocated handle for the EFI image.\r
   @param[in] SystemTable       A pointer to the EFI System Table.\r
-  \r
+\r
   @retval EFI_SUCCESS          The entry point is executed successfully.\r
   @retval EFI_OUT_OF_RESOURCES Fails to allocate memory for device.\r
   @retval other                Some error occurs when executing this entry point.\r
@@ -167,7 +167,7 @@ InitializeDebugPortDriver (
 }\r
 \r
 /**\r
-  Checks to see if there's not already a DebugPort interface somewhere. \r
+  Checks to see if there's not already a DebugPort interface somewhere.\r
 \r
   If there's a DEBUGPORT variable, the device path must match exactly.  If there's\r
   no DEBUGPORT variable, then device path is not checked and does not matter.\r
@@ -238,15 +238,15 @@ DebugPortSupported (
       Status = EFI_UNSUPPORTED;\r
     }\r
 \r
-    if (Status == EFI_SUCCESS && \r
+    if (Status == EFI_SUCCESS &&\r
         (Dp2->Type != MESSAGING_DEVICE_PATH ||\r
-         Dp2->SubType != MSG_VENDOR_DP || \r
+         Dp2->SubType != MSG_VENDOR_DP ||\r
          *((UINT16 *) Dp2->Length) != sizeof (DEBUGPORT_DEVICE_PATH))) {\r
 \r
       Status = EFI_UNSUPPORTED;\r
     }\r
 \r
-    if (Status == EFI_SUCCESS && CompareMem (&gEfiDebugPortDevicePathGuid, Dp2 + 1, sizeof (EFI_GUID))) {\r
+    if (Status == EFI_SUCCESS && !CompareGuid (&gEfiDebugPortDevicePathGuid, (GUID *) (Dp2 + 1))) {\r
       Status = EFI_UNSUPPORTED;\r
     }\r
 \r
@@ -289,7 +289,7 @@ DebugPortSupported (
 \r
   @retval EFI_SUCCESS          This driver is added to ControllerHandle.\r
   @retval EFI_OUT_OF_RESOURCES Fails to allocate memory for device.\r
-  @retval others               Some error occurs.                \r
+  @retval others               Some error occurs.\r
 \r
 **/\r
 EFI_STATUS\r
@@ -365,7 +365,7 @@ DebugPortStart (
   DebugPortDP.Header.Type     = MESSAGING_DEVICE_PATH;\r
   DebugPortDP.Header.SubType  = MSG_VENDOR_DP;\r
   SetDevicePathNodeLength (&(DebugPortDP.Header), sizeof (DebugPortDP));\r
-  CopyMem (&DebugPortDP.Guid, &gEfiDebugPortDevicePathGuid, sizeof (EFI_GUID));\r
+  CopyGuid (&DebugPortDP.Guid, &gEfiDebugPortDevicePathGuid);\r
 \r
   Dp1 = DevicePathFromHandle (ControllerHandle);\r
   if (Dp1 == NULL) {\r
@@ -547,11 +547,11 @@ DebugPortStop (
 \r
   The port itself should be fine since it was set up during initialization.\r
 \r
-  @param  This              Protocol instance pointer.   \r
+  @param  This              Protocol instance pointer.\r
 \r
   @return EFI_SUCCESS       Always.\r
 \r
-**/  \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DebugPortReset (\r
@@ -579,8 +579,8 @@ DebugPortReset (
                               On output, the amount of data actually written.\r
   @param  Buffer              Pointer to buffer to read.\r
 \r
-  @retval EFI_SUCCESS         \r
-  @retval others              \r
+  @retval EFI_SUCCESS\r
+  @retval others\r
 \r
 **/\r
 EFI_STATUS\r
@@ -692,7 +692,7 @@ DebugPortWrite (
                               DebugPort interface\r
   @retval EFI_DEVICE_ERROR    A hardware failure occured... (from SerialIo)\r
 \r
-**/   \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 DebugPortPoll (\r
index d2073f65fd29bb02c7fa6ed5b1b262815540d990..290fea69d5c12c9f50d809a3c3d26a1fec4f657c 100644 (file)
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include "DebugSupport.h"\r
+#include "PlDebugSupport.h"\r
 \r
 IA32_IDT_GATE_DESCRIPTOR  NullDesc = {{0}};\r
 \r
@@ -30,7 +30,11 @@ GetInterruptHandleFromIdt (
   )\r
 {\r
   UINTN      InterruptHandle;\r
\r
+\r
+  //\r
+  // InterruptHandle  0-15 : OffsetLow\r
+  // InterruptHandle 16-31 : OffsetHigh\r
+  //\r
   ((UINT16 *) &InterruptHandle)[0] = (UINT16) IdtGateDescriptor->Bits.OffsetLow;\r
   ((UINT16 *) &InterruptHandle)[1] = (UINT16) IdtGateDescriptor->Bits.OffsetHigh;\r
 \r
index 3143bafee734a990960999ab904c6a1efb27ef7c..1a0aeb19015e9a48e41432223c643fba66e1b0ec 100644 (file)
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include "DebugSupport.h"\r
+#include "PlDebugSupport.h"\r
 \r
 IA32_IDT_GATE_DESCRIPTOR  NullDesc = {{0,0}};\r
 \r
@@ -30,7 +30,12 @@ GetInterruptHandleFromIdt (
   )\r
 {\r
   UINTN      InterruptHandle;\r
\r
+\r
+  //\r
+  // InterruptHandle  0-15 : OffsetLow\r
+  // InterruptHandle 16-31 : OffsetHigh\r
+  // InterruptHandle 32-63 : OffsetUpper\r
+  //\r
   ((UINT16 *) &InterruptHandle)[0] = (UINT16) IdtGateDecriptor->Bits.OffsetLow;\r
   ((UINT16 *) &InterruptHandle)[1] = (UINT16) IdtGateDecriptor->Bits.OffsetHigh;\r
   ((UINT32 *) &InterruptHandle)[1] = (UINT32) IdtGateDecriptor->Bits.OffsetUpper;\r
@@ -136,6 +141,6 @@ ManageIdtEntryTable (
       HookEntry (ExceptionType, NewCallback);\r
     }\r
   }\r
\r
+\r
   return Status;\r
 }\r