summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Include
AgeCommit message (Collapse)AuthorFilesLines
2026-06-18EmbeddedPkg,MdeModulePkg,DynamicTablesPkg: Move ACPI helper macrosVarshitPandya1-75/+0
Move the ACPI table helper macros from EmbeddedPkg's AcpiLib.h to MdeModulePkg's AcpiHelperMacros.h. These macros describe ACPI data initializers and do not depend on the AcpiLib library interface. Keeping them in AcpiLib.h forces users that only need the macros to include the AcpiLib library header unnecessarily. Place the macros in a common MdeModulePkg public header so ACPI table producers can include the macro definitions directly without implying use of AcpiLib. The companion edk2-platforms change is: "Global: Include AcpiHelperMacros.h for ACPI helper macros" Tested: DynamicTablesPkg: X64/AARCH64 DEBUG/RELEASE/NOOPT MdeModulePkg: X64/AARCH64 DEBUG/RELEASE/NOOPT EmbeddedPkg: X64/AARCH64 DEBUG/RELEASE/NOOPT Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Varshit Pandya <varshit.pandya@arm.com>
2026-06-13EmbeddedPkg, OvmfPkg: Produce FV3 HOBs for Extracted FVsOliver Smith-Denny1-2/+5
EmbeddedPkg's PrePiLib and OvmfPkg's PeilessStartupLib (which uses PrePiLib) only produce FV2 HOBs for extracted FVs. However, FV3 HOBs have superceded FV2 HOBs for describing extracted FVs. This commit updates both of these libs to also produce FV3 HOBs, following PEI's pattern of producing an FV, FV2, and FV3 HOB for each extracted FV. Eventually, only FV3 HOBs will be produced, so this paves the way for that. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-06-13EmbeddedPkg, OvmfPkg: PrePiLib: Use Correct FvName in FV2 HOB ProductionDmitry Antipov1-18/+4
PrePiLib is incorrectly producing FV2 HOBs. The FvName field of the FV2 HOB is intended to be the parent FV's name. This way the HOB consumer phase can identify when an FV has already been extracted: if the file name of the extracted FV and the parent FV name match in the FV2 HOB. With the incorrect FvName, DXE will re-extract the already extracted FV, which can be a large performance hit (some platforms we have seen ~1 second). This requires an update to FfsProcessFvFile to pass the parent FV handle through so the FV2 HOB can be correctly produced. OvmfPkg consumers are also updated. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-06-12EmbeddedPkg: Introduce GBL protocolsDmitrii Merkurev8-0/+765
GBL (Generic Bootloader) is Google's UEFI-based bootloader for Android. It runs as an EFI application and delegates board- and platform-specific operations to the underlying firmware through GBL-defined EFI protocols. This patch adds only the header definitions (GUIDs, revisions and interfaces) for those protocols, covering Android Verified Boot, AVF, A/B boot-control, boot-memory, debug, Fastboot (and its transport) and OS configuration. For details, see: https://cs.android.com/android/kernel/superproject/+/common-android-mainline:bootable/libbootloader/gbl/README.md Co-authored-by: David Pursell <dpursell@google.com> Co-authored-by: Dov Shlachter <dovs@google.com> Co-authored-by: Jakob Vukalović <jakobvukalovic@google.com> Co-authored-by: Kelvin Zhang <zhangkelvin@google.com> Co-authored-by: Ram Muthiah <rammuthiah@google.com> Co-authored-by: Sergii Parubochyi <sergiip@google.com> Co-authored-by: Yecheng Zhao <zyecheng@google.com> Co-authored-by: Yi-Yo Chiang <yochiang@google.com> Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
2026-05-22EmbeddedPkg: Add missing EFIAPI for protocol member functionsQihang Gao1-4/+4
According to UEFI spec calling conventions, protocol member functions should use EFIAPI. Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-05-06Revert "ArmPlatformPkg,EmbeddedPkg,MdeModulePkg: Move RealTimeClockLib ..."Ard Biesheuvel1-0/+120
This reverts commit 57230fff6b39a665485be1bd43ec608d412ba6fb. RealTimeClockLib is not a generic library class that is intended to be used widely to get access to the RTC when the associated runtime services are not available in the calling context. The purpose of RealTimeClockLib is to abstract the underlying hardware access from the generic RealTimeClockRuntimeDxe driver, which backs the runtime services. This means it does not belong in a different package; it belongs in the same package as the driver. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2026-02-24EmbeddedPkg: Replace include guards with #pragma onceMichael Kubacki34-136/+34
Replace traditional `#ifndef`/`#define`/`#endif` include guards with `#pragma` once. `#pragma once` is a widely supported preprocessor directive that prevents header files from being included multiple times. It is supported by all toolchains used to build edk2: GCC, Clang/LLVM, and MSVC. Compared to macro-based include guards, `#pragma once`: - Eliminates the risk of macro name collisions or copy/paste errors where two headers inadvertently use the same guard macro. - Eliminate inconsistency in the way include guard macros are named (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.). - Reduces boilerplate (three lines replaced by one). - Avoids polluting the macro namespace with guard symbols. - Can improve build times as the preprocessor can skip re-opening the file entirely, rather than re-reading it to find the matching `#endif` ("multiple-include optimization"). - Note that some compilers may already optimize traditional include guards, by recognzining the idiomatic pattern. This change is made acknowledging that overall portability of the code will technically be reduced, as `#pragma once` is not part of the C/C++ standards. However, this is considered acceptable given: 1. edk2 already defines a subset of supported compilers in BaseTools/Conf/tools_def.template, all of which have supported `#pragma once` for over two decades. 2. There have been concerns raised to the project about inconsistent include guard naming and potential macro collisions. Approximate compiler support dates: - MSVC: Supported since Visual C++ 4.2 (1996) - GCC: Supported since 3.4 (2004) (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html) - Clang (LLVM based): Since initial release in 2007 Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-02-02EmbeddedPkg: Replace non-ASCII characters with ASCIIdhiineshm1-1/+1
Replacing the non-ASCII characters with ASCII characters fixes build failures onWindows systems using non-English locales. These characters trigger MSVC warningC4819 (“file contains a character that cannot be represented in the current codepage”), which becomes an error when /WX is enabled. Cc: Sachin Ganesh <sachinganesh@ami.com> Signed-off-by: dhiineshm <dhiineshm@ami.com>
2025-09-08ArmPlatformPkg,EmbeddedPkg,MdeModulePkg: Move RealTimeClockLib headerINDIA\sachinganesh1-123/+0
RealTimeClockLib is an architectural implementation that is not restricted to the embedded segment or any platform in particular. So the header has been moved to MdeModulePkg. And the package has been added to the relevant INF files. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-08-12MdePkg, EmbeddedPkg: Move Fdt Table Guid to MdePkgPrachotan Bathi1-22/+0
Move Fdt Table Guid from EmbeddedPkg to MdePkg to avoid unnecessary dependencies on EmbeddedPkg for packages like ShellPkg. This change may affect modules dependent on EmbeddedPkg but not on MdePkg, which is unlikely. Also, per 8c721d6, MdePkg has a more refined implementation of Fdt as compared to the EmbeddedPkg which was the initial implementation. Not moving gFdtVariableGuid since it'll be moved to platform code. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Prachotan Bathi <prachotan.bathi@arm.com>
2025-07-23EmbeddedPkg: Fix incorrect define for hardware interrupt2 protocolChris Fernald1-2/+2
In HardwareInterrupt2.h the define for the protocol does not match the definition of the protocol in the dec file. The definition in the dec file is 32898322-2da1-474a-baaa-f3f7cf569470 where in the definition the define is 32898322-2d1a-474a-baaa-f3f7cf569470 and the string is even less correct with various bit swaps. This commit changes all the strings and definitions to be consistent with the dec definition. Signed-off-by: Chris Fernald <chfernal@microsoft.com>
2025-07-08MdePkg, EmbeddedPkg: Moved definition of Fdt Guid to MdePkgAkshay Behl1-20/+0
MdePkg has a more refined implementation of Fdt as compared to the EmbeddedPkg which was the initial implementation, hence moving the Fdt Guid from EmbeddedPkg to MdePkg. Continuous-integration-options: PatchCheck.ignore-multi-package Signed-off-by: Akshay Behl <cap2k4@rivosinc.com> Co-authored-by: Dhaval Sharma <dhaval@rivosinc.com>
2025-06-03EmbeddedPkg: PrePiLib missing header used in fileDoug Flick1-0/+1
PrePiLib.h is missing the header file that defines the structures used in the file. For example: - EFI_PEI_FV_HANDLE - EFI_PEI_FILE_HANDLE Signed-off-by: Doug Flick <dougflick@microsoft.com>
2025-06-02EmbeddedPkg: delete ancient libfdt semi-integrationLeif Lindholm3-2621/+0
With all in-tree users migrated, finally delete this. Any out-of-tree users need to migrate to MdePkg BaseFdtLib. Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2024-08-01EmbeddedPkg: Fix some spelling mistakes found by cspellRebecca Cran1-1/+1
When cspell is installed (via `npm install cspell`), CI checks for spelling mistakes. There are currently a very large number of them: some are genuine mistakes while others are words or acryonyms that cspell doesn't know. Fix a few of the misspellings in EmbeddedPkg. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-07-31EmbeddedPkg: Retire EfiResetSystemLib and ResetRuntimeDxeArd Biesheuvel1-48/+0
Retire the ancient reset runtime DXE in EmbeddedPkg, and the associated EfiResetSystemLib library class and template implementation. These are incomplete and have been superseded by a generic implementation in MdeModulePkg. Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-07-16EmbeddedPkg: Add option to disable EFI Memory Attribute ProtocolMario Bălănică1-0/+17
Introduce a driver that allows users to disable the EFI Memory Attribute protocol through an HII setup option, in order to work around a broken version of rhboot's shim used in some distros (e.g. CentOS Stream 9) which incorrectly invokes the protocol and results in a Synchronous Exception. Default is enabled, which can also be overridden at build time by changing `gEmbeddedTokenSpaceGuid.PcdMemoryAttributeEnabledDefault`. It is only applicable to ARM64 and there isn't any other technical reason for disabling this security feature. See: - https://github.com/microsoft/mu_silicon_arm_tiano/issues/124 - https://edk2.groups.io/g/devel/topic/99631663 - https://github.com/tianocore/edk2/pull/5840 Signed-off-by: Mario Bălănică <mariobalanica02@gmail.com>
2024-02-10EmbeddedPkg: Align RealTimeClock function headers with return valuesSuqiang Ren1-3/+18
RealTimeClock is used to back the runtime services time functions, so align the description of the function return values with the defined values for these services as described in UEFI Spec 2.10. REF: UEFI spec 2.10 section 8 Services ? Runtime Services Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com> Signed-off-by: Suqiang Ren <suqiangx.ren@intel.com> Reviewed-by: Abner Chang <abner.chang@amd.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-10-18EmbeddedPkg/RealTimeClockLib: drop LibRtcVirtualNotifyEvent from lib classLaszlo Ersek1-15/+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. At this point, the word "LibRtcVirtualNotifyEvent" no longer occurs in any of edk2, edk2-platforms, even edk2-non-osi, except the library class header proper. Remove the LibRtcVirtualNotifyEvent() function declaration. 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-6-lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2023-01-19EmbeddedPkg: Add back FfsFindSectionDataMin M Xu1-0/+20
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 Xu1-1/+1
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 Xu1-5/+18
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-11/+11
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-06EmbeddedPkg: Add AllocateRuntimePages in PrePiMemoryAllocationLibMin M Xu1-0/+19
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: Remove duplicated wordsPierre Gondois2-2/+2
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>
2021-12-17EmbeddedPkg/AcpiLib: Add more helper functionsNhi Pham1-0/+71
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 Kubacki41-1483/+1905
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 Kinney1-1/+1
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-10-14ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkgAbner Chang1-0/+129
This is one of the series patches to restructure the location of modules under ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to parse FDT nodes. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Sami Mujawar <sami.mujawar@arm.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Sunil V L <sunilvl@ventanamicro.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
2021-08-05EmbeddedPkg/libfdt: Add strcmp and strncpy to libfdt_env.hAbner Chang1-0/+8
OpenSBI has started using those in v0.9. See: https://github.com/riscv/opensbi/blob/v0.9/lib/utils/fdt/fdt_domain.c Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Cc: Anup Patel <anup.patel@wdc.com> Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com> Acked-by: Leif Lindholm <leif@nuviainc.com>
2021-01-07EmbeddedPkg/TimeBaseLib: Add function to check Timezone and DaylightNhi Pham1-0/+36
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: Update comment blocks for API functionsNhi Pham1-6/+48
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-1/+1
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-09-08EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macrosLaszlo Ersek1-2/+0
The SEC_PER_MONTH and SEC_PER_YEAR macros are wrong: they both evaluate to 0 (of type "int"). They are also unused (they could never be used for division, for example); so remove them. The macros were originally introduced in commit 0f4386e775c7 ("ArmPlatformPkg/PL031RealTimeClockLib: Implement PL031 RTC drive", 2011-06-11). Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Maciej Rabeda <maciej.rabeda@linux.intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Reported-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Message-Id: <20200904154541.23340-1-lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2020-08-24EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmpAbner Chang1-0/+4
For the implementation which utilizes libfdt provided in EmbeddedPkg however it uses strncmp function in the libfdt helper library, libfdt_env.h should provide the macro implied with edk2 strncmp implementation. The example is RISC-V OpenSBI library. edk2 RISC-V port uses OpenSBI library and incorporate with edk2 libfdt. edk2 libfdt_env.h provides the necessary macros to build OpenSBI which uses fdt functions in edk2 environment. However, OpenSBI also has libfdt helper library that uses strncmp function which is not defined in edk2 libfdt_env.h. This commit addresses the build issue caused by missing strncmp macro in libfdt_env.h. Check below three commits for the corresponding changes on OpenSBI, https://github.com/riscv/opensbi/commit/8e47649eff96c303e02fbd58cdc6c4ed341066ec https://github.com/riscv/opensbi/commit/2845d2d2cf4fb74a89452ba223995aa4a118c07e https://github.com/riscv/opensbi/commit/2cfd2fc9048806353298a1b967abf985901e36e8 Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Message-Id: <20200806023421.25161-1-abner.chang@hpe.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> [lersek@redhat.com: remove stray newline between S-o-b and first Cc]
2020-08-03EmbeddedPkg/TimeBaseLib: Add macros to get build year/month/dayPete Batard1-0/+32
These can be used, for instance, to automate the population of an SMBIOS Type 0 BIOS Release Date when building a UEFI firmware (which is how we plan to use these macros for the Raspberry Pi platform). These macros should work for any compiler that follows ISO/IEC 9899, but we add a check for the compiler we have tested to be on the safe side. Note that we decided against adding a #error or #warn for compilers that haven't been validated, as we don't want to introduce breakage for people who may already be using the header with something else than gcc, MSVC or Clang. Instead, we expect those to send a patch that adds their compiler to the list, once they have tested the macros there. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2020-04-30EmbeddedPkg: rename gEfiMmcHostProtocolGuid to gEmbeddedMmcHostProtocolGuidArd Biesheuvel1-2/+2
In EDK2, identifiers carrying the EFI prefix are reserved for ones that are defined in the UEFI or PI specifications. Since the MMC host protocol defined in EmbeddedPkg is not the one that the UEFI spec defines, and given the confusion around this, let's rename it to from gEfiMmcHostProtocolGuid to gEmbeddedMmcHostProtocolGuid. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
2020-03-30EmbeddedPkg/AcpiLib: add GICC table init macro for ACPI 6.3Pete Batard1-0/+8
ACPI 6.3 added a 16-bit SPE overflow Interrupt field, replacing 2 of the 3 reserved bytes that are defined at the end of the GICC structure for 6.0. Add a new macro to initialise the new field. Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@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-2/+2
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 Biesheuvel1-7/+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-04-09EmbeddedPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney38-266/+38
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-01EmbeddedPkg/PrePiLib: Correct function nameJeff Brasen1-1/+1
Update header file function name for FfsFindFileByName to match implementation function name. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jeff Brasen <jbrasen@nvidia.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2018-11-29EmbeddedPkg/PrePiHobLib: drop CreateHobList() from libraryArd Biesheuvel1-18/+0
Drop the declaration and the implementation of CreateHoblist(), which is not used anywhere. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-06-05EmbeddedPkg/TimeBaseLib: Add function to get Week day.Meenakshi Aggarwal1-0/+8
This patch add function EfiTimeToWday() which returns day of the week. It is needed by our upcoming patches in edk2-platforms. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Vabhav Sharma <vabhav.sharma@nxp.com> Signed-off-by: Meenakshi Aggarwal <meenakshi.aggarwal@nxp.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-06-05EmbeddedPkg: add platform boot manager protocolHaojian Zhuang1-0/+86
Create the PlatformBootManagerProtocol that is used to add predefined boot options in platform driver. This interface will be used in ArmPkg/PlatformBootManagerLib. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-04-30EmbeddedPkg/Drivers: add virtual keyboard driverHaojian Zhuang1-0/+65
This driver is used to simulate a keyboard. For example, user could read GPIO setting or data from RAM address. If the value matches the expected pattern, it could trigger a key pressed event. User needs to implement hooks of PLATFORM_VIRTUAL_KBD_PROTOCOL. There're 4 hooks in this protocol. Register(): Quote the interface that user needs. For example, user needs to locate GPIO protocol if he wants to simulate a GPIO value as a key. Reset(): Do the initialization before reading value. Query(): Read value. If the value matches the expected pattern, trigger a key pressed event. Clear(): Clean the value if necessary. Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-04-12EmbeddedPkg: introduce NvVarStoreFormattedLibLaszlo Ersek1-0/+39
Some platforms don't format a variable store template at build time; instead they format the non-volatile varstore flash chip during boot, dynamically. Introduce NvVarStoreFormattedLib to enable such platforms to delay the "variable read" service drivers until the platform specific module(s) report that the variable store has been formatted. The platform-specific module that performs the formatting during startup is usually an FVB or MM FVB driver. Under the proposed scheme, it becomes responsible for installing gEdkiiNvVarStoreFormattedGuid with a NULL interface in the protocol database. In turn, the platform DSC will hook NvVarStoreFormattedLib into the variable service driver, to make the latter wait for the FVB driver. Platforms that need not delay the variable service driver like this may still use the same FVB driver; gEdkiiNvVarStoreFormattedGuid will simply be ignored. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Steve Capper <steve.capper@linaro.org> Cc: Supreeth Venkatesh <Supreeth.Venkatesh@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Steve Capper <steve.capper@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-02-21EmbeddedPkg/FdtLib: incorporate missing overlay supportArd Biesheuvel1-0/+31
Commit a099239015eb ("EmbeddedPkg/FdtLib: Update FdtLib to v1.4.5") updated our FdtLib implementation to a more recent upstream version, but omitted fdt_overlay.c due to its ambiguous licensing situation. This has been resolved now, so take the latest upstream version of the file (which received no other modifications in the mean time) and add it to FdtLib. Note that fdt_overlay.c has a dependency on strtoul() which EDK does not provide natively, so add a private implementation that wraps the BaseLib routines that do roughly the same. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2018-02-06EmbeddedPkg: delete unused Pcds and guidsLeif Lindholm1-42/+0
Delete a bunch of Pcds, a guid, and a related header file - probably Ebl related. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>