Commit graph

493 commits

Author SHA1 Message Date
Michael Kubacki
df9111c2d3 Global: Set MarkdownLintCheck plugin to AuditOnly
In preparation for the MarkdownLintCheck plugin being added to the
repo, this change defaults the plugin to `AuditOnly` mode in each
package. This allows package maintainers to enable the plugin as they
see fit.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2026-07-29 12:32:09 +00:00
Tuan Phan
b3d5f2b349 EmbeddedPkg: PrePiLib: Fix uninitialized variable warnings
In FfsProcessSection(), delete CompressionSectionHeaderSize and move
CompressedData to avoid the compiler warning without changing functional
behavior.

Signed-off-by: Tuan Phan <tuan.phan@oss.qualcomm.com>
2026-06-24 14:49:50 +00:00
VarshitPandya
3b61f4d266 EmbeddedPkg,MdeModulePkg,DynamicTablesPkg: Move ACPI helper macros
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-18 13:03:24 +00:00
Oliver Smith-Denny
c6c02f8cae EmbeddedPkg, OvmfPkg: Produce FV3 HOBs for Extracted FVs
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-13 09:06:33 +00:00
Dmitry Antipov
7ad30b28b2 EmbeddedPkg, OvmfPkg: PrePiLib: Use Correct FvName in FV2 HOB Production
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-13 09:06:33 +00:00
Oliver Smith-Denny
6eca4a4a95 EmbeddedPkg: PrePiLib: Zero Volume Info Buffer Before Writing
FfsGetVolumeInfo() in PrePiLib does not zero the VolumeInfo
buffer before writing to it. However, it has some fields that
are expected to be zero if certain conditions are not met.

For example, the FvName is expected to be all 0's if the
extended header is not present in the FV. Currently,
the FvName field will point to garbage if the caller does
not zero the buffer first.

Flip the expectation and have FfsGetVolumeInfo() zero the
buffer before it writes to it.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-06-13 09:06:33 +00:00
Oliver Smith-Denny
e63bba000a EmbeddedPkg: PrePiLib: Skip Extracting if FV3 HOB Found
PrePiLib only searches for the existence of an FV2 HOB to
determine if an FV has already been extracted. However,
FV2 HOBs have been superceded by FV3 HOBs for describing extracted
FVs.

This commit updates PrePiLib to check for the existence of either
an FV2 or FV3 HOB for this FV and skips extracting if either is
found.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-06-13 09:06:33 +00:00
Oliver Smith-Denny
622a2c7abf EmbeddedPkg: PrePi.h: Drop Duplicate HOB Defintions
PrePi.h has some duplicate HOB definitions from HobLib.h.
Instead of redefining them, use HobLib.h.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-06-13 09:06:33 +00:00
Dmitrii Merkurev
dfaa76349d EmbeddedPkg: Introduce GBL protocols
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-06-12 09:38:53 +00:00
Mingjie Shen
1c2d76e233 EmbeddedPkg: Replace manual alignment checks with helper macros
Replace manual alignment checks with IS_ALIGNED() and
ADDRESS_IS_ALIGNED().

Convert the following bitmask and modulo forms:

- ((E & ((PowOf2Expr) - ONE)) == ZERO)
- ((E & ((PowOf2Expr) - ONE)) != ZERO)
- ((E % (PowOf2Expr)) == ZERO)
- ((E % (PowOf2Expr)) != ZERO)

to the corresponding helper macro forms:

+ IS_ALIGNED (E, PowOf2Expr)
+ !IS_ALIGNED (E, PowOf2Expr)

PowOf2Expr is limited to known power-of-two expressions, including
SIZE_* and BASE_* macros, EFI_PAGE_SIZE, CPU_STACK_ALIGNMENT,
RUNTIME_PAGE_ALLOCATION_GRANULARITY, sizeof() of UEFI integer types
(e.g. BOOLEAN, CHAR16, UINT32, UINTN) and pointer types, and 1 << E1
expressions.

Address checks that cast the checked value to UINTN are written with
ADDRESS_IS_ALIGNED().

The change was generated with the Coccinelle semantic patch below.

```smpl
@power_of_2_expr@
expression PowOf2Expr;
expression E1;
typedef BOOLEAN, CHAR8, CHAR16, INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, INTN, UINTN;
type ScalarType = { BOOLEAN, CHAR8, CHAR16, INT8, UINT8, INT16, UINT16, INT32, UINT32, INT64, UINT64, INTN, UINTN };
type AnyType;
type PointerType = AnyType *;
idexpression ScalarType ScalarValue;
idexpression PointerType PointerValue;
constant SizeBase =~ "^(SIZE|BASE)_(1|2|4|8|16|32|64|128|256|512)[KMGTPE]B$";
constant NamedPowerOf2 =~ "^(EFI_PAGE_SIZE|CPU_STACK_ALIGNMENT|RUNTIME_PAGE_ALLOCATION_GRANULARITY)$";
constant ONE = {1, 1U, 1u};
@@
(
(
  SizeBase
|
  NamedPowerOf2
|
  ONE << E1
|
  sizeof (ScalarType)
|
  sizeof (PointerType)
|
  sizeof (ScalarValue)
|
  sizeof (PointerValue)
)
&
PowOf2Expr
)

@aligned depends on power_of_2_expr disable is_zero,isnt_zero@
expression E;
expression power_of_2_expr.PowOf2Expr;
constant ONE = {1, 1U, 1u};
constant ZERO = {0, 0U, 0u};
@@
(
  ((E & (E - ONE)) == ZERO)
|
- ((E & ((PowOf2Expr) - ONE)) == ZERO)
+ IS_ALIGNED (E, PowOf2Expr)
|
  ((E & (E - ONE)) != ZERO)
|
- ((E & ((PowOf2Expr) - ONE)) != ZERO)
+ !IS_ALIGNED (E, PowOf2Expr)
|
- ((E % (PowOf2Expr)) == ZERO)
+ IS_ALIGNED (E, PowOf2Expr)
|
- ((E % (PowOf2Expr)) != ZERO)
+ !IS_ALIGNED (E, PowOf2Expr)
)

@address_is_aligned@
typedef UINTN;
expression *Address;
expression Alignment;
@@
- IS_ALIGNED ((UINTN) Address, Alignment)
+ ADDRESS_IS_ALIGNED (Address, Alignment)

@normalize_aligned disable paren expression@
expression E, SZ;
@@
(
- (IS_ALIGNED (E, SZ))
+ IS_ALIGNED (E, SZ)
|
- (!IS_ALIGNED (E, SZ))
+ !IS_ALIGNED (E, SZ)
)

@normalize_macro_args disable paren expression@
expression E, SZ;
@@
(
- IS_ALIGNED ((E), SZ)
+ IS_ALIGNED (E, SZ)
|
- IS_ALIGNED (E, (SZ))
+ IS_ALIGNED (E, SZ)
)
```

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
2026-06-09 07:20:10 +00:00
Qihang Gao
4a96a36c58 EmbeddedPkg: Add missing EFIAPI for protocol member functions
According to UEFI spec calling conventions, protocol member functions
should use EFIAPI.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-05-22 16:43:19 +00:00
Qihang Gao
708339afd7 EmbeddedPkg: Add missing EFIAPI for event callback functions
According to UEFI spec calling conventions, UEFI event handlers should
use EFIAPI.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-05-22 16:43:19 +00:00
Ard Biesheuvel
d73615b24b Revert "ArmPlatformPkg,EmbeddedPkg,MdeModulePkg: Move RealTimeClockLib ..."
This reverts commit 57230fff6b.

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-05-06 03:41:31 +00:00
Qihang Gao
1c39524aec EmbeddedPkg: Remove duplicate procotol in INF file
In AndroidFastbootTransportTcpDxe driver, gEfiSimpleTextOutProtocolGuid
appears twice in [Procotols] section, so remove the duplicate one.

Signed-off-by: Qihang Gao <gaoqihang@loongson.cn>
2026-04-29 11:18:10 +02:00
Sami Mujawar
b5f1199323 EmbeddedPkg: Add missing FreeAlignedPages() implementation
The PrePiMemoryAllocationLib supports AllocateAlignedPages(),
however is missing the corresponding FreeAlignedPages().

Although the FreeAlignedPages() in PrePiMemoryAllocationLib
does not support the ability to free pages in the PrePei Memory
Allocator and the allocated memory is lost, it would be good
to have an empty implementation of FreeAlignedPages() so that
implementations utilises the correct deallocation function.

Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
2026-04-21 16:55:40 +00:00
Oliver Smith-Denny
87148bcc25 Global: Move ArmLib to MdePkg
Per
https://edk2.groups.io/g/devel/topic/move_armlib_to_baselib/118541649,
this commit moves ArmLib to MdePkg and updates all consumers.

The only change to ArmLib itself is to remove ArmPkg.dec from
the inf.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-04-17 11:42:23 +00:00
Gowtham M
3b0deb5e79 EmbeddedPkg/PrePiLib: Prevent overread with FFS size macros
Symptom:Unsafe typecasting may lead to out‑of‑bound memory access

RootCause: FileSize and FileLength are declared as
UINT32 and masked with 0x00FFFFFF to store only the lower 24 bits.
Although this approach yields the correct result,
it introduces a potential risk due to unsafe typecasting and
dereferencing.

Solution: Using the predefined macro FFS_FILE_SIZE()
from MdePkg\Include\Pi\PiFirmwareFile.h,
which safely performs the same operation by reconstructing
the size using individual byte access.

This commit also addresses the fix for coverity isssue "OVERRUN"

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2026-04-13 14:12:17 +00:00
Sherry Fan
f1e6f26e92 EmbeddedPkg: fix mdlint issues
Fix markdownlint formatting issues in README.

Uses the following settings:
{
  "default": true,
  "MD013": {"line_length": 120, "code_blocks": false, "tables": false},
  "MD033": {"allowed_elements": ["br", "center", "img"]}
}

Signed-off-by: Sherry Fan <sherryfan@microsoft.com>
2026-03-04 22:02:33 +00:00
Alexander Gryanko
b56710fe9c EmbeddedPkg: align Inf file headers with INF Spec standard
The Inf file standard specifies that comments begin with the
characters "#". The following files contained incorrectly
formatted C-style comments and have been updated:

EmbeddedPkg/Library/DxeDtPlatformDtbLoaderLibDefault/DxeDtPlatformDtbLoaderLibDefault.inf
EmbeddedPkg/Library/NorFlashInfoLib/NorFlashInfoLib.inf

The problems were identified during testing of the parser
https://github.com/xpahos/edk2-idea.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2026-03-02 19:32:17 +00:00
Alexander Gryanko
70bddc908f EmbeddedPkg: align UNI file headers with UNI Spec standard
The Uni file standard specifies that comments begin with the
characters "//". The following files contained incorrectly
formatted C-style comments and have been updated:

EmbeddedPkg/Drivers/ConsolePrefDxe/ConsolePrefHii.uni
EmbeddedPkg/Drivers/DtPlatformDxe/DtPlatformHii.uni
EmbeddedPkg/Drivers/MemoryAttributeManagerDxe/MemoryAttributeManagerDxeHii.uni

The problems were identified during testing of the parser
https://github.com/xpahos/edk2-idea.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2026-03-02 19:32:17 +00:00
Michael Kubacki
de527ff606 EmbeddedPkg: Replace include guards with #pragma once
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-23 21:01:28 +00:00
Antaeus Kleinert-Strand
756d5fb0ab EmbeddedPkg/PrePiMemoryAllocationLib: Update memory hob page alignment
When allocating Runtime memory the MemoryAllocation HOB's length needs
to meet the alignment requirements of Runtime memory. On AARCH64
architectures this alignment is not the default of 4KB.
Instead it is set by the RUNTIME_PAGE_ALLOCATION_GRANULARITY
definition, which is 64KB.

This change enforces the RUNTIME alignment as part of generating the
MemoryAllocationHob for runtime memory types.

Signed-off-by: Antaeus Kleinert-Strand <antklein@microsoft.com>
2026-02-11 02:10:26 +00:00
dhiineshm
83271a185a EmbeddedPkg: Replace non-ASCII characters with ASCII
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>
2026-02-02 03:24:17 +00:00
Dongyan Qian
b55b3ae351 EmbeddedPkg/AndroidBootImgLib: Fix typo in Buffer parameter description
The comment for the Buffer parameter incorrectly said
"then no the size" instead of "then the size".
This patch fixes the typo only; no functional changes.

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2026-01-23 10:46:37 +00:00
Michael D Kinney
038c22c624 EmbeddedPkg/Library/VirtualRealTimeClockLib: Fix type mismatch
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2026-01-22 19:58:43 +00:00
Michael D Kinney
f5cde40919 EmbeddedPkg/GdbStub/X64: Use X64 system context
Found with VS2022 NOOPT X64 build.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2026-01-22 18:45:58 +00:00
Michael D Kinney
23329a90a0 EmbeddedPkg/Universal/MmcDxe: Fix VS2022 NOOPT IA32/X64 issues
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2026-01-22 18:02:39 +00:00
Oliver Smith-Denny
198c9bf506 EmbeddedPkg: PrePiMemoryAllocationLib: Add AllocateCopyPool
ArmVirtPkg uses PrePiMemoryAllocationLib and PeiServicesLib in
the same module. PeiServicesLib depends on MemoryAllocationLib,
fulfilled by PrePiMemoryAllocationLib in this instance. However,
PeiServicesLib uses AllocateCopyPool() which is not provided in
PrePiMemoryAllocationLib. CLANGPDB AARCH64 finds this as a link
error. Other toolchains are optimizing the call out since that
code path is not used in this module.

This adds AllocateCopyPool() to PrePiMemoryAllocationLib to
satisfy the dependency.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-01-15 17:10:46 +00:00
Oliver Smith-Denny
2c4f469a96 EmbeddedPkg: PrePiHobLib: Add Library/Protocol Dependencies
CLANGPDB AARCH64 catches that PrePiHobLib doesn't correctly
list the library classes and protocols it uses. This resolves
that.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2026-01-15 17:10:46 +00:00
Leif Lindholm
c4eaff95a2 EmbeddedPkg: Add LOONGARCH64 and RISCV64 as supported architectures
Both LOONGARCH64 and RISCV64 platforms make use of modules in
EmbeddedPkg, for example in OvmfPkg. So add them as supported
architectures for the package to simplify build tests.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-11-24 04:15:18 +00:00
Sathya Ravichandran
b089a6a445 EmbeddedPkg: Remove DXE_SAL_DRIVER
The DXE_SAL_DRIVER module type was introduced to support
Itanium (IPF) platforms. Since support for Itanium processors has been
dropped, the instances of DXE_SAL_DRIVER have been removed.

Ref: [3cb0a311cb]

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Sathya Ravichandran <sathyar@ami.com>
2025-10-30 10:00:32 +00:00
Michael D Kinney
fe52108211 EmbeddedPkg/VirtualRealTimeClockLib: Use SOURCE_DATE_EPOCH
Change VirtualRealTimeClockLib.inf to use SOURCE_DATE_EPOCH
instead of Linux only shell command. This allows this library
to be used in Windows build environments.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-16 10:41:09 +00:00
nick.wang
ab04d09555 EmbeddedPkg: Clear keyboard queue buffer after reading
There is a possibility to retrieve user input keystroke data stored in the
queue buffer via the EFI_SIMPLE_TEXT_INPUT_PROTOCOL pointer. To prevent
exposure of the password string, clear the queue buffer by filling it
with zeros after reading.

Signed-off-by: Nick Wang <nick.wang@insyde.com>
2025-10-09 08:02:51 +00:00
Oliver Smith-Denny
45fde54948 EmbeddedPkg: Drop ARM32 Support
edk2 is dropping support for the ARM32 architecture. This
commit removes ARM32 code from EmbeddedPkg. This also drops
irrelevant VALID_ARCHITECTURES comments from infs that are not
arch specific.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
Leif Lindholm
615e5ca40a EmbeddedPkg/PrePiLib: minor cleanup in FfsProcessSection ()
Drop an else wrapper in FfsProcessSection () on the other side of
an if-statemenmt that is an error return.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-09-11 21:05:29 +00:00
Leif Lindholm
24fd71dcaa EmbeddedPkg/PrePiLib: eliminate unneeded variable in FfsProcessSection ()
The "Found" variable provided only a deferred form of success handling, so
eliminate it to improve readability.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-09-11 21:05:29 +00:00
Leif Lindholm
6b19b447c5 EmbeddedPkg/PrePiLib: refactor FfsProcessSection ()
Create some helper functions to make FfsProcessSection at least halfway
readable by both humans and compilers.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-09-11 21:05:29 +00:00
INDIA\sachinganesh
57230fff6b ArmPlatformPkg,EmbeddedPkg,MdeModulePkg: Move RealTimeClockLib header
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-09-08 16:54:42 +08:00
Prachotan Bathi
db5b28ed9e MdePkg, EmbeddedPkg: Move Fdt Table Guid to MdePkg
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-08-12 17:42:44 +00:00
Chris Fernald
c840e5f95b EmbeddedPkg: Fix incorrect define for hardware interrupt2 protocol
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-23 00:43:52 +00:00
Akshay Behl
8c721d68ea MdePkg, EmbeddedPkg: Moved definition of Fdt Guid to MdePkg
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-07-08 18:35:46 +00:00
Vishal Oliyil Kunnil
7f756db37a EmbeddedPkg/PrePiMemoryAllocationLib: Add reserved memory allocations
PrePiMemoryAllocationLib does not implement functions to allocate
EfiMemoryReservedType. These are implemented in other instances of
MemoryAllocationLib (Dxe, Uefi, PiSmmCore, SmmMemory).

Add AllocateReservedPages() and AllocateAlignedReservedPages()
functions to make it consistent with other MemoryAllocationLib
intstances.

Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
2025-07-08 07:27:23 +00:00
Pankaj Kumar Singh
4fa354b116 EmbeddedPkg/TimeBaseLib: aligning year with UEFI specification
According to the UEFI Specification version 2.11, the valid range for the
Year field in the EFI_TIME structure is from 1900 to 9999.
Currently IsTimeValid() checks a restricted range 2000 - 2099.

Update range in TimeBaseLib.c to match UEFI specification.
Signed-off-by: Pankaj Singh <pansing@qti.qualcomm.com>
2025-06-26 18:40:15 +00:00
Gao Qihang
8c04bcc7ed EmbeddedPkg: Fix a data error in comment
KEYBOARD_TIMER_INTERVAL is used as TriggerTime parameter of
gBS->SetTimer() function. TriggerTime parameter represents the number of
100ns units, so number 500000 indicates 0.05s.

Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-06-04 06:13:22 +00:00
Doug Flick
15a2f3e511 EmbeddedPkg: PrePiLib missing header used in file
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-03 08:13:28 +00:00
Leif Lindholm
030d01f800 EmbeddedPkg: delete ancient libfdt semi-integration
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>
2025-06-02 11:14:54 +00:00
Leif Lindholm
8aad683e59 ArmVirtPkg,DynamicTablesPkg,EmbeddedPkg,OvmfPkg: use MdePkg BaseFdtLib
Migrate these packages to use the up-to-date BaseFdtLib instead
of the EmbeddedPkg relic that is going away.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30 10:56:03 +00:00
Dun Tan
be720b8d6c EmbeddedPkg: Add two new APIs in PrePiHobLib
This commit is to add two new APIs in EmbeddedPkg
PrePiHobLib:

1.The GetNextMemoryAllocationGuidHob () returns the next
instance of the Memory Allocation HOB with the matched
GUID from a starting HOB pointer.

2.The TagMemoryAllocationHobWithGuid () searchs the HOB
list for the Memory Allocation HOB with a matching base
address and set the Name GUID. Then the instance of the
tagged Memory Allocation HOB with matched base address is
returned.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2025-04-18 03:48:07 +00:00
Kun Qin
86099b948b ArmPkg: ArmSmcLib: Move ArmSmcLib to MdePkg
As an implementation of an industry specification-defined interface,
ArmSmcLib is more appropriately placed in MdePkg.

This update relocates both the header definition and the implementation
of ArmSmcLib to MdePkg, thereby supporting the monitor call primitives
for all other packages that depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Ard Biesheuvel
0bb40c79be ArmPkg: Retire ArmGicLib implementations
Retire all implementations of the ArmGicLib library class, which are no
longer used. For now, retain the library header and library class
declaration: the header file only contains pre-processor defines derived
from the GIC architecture spec, and so this code should probably move
into MdePkg at a later moment.

Continuous-integration-options: PatchCheck.ignore-multi-package

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17 18:37:27 +00:00