From 2067710de051070c1eb0fce033adcb9f6c23b1dc Mon Sep 17 00:00:00 2001 From: klu2 Date: Tue, 11 Nov 2008 15:43:50 +0000 Subject: 1, Add 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 --- .../BaseReportStatusCodeLib.c | 42 ++++------------------ .../DxeReportStatusCodeLib.inf | 2 +- .../ReportStatusCodeLib.c | 4 +-- .../ReportStatusCodeLibInternal.h | 1 + .../ReportStatusCodeLib.c | 4 +-- .../ReportStatusCodeLibInternal.h | 1 + 6 files changed, 13 insertions(+), 41 deletions(-) (limited to 'IntelFrameworkModulePkg/Library') 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 @@ -60,36 +60,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. @@ -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 #include #include +#include #include #include 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 #include #include +#include #include #include -- cgit v1.2.3