From a51ae7212d30f3e2c1ae71419207d569fab97e88 Mon Sep 17 00:00:00 2001 From: Jose Luis Duran Date: Wed, 23 Feb 2022 13:50:19 -0300 Subject: [PATCH] libefivar: Add PciRoot/PcieRoot text for ACPI Expanded Device Path 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. Upstream Bug: https://bugzilla.tianocore.org/show_bug.cgi?id=1228 Obtained from: https://github.com/tianocore/edk2/commit/78af0984b45a780e45d57c22c85a1f594b969212 Pull Request: https://github.com/freebsd/freebsd-src/pull/581 --- lib/libefivar/efivar-dp-format.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/lib/libefivar/efivar-dp-format.c b/lib/libefivar/efivar-dp-format.c index 24f4cdc94d98..e2a5e666ce7b 100644 --- a/lib/libefivar/efivar-dp-format.c +++ b/lib/libefivar/efivar-dp-format.c @@ -492,6 +492,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, "PciRoot(%s)", UIDStr); + } else { + UefiDevicePathLibCatPrint (Str, "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, "PcieRoot(%s)", UIDStr); + } else { + UefiDevicePathLibCatPrint (Str, "PcieRoot(0x%x)", AcpiEx->UID); + } + return; + } + } + // // Converts EISA identification to string. //