summaryrefslogtreecommitdiff
path: root/UefiPayloadPkg/PayloadLoaderPeim
AgeCommit message (Collapse)AuthorFilesLines
2023-01-31UefiPayloadPkg: Set RTC dynamic PCD to PeiPCDdatabaseKasimX Liu1-0/+5
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4193 In order to remove RTC_INDEX/RTC_TARGET from the UplBuild macro list,change the RTC_INDEX /RTC_TARGET type from PcdsFixedAtBuild to PcdsDynamicEx Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: James Lu <james.lu@intel.com> Reviewed-by: Gua Guo <gua.guo@intel.com> Signed-off-by: KasimX Liu <kasimx.liu@intel.com>
2022-09-16UefiPayloadPkg/PayloadLoaderPeim: remove GCC build warningJames Lu1-17/+12
Fix the gcc build warning: variable PldInfo set but not used [-Wunused-but-set-variable] Reviewed-by: James Lu <james.lu@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Gang Chen <gang.c.chen@intel.com>
2022-08-23UefiPayloadPkg: Fix Coverity report defectJames Lu1-1/+1
https://bugzilla.tianocore.org/show_bug.cgi?id=4018 Coverity report FORWARD_NULL and OVERFLOW_BEFORE_WIDEN potential defect in UefiPayloadPkg. Signed-off-by: Gregx Yeh <gregx.yeh@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: James Lu <james.lu@intel.com>
2022-07-27UefiPayloadPkg: Fix RelaAddress type always mismatch in if conditionJames Lu1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3984 Under function RolocateElfDynamic() in Elf32Lib.c if (RelaAddress == MAX_UINT64) is always FALSE while RelaAddress is UINT32 Fix is to modify if condition check to "if (RelaAddress == MAX_UINT32)" Cc: Ray Ni <ray.ni@intel.com> Cc: Guo Dong <guo.dong@intel.com> Cc: Gua Guo <gua.guo@intel.com> Signed-off-by: James Lu <james.lu@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com>
2022-03-01UefiPayloadPkg/PayloadLoaderPeim: Use INT64 as input parameterGuomin Jiang1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3818 It will have some potential issue when memory larger than 2G because the high memory address will be fill with 0xFFFFFFFF when do the operation of INTN + INT64 but it is 32 bit normal data in fact. Should use same data type INT64 + INT64. V3: 1. Use INT64 as input parameter because all date type is 64 bit V2: 1. Force the data type to UINTN to avoid high dword be filled with 0xFFFFFFFF 2. Keep INTN because the offset may postive or negative. Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com>
2021-12-07UefiPayloadPkg: Apply uncrustify changesMichael Kubacki9-1215/+1259
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the UefiPayloadPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2021-12-07UefiPayloadPkg: Change OPTIONAL keyword usage styleMichael D Kinney1-2/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3760 Update all use of ', OPTIONAL' to ' OPTIONAL,' for function params. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2021-07-13UefiPayloadPkg: Assign the length of UniversalPayload ExtraDataTan, Dun1-1/+5
V1: Assign the length and revision of UniversalPayload ExtraData V2: Force int to UINT16 V3: Create a local variable to hold the size of ExtraData Cc: Guo Dong <guo.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Cc: Benjamin You <benjamin.you@intel.com> Signed-off-by: DunTan <dun.tan@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2021-06-30UefiPayloadPkg/PayloadLoader: Remove assertionRay Ni2-2/+0
For R_386_RELATIVE and R_X86_64_RELATIVE, today's logic assumes that the content pointed by the Rela->r_offset is 0 but it's not always TRUE. We observed that linker may set the content to Rela->r_addend. The patch removes the assertion. There is no functionality impact for this patch. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
2021-06-30UefiPayloadPkg/PayloadLoader: Fix bug in locating relocation sectionRay Ni2-14/+30
Per ELF spec, the DT_REL/DT_RELA tag in dynamic section stores the virtual address of the relocation section. But today's code logic treats it as the section offset and finds the relocation section whose offset equals to DT_REL/DT_RELA. The logic can work when the section offset equals to the section virtual address. But when the ELF is generated from the link script that reserves a sizeof(pe_header) in the file beginning, the section offset doesn't equal to section virtual address. Such logic can not find the relocation section. The patch fixes this bug. Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>
2021-06-16UefiPayloadPkg: Add PayloadLoaderPeim which can load ELF payloadRay Ni10-0/+3350
Per universal payload spec, the payload is in ELF format. The patch adds a payload loader that supports to load ELF image. The location of extra data sections whose names start with "upld." is stored in UNIVERSAL_PAYLOAD_EXTRA_DATA HOB. Signed-off-by: Maurice Ma <maurice.ma@intel.com> Signed-off-by: Ray Ni <ray.ni@intel.com> Cc: Maurice Ma <maurice.ma@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Cc: Benjamin You <benjamin.you@intel.com>