From 78af0984b45a780e45d57c22c85a1f594b969212 Mon Sep 17 00:00:00 2001 From: Dandan Bi Date: Fri, 5 Oct 2018 16:06:00 +0800 Subject: [PATCH] MdePkg: Add PciRoot/PcieRoot text for ACPI Expanded Device Path REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1228 According to UEFI spec,for ACPI Expanded Device Path when HID=PNP0A03 or CID=PNP0A03 and HID != PNP0A08, the device path node can be displayed as: PciRoot(UID|UIDSTR) When HID=PNP0A08 or CID=PNP0A08, the device path node can be displayed as: PcieRoot(UID|UIDSTR). But current code miss the code logic. This commit is to do the enhancement. Cc: Ruiyu Ni Cc: Michael D Kinney Cc: Liming Gao Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi Reviewed-by: Ruiyu Ni --- .../UefiDevicePathLib/DevicePathToText.c | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c index 8e5efba1e8..7ad9eadf6c 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -433,6 +433,27 @@ DevPathToTextAcpiEx ( UIDStr = HIDStr + AsciiStrLen (HIDStr) + 1; CIDStr = UIDStr + AsciiStrLen (UIDStr) + 1; + if (DisplayOnly) { + if ((EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A03) || + (EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A03 && EISA_ID_TO_NUM (AcpiEx->HID) != 0x0A08)) { + if (AcpiEx->UID == 0) { + UefiDevicePathLibCatPrint (Str, L"PciRoot(%a)", UIDStr); + } else { + UefiDevicePathLibCatPrint (Str, L"PciRoot(0x%x)", AcpiEx->UID); + } + return; + } + + if (EISA_ID_TO_NUM (AcpiEx->HID) == 0x0A08 || EISA_ID_TO_NUM (AcpiEx->CID) == 0x0A08) { + if (AcpiEx->UID == 0) { + UefiDevicePathLibCatPrint (Str, L"PcieRoot(%a)", UIDStr); + } else { + UefiDevicePathLibCatPrint (Str, L"PcieRoot(0x%x)", AcpiEx->UID); + } + return; + } + } + // // Converts EISA identification to string. //