summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Library
AgeCommit message (Collapse)AuthorFilesLines
2023-11-30EmbeddedPkg: Allow longer android kernel command lineAshish Singhal2-2/+3
AndroidBootImgLib allows for platforms to append to kernel command line but does not allow for the overall kernel command line to go beyond the limit set by the image header. Address this limitation by adding a pcd where platform can tell how many extra characters they expect on their platform in addition to what the image header specifies. Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
2023-11-30EmbeddedPkg: Fix Android Boot Command Line Length BugAshish Singhal1-13/+18
Curently, AndroidBootImgLib expects input kernel command line to never exceed 256 unicode characters where the image header allows for 512 ascii characters. If image header allows 512 ascii characters, similar number of unicode characters should be allowed at the minimum. Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
2023-10-20EmbeddedPkg/NorFlashInfoLib: Update norflash device listJohn Chew1-1/+10
Update Gigadevice norflash list: gd25q16, gd25q32, gd25q64, gd25lq64c, gd25q128, gd25lq128, gd25q256 Add Silicon Kaiser norflash list: sk25lp128 Signed-off-by: John Chew <yuinyee.chew@starfivetech.com> Acked-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2023-10-18EmbeddedPkg/VirtualRealTimeClockLib: drop LibRtcVirtualNotifyEventLaszlo Ersek1-18/+0
The RealTimeClockLib class header in edk2 mistakenly declares a function called LibRtcVirtualNotifyEvent(). No component ever calls this function crossing module boundaries; all RealTimeClockLib instances in edk2 and edk2-platforms are supposed to register (and do register) their SetVirtualAddressMap() notification functions. In particular, VirtualRealTimeClockLib *itself* doesn't even use LibRtcVirtualNotifyEvent() -- the function is defined with an empty body, clearly in an understandable, but misguided, attempt, to conform to the (bogus) library interface. Remove the function. Build-tested only (with "RiscVVirtQemu.dsc"). Cc: Abner Chang <abner.chang@amd.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231012091057.108728-5-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-10-18EmbeddedPkg/TemplateRealTimeClockLib: drop LibRtcVirtualNotifyEventLaszlo Ersek1-24/+0
The RealTimeClockLib class header in edk2 mistakenly declares a function called LibRtcVirtualNotifyEvent(). No component ever calls this function crossing module boundaries; all RealTimeClockLib instances in edk2 and edk2-platforms are supposed to register (and do register) their SetVirtualAddressMap() notification functions. In particular, TemplateRealTimeClockLib *itself* doesn't even use LibRtcVirtualNotifyEvent() -- the function is defined with an empty body, clearly in an understandable, but misguided, attempt, to conform to the (bogus) library interface. Remove the function. Build-tested only (with "EmbeddedPkg.dsc"). Cc: Abner Chang <abner.chang@amd.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Leif Lindholm <quic_llindhol@quicinc.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=4564 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20231012091057.108728-4-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-04-10EmbeddedPkg: Update code to be more C11 compliant by using __func__Rebecca Cran1-1/+1
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among others support, while __func__ was standardized in C99. Since it's more standard, replace __FUNCTION__ with __func__ throughout EmbeddedPkg. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Abner Chang <abner.chang@amd.com>
2023-02-04EmbeddedPkg/PrePiLib: Drop unused PCD PcdPrePiCpuIoSizeArd Biesheuvel1-2/+0
The code never references the PCD so the INF should not reference it either. The last reference was moved to PrePiHobLib in commit 05e48e00834b32e4bd2 (dated 2011!) and dropped from there as well in commit 97106391955337155e7. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Abner Chang <abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me> Reported-by: Sunil V L <sunilvl@ventanamicro.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
2023-01-19EmbeddedPkg: Add back FfsFindSectionDataMin M Xu1-0/+23
In commit c673216f53 a new input parameter is added in FfsFindSectionData. That change breaks the build of ArmVirtPkg. In this patch FfsFindSectionData is added back. It calls FfsFindSectionDataWithHook with a NULL hook. Signed-off-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-01-19EmbeddedPkg: Rename FfsFindSectionData as FfsFindSectionDataWithHookMin M Xu2-5/+7
Commit c673216f53 introduces FFS_CHECK_SECTION_HOOK and add it as the second input parameter in FfsFindSectionData. This change breaks the build of ArmVirtPkg. To fix this issue, the new version of FfsFindSectionData is renamed as FfsFindSectionDataWithHook in this patch. In the following patch the original FfsFindSectionData will be added back. FfsFindSectionData is renamed as FfsFindSectionDataWithHook. Accordingly PeilessStartupLib in OvmfPkg should be updated as well. To prevent the build from being broken, the changes in OvmfPkg are in this patch. Signed-off-by: Min Xu <min.m.xu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2023-01-18EmbeddedPkg/PrePiLib: Add FFS_CHECK_SECTION_HOOK when finding sectionMin M Xu2-13/+31
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4152 EmbeddedPkg/PrePiLib provides the service of finding sections based on the input SectionType. But sometimes there maybe multiple sections with the same SectionType. FFS_CHECK_SECTION_HOOK is a hook which can be called to do additional check. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Erdem Aktas <erdemaktas@google.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Tom Lendacky <thomas.lendacky@amd.com> Acked-by: Ard Biesheuvel <ardb+tianocore@kernel.org> Signed-off-by: Min Xu <min.m.xu@intel.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2022-10-03EmbeddedPkg/AcpiLib: Fix code formatting errorsMichael Kubacki1-48/+50
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4046 This package did not have CI enabled so code changes were merged that fail uncrustify formatting. This change updates those files to include uncustify formatting. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
2022-09-23EmbeddedPkg/PrePi: Check for enough space before aligning heap pointerJeff Brasen1-27/+21
Update check for enough space to occur prior to alignment offset. This prevents cases where EfiFreeMemoryTop < EfiFreeMemoryBottom. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-09-06EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLibMin M Xu1-16/+49
AllocateRuntimePages is used to allocate one or more 4KB pages of type EfiRuntimeServicesData. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ard Biesheuvel <ardb+tianocore@kernel.org> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
2022-09-05EmbeddedPkg/GdbSerialDebugPortLib: fix compile warningWenyi Xie1-1/+1
The value of gTimeOut is from PcdGdbMaxPacketRetryCount, and this PCD is UINT32. So change the declaratrion of gTimeOut to UINT32 to fix compile warning. Signed-off-by: Wenyi Xie <xiewenyi2@huawei.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2022-09-05EmbeddedPkg: Remove duplicated wordsPierre Gondois4-4/+4
In an effort to clean the documentation of the above package, remove duplicated words. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com> Reviewed-by: Abner Chang <abner.chang@amd.com>
2022-01-27EmbeddedPkg: Fix a build error in FwVol.c in X64 archMin Xu1-3/+3
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3814 CompressedDataLength is declared as UINTN which is UINT64 in X64 arch. But the second parameter of UefiDecompressGetInfo() is declared as UINT32. So a build error is triggered. To declare CompressedDataLength as UINT32 to fix the build error. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@hpe.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
2021-12-17EmbeddedPkg/AcpiLib: Add more helper functionsNhi Pham2-0/+220
This adds more helper functions that assist in calculating the checksum, locating an ACPI table by signature, and updating an AML integer object. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Acked-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Abner Chang <abner.chang@hpe.com>
2021-12-07EmbeddedPkg: Apply uncrustify changesMichael Kubacki30-3386/+4373
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmbeddedPkg 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: Andrew Fish <afish@apple.com>
2021-12-07EmbeddedPkg: Change OPTIONAL keyword usage styleMichael D Kinney4-5/+4
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: Andrew Fish <afish@apple.com>
2021-12-07EmbeddedPkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney4-17/+9
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. 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: Ard Biesheuvel <ardb@kernel.org>
2021-09-23EmbeddedPkg: Add LoadFile2 for linux initrdJeff Brasen2-22/+201
Add support under a pcd feature for using the new interface to pass initrd to the linux kernel instead of via device tree. This feature is also enabled if ACPI tables are present, and will skip locating and installation of device tree. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-09-23EmbeddedPkg: Install FDT if UpdateDtb is not presentJeff Brasen1-5/+6
Currently if mAndroidBootImg->UpdateDtb is not supported on the platform the device tree updates of the initrd are not made. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-09-23EmbeddedPkg: AndroidBootImgBoot error handling updatesJeff Brasen1-21/+29
Update AndroidBootImgBoot to use a single return point Make sure Kernel args are freed and Image is unloaded. Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-09-23EmbeddedPkg: Remove duplicate libfdt.h includeJeff Brasen1-2/+0
Remove duplicate libfdt.h include statement in AndroidBootImgLib Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-08-17EmbeddedPkg/NonCoherentDmaLib: Avoid dereferencing unset Map fieldJeremy Linton1-1/+1
Map->Operation is used to select whether a DMA region that is being bounced has the source buffer copied to it. Except Map->Operation isn't yet set, so the behavior is somewhat random. Instead use the passed in Operation parameter. Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-07-29EmbeddedPkg/VirtualRealTimeClockLib: Fix SetTime issuesSunny Wang1-3/+3
This patch fixes two issues below: 1. SCT SetTime_Func failures. - https://github.com/pftf/RPi4/issues/164 2. Using shell time and date commands to set time can't work. The problem is that gRT->SetTime always returns EFI_INVALID_PARAMETER error status. The root cause is that LibSetTime() sets RtcEpochSeconds variable with inconsistent attributes. One is without EFI_VARIABLE_NON_VOLATILE, the other one is with EFI_VARIABLE_NON_VOLATILE. That caused that the variable driver returns EFI_INVALID_PARAMETER. Per UEFI spec, if a preexisting variable is rewritten with different attributes, SetVariable() shall not modify the variable and shall return EFI_INVALID_PARAMETER. Therefore, the solution is to add EFI_VARIABLE_NON_VOLATILE attribute to the first EfiSetVariable() call to make two calls consistent. By the way, this patch also fix a minor issue with a debug message. Signed-off-by: Sunny Wang <sunny.wang@arm.com> Reviewed-by: Pete Batard <pete@akeo.ie> Tested-by: Pete Batard <pete@akeo.ie>
2021-03-16EmbeddedPkg/PrePiHobLib: replace duplicate GUIDMatthew Carlson1-1/+1
Currently there is a duplicate GUID shared by two INFs. This rolls the INF for the PrePiHobLib. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2381 Signed-off-by: Matthew Carlson <matthewfcarlson@gmail.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-03-08EmbeddedPkg: Only print LibGetTime message about compile time epoch onceRebecca Cran1-1/+9
The message "LibGetTime: RtcEpochSeconds non volatile variable was not found - Using compilation time epoch." can be printed a very large number of times, causing log files to become excessively large. This is because the RtcEpochSeconds variable only gets set if LibSetTime is called, for example by running 'time 12:00' in the UEFI Shell. Avoid this by setting RtcEpochSeconds to BUILD_EPOCH (EpochSeconds) after printing the message. It's set to a volatile variable so the message will be displayed on future boots and not hidden. Commit 44ae214591e58af468eacb7b873eaa0bc187c4fa reduced the verbosity of the message to DEBUG_VERBOSE. Revert it back to DEBUG_INFO so it's more prominent now that it doesn't get printed so frequently. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-02-20EmbeddedPkg/VirtualRealTimeClockLib: Reduce DEBUG message verbositySamer El-Haj-Mahmoud1-1/+1
The DEBUG message for using compilation time epoch is appearing very frequently on DEBUG firmware builds, for example during UEFI SCT runs. Reduce verbosity to avoid the annoying repetitive message. Signed-off-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-01-08EmbeddedPkg/PrePiMemoryAllocationLib: use correct size for pool hobArd Biesheuvel1-1/+3
Use the correct type in the sizeof() expression to calculate the size of the newly allocated EFI_HOB_MEMORY_POOL hob. Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3139 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-01-07EmbeddedPkg/TimeBaseLib: Add function to check Timezone and DaylightNhi Pham1-2/+47
This adds two functions IsValidTimeZone() and IsValidDaylight() to check the time zone and daylight value from EFI time. These functions are retrieved from the RealTimeClockRuntimeDxe module as they reduce duplicated code in RTC modules. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-01-07EmbeddedPkg/TimeBaseLib: Fix for minor code formattingNhi Pham1-12/+11
There is no functional modification in this change. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2021-01-07EmbeddedPkg/TimeBaseLib: Update comment blocks for API functionsNhi Pham1-8/+56
This updates Doxygen comment blocks for API library functions. Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2020-12-21EmbeddedPkg/TimeBaseLib: remove useless truncation to 32-bitLaszlo Ersek1-3/+3
EfiTimeToEpoch() calls EfiGetEpochDays() internally, which (reasonably) returns a UINTN. But then EfiTimeToEpoch() truncates the EfiGetEpochDays() retval to UINT32 for no good reason, effectively restricting Time->Year under 2106. This truncation was pointed out with a valid warning (= build error) by VS2019. Allow EfiTimeToEpoch() to return / propagate a UINTN value. Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20201221113657.6779-3-lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-10-22EmbeddedPkg/VirtualRealTimeClockLib: Explicit cast to UINT32Pete Batard1-2/+2
Addresses BZ https://bugzilla.tianocore.org/show_bug.cgi?id=2380 where explicit casts are required for 64 to 32 bit assignment. We can apply a straight cast for Time->Nanosecond since we already checked for overflow. On the other hand, we may have a frequency that is greater than UINT32_MAX for Capabilities->Resolution. But using the frequency for the resolution is the wrong approach anyway, since we can't actually vouch for the actual resolution of the virtual library. Instead, play it safe by defaulting to 1 Hz, which is what a standard PC-AT CMOS RTC device would use. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
2020-07-23EmbeddedPkg: fix gcc build errors in AndroidBootImgLibLeif Lindholm1-2/+2
Commit dbd546a32d5a ("BaseTools: Add gcc flag to warn on void* pointer arithmetic") does its work and triggers build errors in this library. Update the affected code to build correctly again. Cc: Pierre Gondois <pierre.gondois@arm.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Bob Feng<bob.c.feng@intel.com> Reported-by: Pierre Gondois <pierre.gondois@arm.com> Signed-off-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2020-06-17EmbeddedPkg/NonCoherentDmaLib: avoid dereferencing bogus buffer addressArd Biesheuvel1-2/+1
The bounce buffering code in NonCoherentDmaLib copies data into the bounce buffer using CopyMem(), but passes Map->HostAddress as the source of the copy before it has been assigned its correct value. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Andrei Warkentin <awarkentin@vmware.com>
2019-12-06EmbeddedPkg/NonCoherentDmaLib: implement support for DMA range limitsArd Biesheuvel2-12/+154
Implement support for driving peripherals with limited DMA ranges to NonCoherentDmaLib, by adding a device address limit, and taking it, along with the device offset, into account when allocating or mapping DMA buffers. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Pete Batard <pete@akeo.ie> Acked-by: Philippe Mathieu-Daude <philmd@redhat.com> Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-10-04EmbeddedPkg: delete outdated FdtLib README.txtLeif Lindholm1-1/+0
While looking at encoding and line ending errors, I found this file in fact simply points to a sourceforge page which no longer exists. Since there is nothing more to say than "this is an import of libfdt", let's just delete it. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2019-10-04EmbeddedPkg: add missing newline at end of TemplateResetSystemLib.infLeif Lindholm1-1/+1
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2019-09-25EmbeddedPkg: Unload image on EFI_SECURITY_VIOLATIONDandan Bi1-0/+12
For the LoadImage() boot service, with EFI_SECURITY_VIOLATION retval, the Image was loaded and an ImageHandle was created with a valid EFI_LOADED_IMAGE_PROTOCOL, but the image can not be started right now. This follows UEFI Spec. But if the caller of LoadImage() doesn't have the option to defer the execution of an image, we can not treat EFI_SECURITY_VIOLATION like any other LoadImage() error, we should unload image for the EFI_SECURITY_VIOLATION to avoid resource leak. This patch is to do error handling for EFI_SECURITY_VIOLATION explicitly for the callers in EmbeddedPkg which don't have the policy to defer the execution of the image. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1992 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2019-07-23EmbeddedPkg: list module-internal header files in INF [Sources]Laszlo Ersek2-0/+2
The BaseTools build feature introduced for TianoCore#1804 / in commit 1fa6699e6cd4 ("BaseTools: Add a checking for Sources section in INF file", 2019-06-10) logs some (non-fatal) warnings about unlisted internal header files. List those files explicitly. Note: header files are added in lexicographical order only if the underlying INF file already keeps the [Sources] and [LibraryClasses] sections in lexicographical order. Otherwise, header files are added in rough "logical" order. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-07-04EmbeddedPkg: Fix various typosCœur7-15/+15
Fix various typos in EmbeddedPkg. Signed-off-by: Coeur <coeur@gmx.fr> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-06-17EmbeddedPkg: improve TimeBaseLib type safetyLeif Lindholm1-9/+9
EfiTimeToEpoch currently returns a UINTN. Also, some internal calculations was using UINTN for fixed-width. Both of these lead to warnings/errors with VS2017. Replace with appropriate fixed-size types. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=997 Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
2019-06-06EmbeddedPkg/PrePiLib: remove dead status code reporting codeArd Biesheuvel2-322/+0
The status code reporting functionality in PrePiLib is never invoked so let's just remove it. Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-05-15EmbeddedPkg/PrePiLib: Drop dependency on IntelFramework[Module]PkgHao A Wu2-4/+0
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1720 This commit will remove the dependency on IntelFramework[Module]Pkg from the PrePiLib. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-04-29EmbeddedPkg: Extend NvVarStoreFormattedLib LIBRARY_CLASSMarcin Wojtas1-1/+1
Latest change allowed to add dependency on NvVarStoreFormattedLib for the DXE_DRIVER modules. Although effectively it is hooked using the 'NULL' class, extend the LIBRARY_CLASS with according type for consistency sake. Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-04-25EmbeddedPkg: Allow DXE_DRIVER to depend on NvVarStoreFormattedLibMarcin Wojtas1-2/+2
Some modules (such as FaultTolerantWriteDxe) use the FlashNvStorage PCDs (PcdFlashNvStorageFtw*). In case the flash contents are not mapped in memory, the module loading order of the FVB driver may become important. To handle above, this patch allows to hook the dependency of desired DXE_DRIVER type module in the .DSC file via NvVarStoreFormattedLib NULL resolution. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2019-04-09EmbeddedPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney43-294/+43
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2019-02-26EmbeddedPkg/VirtualRealTimeClockLib: Fix correctness issuesPete Batard1-9/+25
LibGetTime(): - Two variables were used for the epoch, where only one should have been [*]. - Also harmonize variable name to match the one used in LibSetTime. LibSetTime(): - Address possible underflows if time is set to start of epoch. - Ensure that time being read does actually match time that was manually set (plus the time elapsed since), by subtracting number of seconds since reset. [*] This fixes a build breakage, since one of these variables was set but never used, triggering a compiler diagnostic at some optimization levels. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>