X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=OvmfPkg%2FLibrary%2FPxeBcPcdProducerLib%2FPxeBcPcd.c;fp=OvmfPkg%2FLibrary%2FPxeBcPcdProducerLib%2FPxeBcPcd.c;h=7ce236326fb4937093b4db656fac08787eab3ea0;hp=0000000000000000000000000000000000000000;hb=b8b890ca0a91e1a9101cd067a768d59926c454b9;hpb=237773324887503a33a8fcf9b7b29dc26a6f942a diff --git a/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcd.c b/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcd.c new file mode 100644 index 0000000000..7ce236326f --- /dev/null +++ b/OvmfPkg/Library/PxeBcPcdProducerLib/PxeBcPcd.c @@ -0,0 +1,39 @@ +/** @file + Configure some PCDs dynamically for + "NetworkPkg/UefiPxeBcDxe/UefiPxeBcDxe.inf", from QEMU's fw_cfg. + + Copyright (C) 2020, Red Hat, Inc. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include + +RETURN_STATUS +EFIAPI +SetPxeBcPcds ( + VOID + ) +{ + BOOLEAN FwCfgBool; + RETURN_STATUS PcdStatus; + + if (!RETURN_ERROR (QemuFwCfgParseBool ("opt/org.tianocore/IPv4PXESupport", + &FwCfgBool))) { + PcdStatus = PcdSet8S (PcdIPv4PXESupport, FwCfgBool); + if (RETURN_ERROR (PcdStatus)) { + return PcdStatus; + } + } + + if (!RETURN_ERROR (QemuFwCfgParseBool ("opt/org.tianocore/IPv6PXESupport", + &FwCfgBool))) { + PcdStatus = PcdSet8S (PcdIPv6PXESupport, FwCfgBool); + if (RETURN_ERROR (PcdStatus)) { + return PcdStatus; + } + } + + return RETURN_SUCCESS; +}