diff options
author | Jose Luis Duran <jlduran@gmail.com> | 2022-02-23 16:50:19 +0000 |
---|---|---|
committer | Warner Losh <imp@FreeBSD.org> | 2022-02-27 16:13:08 +0000 |
commit | a51ae7212d30f3e2c1ae71419207d569fab97e88 (patch) | |
tree | 37251822f22032b4e182d6e56afab213998f246c | |
parent | ac2b16d3b11b88ba1f3023de3645575542be4ca3 (diff) | |
download | src-a51ae7212d30f3e2c1ae71419207d569fab97e88.tar.gz src-a51ae7212d30f3e2c1ae71419207d569fab97e88.zip |
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
-rw-r--r-- | lib/libefivar/efivar-dp-format.c | 21 |
1 files changed, 21 insertions, 0 deletions
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. // |