summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-11 15:43:50 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2008-11-11 15:43:50 +0000
commit2067710de051070c1eb0fce033adcb9f6c23b1dc (patch)
treee47c22eda960176ff6dad13f754da3cfa6287ee0 /IntelFrameworkModulePkg
parent1232b21473646661a4ac1ae4b7bf5113d4613e83 (diff)
downloadedk2-platforms-2067710de051070c1eb0fce033adcb9f6c23b1dc.tar.xz
1, Add <Library/DevicePathLib.h> for all source that use device path utility macros
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
Diffstat (limited to 'IntelFrameworkModulePkg')
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c18
-rw-r--r--IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc1
-rw-r--r--IntelFrameworkModulePkg/Library/BaseReportStatusCodeLib/BaseReportStatusCodeLib.c42
-rw-r--r--IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf2
-rw-r--r--IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c4
-rw-r--r--IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h1
-rw-r--r--IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c4
-rw-r--r--IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h1
8 files changed, 23 insertions, 50 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
index 9635cb98e4..584f4f5c9e 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
@@ -612,8 +612,8 @@ StartPciDevicesOnBridge (
//
// Get the next device path
//
- CurrentDevicePath = EfiNextDevicePathNode (RemainingDevicePath);
- if (EfiIsDevicePathEnd (CurrentDevicePath)) {
+ CurrentDevicePath = NextDevicePathNode (RemainingDevicePath);
+ if (IsDevicePathEnd (CurrentDevicePath)) {
return EFI_SUCCESS;
}
@@ -1015,7 +1015,7 @@ GetHpcPciAddress (
//
// Get the remaining device path for this PCI device, if it is a PCI device
//
- while (!EfiIsDevicePathEnd (CurrentDevicePath)) {
+ while (!IsDevicePathEnd (CurrentDevicePath)) {
Node.DevPath = CurrentDevicePath;
@@ -1025,7 +1025,7 @@ GetHpcPciAddress (
if ((Node.DevPath->Type != HARDWARE_DEVICE_PATH) ||
((Node.DevPath->SubType != HW_PCI_DP) &&
(DevicePathNodeLength (Node.DevPath) != sizeof (PCI_DEVICE_PATH)))) {
- CurrentDevicePath = EfiNextDevicePathNode (CurrentDevicePath);
+ CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);
continue;
}
@@ -1035,7 +1035,7 @@ GetHpcPciAddress (
//
// Check if it is not PCI device path
//
- if (EfiIsDevicePathEnd (CurrentDevicePath)) {
+ if (IsDevicePathEnd (CurrentDevicePath)) {
return EFI_NOT_FOUND;
}
@@ -1094,7 +1094,7 @@ GetHpcPciAddressFromRootBridge (
Node.DevPath = CurrentDevicePath;
Temp = NULL;
- while (!EfiIsDevicePathEnd (CurrentDevicePath)) {
+ while (!IsDevicePathEnd (CurrentDevicePath)) {
CurrentLink = RootBridge->ChildList.ForwardLink;
Node.DevPath = CurrentDevicePath;
@@ -1121,14 +1121,14 @@ GetHpcPciAddressFromRootBridge (
}
- CurrentDevicePath = EfiNextDevicePathNode (CurrentDevicePath);
+ CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);
}
if (MisMatch) {
- CurrentDevicePath = EfiNextDevicePathNode (CurrentDevicePath);
+ CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);
- if (EfiIsDevicePathEnd (CurrentDevicePath)) {
+ if (IsDevicePathEnd (CurrentDevicePath)) {
*PciAddress = EFI_PCI_ADDRESS (RootBridge->BusNumber, Node.Pci->Device, Node.Pci->Function, 0);
return EFI_SUCCESS;
}
diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
index c647fbaf30..56523edd96 100644
--- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
+++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dsc
@@ -55,6 +55,7 @@
SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf
S3Lib|IntelFrameworkModulePkg/Library/PeiS3Lib/PeiS3Lib.inf
RecoveryLib|IntelFrameworkModulePkg/Library/PeiRecoveryLib/PeiRecoveryLib.inf
+ DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
[LibraryClasses.common.PEIM]
HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf
diff --git a/IntelFrameworkModulePkg/Library/BaseReportStatusCodeLib/BaseReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/BaseReportStatusCodeLib/BaseReportStatusCodeLib.c
index acfc358598..2345cb7adb 100644
--- a/IntelFrameworkModulePkg/Library/BaseReportStatusCodeLib/BaseReportStatusCodeLib.c
+++ b/IntelFrameworkModulePkg/Library/BaseReportStatusCodeLib/BaseReportStatusCodeLib.c
@@ -61,36 +61,6 @@ InternalReportStatusCode (
/**
- Computes and returns the size, in bytes, of a device path.
-
- @param DevicePath A pointer to a device path.
-
- @return The size, in bytes, of DevicePath.
-
-**/
-UINTN
-InternalReportStatusCodeDevicePathSize (
- IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
- )
-{
- CONST EFI_DEVICE_PATH_PROTOCOL *Start;
-
- //
- // Search for the end of the device path structure
- //
- Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
- }
-
- //
- // Subtract the start node from the end node and add in the size of the end node
- //
- return ((UINTN) DevicePath - (UINTN) Start) + DevicePathNodeLength (DevicePath);
-}
-
-
-/**
Converts a status code to an 8-bit POST code value.
Converts the status code specified by CodeType and Value to an 8-bit POST code
@@ -340,12 +310,12 @@ ReportStatusCodeWithDevicePath (
)
{
ASSERT (DevicePath != NULL);
- return ReportStatusCodeWithExtendedData (
- Type,
- Value,
- (VOID *)DevicePath,
- InternalReportStatusCodeDevicePathSize (DevicePath)
- );
+
+ //
+ // this function can *not* be implemented for BASE library.
+ //
+ ASSERT (FALSE);
+ return EFI_UNSUPPORTED;
}
diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
index 1788f0201c..b476fc6338 100644
--- a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
+++ b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/DxeReportStatusCodeLib.inf
@@ -49,7 +49,7 @@
UefiBootServicesTableLib
DebugLib
UefiRuntimeServicesTableLib
-
+ DevicePathLib
[Guids]
gEfiStatusCodeSpecificDataGuid # ALWAYS_CONSUMED
diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
index df6e808f68..01bb6dfce8 100644
--- a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
+++ b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
@@ -86,8 +86,8 @@ InternalReportStatusCodeDevicePathSize (
// Search for the end of the device path structure
//
Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
+ while (!IsDevicePathEnd (DevicePath)) {
+ DevicePath = NextDevicePathNode (DevicePath);
}
//
diff --git a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
index 5f4c7abf9b..25262bc0b3 100644
--- a/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
+++ b/IntelFrameworkModulePkg/Library/DxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
@@ -24,6 +24,7 @@
#include <Library/BaseMemoryLib.h>
#include <Library/PcdLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
+#include <Library/DevicePathLib.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Protocol/StatusCode.h>
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
index a8b1449746..f377481858 100644
--- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
+++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLib.c
@@ -88,8 +88,8 @@ InternalReportStatusCodeDevicePathSize (
// Search for the end of the device path structure
//
Start = DevicePath;
- while (!EfiIsDevicePathEnd (DevicePath)) {
- DevicePath = EfiNextDevicePathNode (DevicePath);
+ while (!IsDevicePathEnd (DevicePath)) {
+ DevicePath = NextDevicePathNode (DevicePath);
}
//
diff --git a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
index c64e49b1ba..636f034fb3 100644
--- a/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
+++ b/IntelFrameworkModulePkg/Library/SmmRuntimeDxeReportStatusCodeLibFramework/ReportStatusCodeLibInternal.h
@@ -24,6 +24,7 @@
#include <Library/PcdLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DevicePathLib.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Protocol/StatusCode.h>