]> git.proxmox.com Git - mirror_edk2.git/commitdiff
1, Add <Library/DevicePathLib.h> for all source that use device path utility macros
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Nov 2008 15:43:50 +0000 (15:43 +0000)
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>
Tue, 11 Nov 2008 15:43:50 +0000 (15:43 +0000)
2, Add DevicePathLib library class to module's INF that use device path utility macros

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

IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
IntelFrameworkModulePkg/Library/BaseReportStatusCodeLib/BaseReportStatusCodeLib.c
IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h

index 9635cb98e48e5e366124bbae4e7d574964928888..584f4f5c9ef07dffa556e22d0a4b7ce4dbf97078 100644 (file)
@@ -612,8 +612,8 @@ StartPciDevicesOnBridge (
       //\r
       // Get the next device path\r
       //\r
-      CurrentDevicePath = EfiNextDevicePathNode (RemainingDevicePath);\r
-      if (EfiIsDevicePathEnd (CurrentDevicePath)) {\r
+      CurrentDevicePath = NextDevicePathNode (RemainingDevicePath);\r
+      if (IsDevicePathEnd (CurrentDevicePath)) {\r
         return EFI_SUCCESS;\r
       }\r
 \r
@@ -1015,7 +1015,7 @@ GetHpcPciAddress (
   //\r
   // Get the remaining device path for this PCI device, if it is a PCI device\r
   //\r
-  while (!EfiIsDevicePathEnd (CurrentDevicePath)) {\r
+  while (!IsDevicePathEnd (CurrentDevicePath)) {\r
 \r
     Node.DevPath = CurrentDevicePath;\r
 \r
@@ -1025,7 +1025,7 @@ GetHpcPciAddress (
     if ((Node.DevPath->Type != HARDWARE_DEVICE_PATH) ||\r
         ((Node.DevPath->SubType != HW_PCI_DP)         &&\r
          (DevicePathNodeLength (Node.DevPath) != sizeof (PCI_DEVICE_PATH)))) {\r
-      CurrentDevicePath = EfiNextDevicePathNode (CurrentDevicePath);\r
+      CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);\r
       continue;\r
     }\r
 \r
@@ -1035,7 +1035,7 @@ GetHpcPciAddress (
   //\r
   // Check if it is not PCI device path\r
   //\r
-  if (EfiIsDevicePathEnd (CurrentDevicePath)) {\r
+  if (IsDevicePathEnd (CurrentDevicePath)) {\r
     return EFI_NOT_FOUND;\r
   }\r
 \r
@@ -1094,7 +1094,7 @@ GetHpcPciAddressFromRootBridge (
   Node.DevPath      = CurrentDevicePath;\r
   Temp              = NULL;\r
 \r
-  while (!EfiIsDevicePathEnd (CurrentDevicePath)) {\r
+  while (!IsDevicePathEnd (CurrentDevicePath)) {\r
 \r
     CurrentLink   = RootBridge->ChildList.ForwardLink;\r
     Node.DevPath  = CurrentDevicePath;\r
@@ -1121,14 +1121,14 @@ GetHpcPciAddressFromRootBridge (
 \r
     }\r
 \r
-    CurrentDevicePath = EfiNextDevicePathNode (CurrentDevicePath);\r
+    CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);\r
   }\r
 \r
   if (MisMatch) {\r
 \r
-    CurrentDevicePath = EfiNextDevicePathNode (CurrentDevicePath);\r
+    CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);\r
 \r
-    if (EfiIsDevicePathEnd (CurrentDevicePath)) {\r
+    if (IsDevicePathEnd (CurrentDevicePath)) {\r
       *PciAddress = EFI_PCI_ADDRESS (RootBridge->BusNumber, Node.Pci->Device, Node.Pci->Function, 0);\r
       return EFI_SUCCESS;\r
     }\r
index c647fbaf3081978c108c5fa4dbcd0334d9911ac0..56523edd960d99a54eb0b7abfaae94b0bc216905 100644 (file)
@@ -55,6 +55,7 @@
   SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf\r
   S3Lib|IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf\r
   RecoveryLib|IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf\r
+  DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf\r
   \r
 [LibraryClasses.common.PEIM]\r
   HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf\r
index acfc358598a776c8d6503a24007dab9f74359096..2345cb7adb8291744259e90d32e0caf613022f78 100644 (file)
@@ -60,36 +60,6 @@ InternalReportStatusCode (
 }\r
 \r
 \r
-/**\r
-  Computes and returns the size, in bytes, of a device path.\r
-\r
-  @param  DevicePath  A pointer to a device path.\r
-\r
-  @return  The size, in bytes, of DevicePath.\r
-\r
-**/\r
-UINTN\r
-InternalReportStatusCodeDevicePathSize (\r
-  IN CONST EFI_DEVICE_PATH_PROTOCOL  *DevicePath\r
-  )\r
-{\r
-  CONST EFI_DEVICE_PATH_PROTOCOL  *Start;\r
-\r
-  //\r
-  // Search for the end of the device path structure\r
-  //\r
-  Start = DevicePath;\r
-  while (!EfiIsDevicePathEnd (DevicePath)) {\r
-    DevicePath = EfiNextDevicePathNode (DevicePath);\r
-  }\r
-\r
-  //\r
-  // Subtract the start node from the end node and add in the size of the end node\r
-  //\r
-  return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);\r
-}\r
-\r
-\r
 /**\r
   Converts a status code to an 8-bit POST code value.\r
 \r
@@ -340,12 +310,12 @@ ReportStatusCodeWithDevicePath (
   )\r
 {\r
   ASSERT (DevicePath != NULL);\r
-  return ReportStatusCodeWithExtendedData (\r
-           Type,\r
-           Value,\r
-           (VOID *)DevicePath,\r
-           InternalReportStatusCodeDevicePathSize (DevicePath)\r
-           );\r
+  \r
+  //\r
+  // this function can *not* be implemented for BASE library.\r
+  //\r
+  ASSERT (FALSE);\r
+  return EFI_UNSUPPORTED;\r
 }\r
 \r
 \r
index 1788f0201ce7d6c9731a93bbd03dbefa1d646dcc..b476fc6338e2a5ad7bad2521c37fcc4fe160c4b8 100644 (file)
@@ -49,7 +49,7 @@
   UefiBootServicesTableLib\r
   DebugLib\r
   UefiRuntimeServicesTableLib\r
-\r
+  DevicePathLib\r
 \r
 [Guids]\r
   gEfiStatusCodeSpecificDataGuid                # ALWAYS_CONSUMED\r
index df6e808f68c272fea42104fe56303d54bfd8ee22..01bb6dfce8ee3b2e9df05a3737e895bfa84c3d4a 100644 (file)
@@ -86,8 +86,8 @@ InternalReportStatusCodeDevicePathSize (
   // Search for the end of the device path structure\r
   //\r
   Start = DevicePath;\r
-  while (!EfiIsDevicePathEnd (DevicePath)) {\r
-    DevicePath = EfiNextDevicePathNode (DevicePath);\r
+  while (!IsDevicePathEnd (DevicePath)) {\r
+    DevicePath = NextDevicePathNode (DevicePath);\r
   }\r
 \r
   //\r
index 5f4c7abf9be40f1865508b8e5c39f64d5bbce608..25262bc0b3ddf32b36c546b4a6f75fe9d97ad6b2 100644 (file)
@@ -24,6 +24,7 @@
 #include <Library/BaseMemoryLib.h>\r
 #include <Library/PcdLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
 \r
 #include <Guid/StatusCodeDataTypeId.h>\r
 #include <Protocol/StatusCode.h>\r
index a8b144974635985f082cbda28777eac773ee71ea..f377481858ce089aa40e195df684b37d488d6a54 100644 (file)
@@ -88,8 +88,8 @@ InternalReportStatusCodeDevicePathSize (
   // Search for the end of the device path structure\r
   //\r
   Start = DevicePath;\r
-  while (!EfiIsDevicePathEnd (DevicePath)) {\r
-    DevicePath = EfiNextDevicePathNode (DevicePath);\r
+  while (!IsDevicePathEnd (DevicePath)) {\r
+    DevicePath = NextDevicePathNode (DevicePath);\r
   }\r
 \r
   //\r
index c64e49b1bafeee9b9e3f0dee9160ba02f9f88b77..636f034fb371b0cbfd1aa6a9113569d19d0cc375 100644 (file)
@@ -24,6 +24,7 @@
 #include <Library/PcdLib.h>\r
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/DevicePathLib.h>\r
 \r
 #include <Guid/StatusCodeDataTypeId.h>\r
 #include <Protocol/StatusCode.h>\r