Commit Graph

4327 Commits

Author SHA1 Message Date
d87583e720 MdePkg/Library/BaseLib: Remove __chkstk() from BaseLib
Remove workaround for GCC compilers that is no longer
required. Keeping this implementation of __chkstk() generates
duplicate symbol build failures with Windows/CLANGPDB builds
host-based unit test builds.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 07:14:26 +00:00
2636488e7b MdePkg/Test/MockSmmServicesTableLib: Fix struct init
CLANGDWARF generates errors for missing braces in
initialization of complex structures. Expand the
initialization of EFI_SMM_CPU_IO2_PROTOCOL in
LocalSmst to set each function pointer to NULL.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-09-19 05:32:01 +00:00
3a5563593a MdePkg: TpmPtp: Add CRB Interface Version 2 Definition
Introduces support for CRB Interface Version 2 as defined in the TCG PC
Client Platform TPM Profile (PTP) Specification v1.06.

This enables firmware to identify TPMs that support the CRB buffer
interface.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-09-18 17:30:28 +08:00
07ba06fdf7 MdePkg: Add the COHERENCY_SFW_NO CPUID bit field
Update the CPUID 0x8000001F EBX definition to add the COHERENCY_SFW_NO
bit field. The COHERENCY_SFW_NO bit is used to indicate that the SEV-SNP
cache coherency mitigation is not needed.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
2025-09-09 17:43:31 +00:00
9e1c211b6c MdePkg/IndustryStandard: Define enums for DSP0134 SMBIOS Spec v3.9.0
Add new enums for Type3 Chassis & Type17 Memory

Signed-off-by: Giri Mudusuru <girimudusuru@microsoft.com>
2025-09-09 10:39:33 +00:00
5739530817 MdePkg: Add MockSpiNorFlashProtocol
Add MockSpiNorFlashProtocol for google test components to use.

Signed-off-by: PaddyDeng <paddydeng@ami.com>
2025-09-09 16:15:39 +08:00
d8e875e625 Global: fix ArmFfaLibRun() caller couldn't get ret-args
When ArmFfaLibDirectMsgReq(2) is preempted, caller of these functions
should resume it works via ArmFfaLibRun() and the secure partition
will be return with FFA_DIRECT_MSG_RESP(2) with return arguments.

However, since ArmFfaLibRun() gets its return in its stack variable,
So caller of ArmFfaLibRun() doesn't get the return arguments from
secure partition.

To resolve this, add output parameter to ArmFfaLibRun() to
receive return arguments.

Continuous-integration-options: PatchCheck.ignore-multi-package
Fixes: 5d1b38dd07 ("ArmPkg: Add ArmFfaLib used in Dxe driver")
Reported-by: Mariam Elshakfy <Mariam.Elshakfy@arm.com>
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-09-08 13:14:00 +00:00
438045682b MdePkg/Inclde: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
EFI_UNICODE_COLLATION_PROTOCOL_GUID is deprecated in the
previous commit. Hence, removing related guid definition.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
8bd3787e4b MdePkg/Include: Deprecate EFI_DEVICE_IO_PROTOCOL
EFI_DEVICE_IO_PROTOCOL is deprecated in the previous commit.
Hence, removing related header file and guid definition.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
80fddcaeb8 MdePkg/Include: Deprecate UNICODE_COLLATION_INTERFACE
Remove UNICODE_COLLATION_INTERFACE typedef
since unused and removed from UEFI 2.10A
and 2.11 specifications.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
b1e018c0ad MdePkg/Include: Deprecate EFI_NVDIMM_LABEL_FLAGS_UPDATING
The EFI_NVDIMM_LABEL_FLAGS_UPDATING flag is used in UEFI
to indicate that an update was in progress across multiple
Label Storage Areas (LSAs) on NVDIMM devices.

Its purpose was to help ensure atomicity in the event of
interruptions like power loss or system crashes.

It is deprecated in UEFI 2.10 and 2.11, as label index blocks
and checksums now provide better atomicity and consistency
without requiring this flag.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
a860818324 MdePkg/Include: Deprecate EFI_NVDIMM_LABEL_FLAGS_RESERVED
EFI_NVDIMM_LABEL_FLAGS_RESERVED is a reserved bit in
the NVDIMM label flags field, intended for future use.
It was removed in UEFI 2.10A and 2.11 as it had no
defined function and was unused in implementations.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
ff668af879 MdePkg/Include: Deprecate EFI_IP4_CONFIG_PROTOCOL
EFI_IP4_CONFIG_PROTOCOL is deprecated in the previous commit.
Hence, removing related header file and guid definition.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
85770fd453 MdePkg: Add support for PCIe Extended IDs
Add PTM (001F) structure in MdePkg.

Signed-off-by: Nanjinmoorthy <nanjinmoorthyj@ami.com>
2025-09-05 12:04:06 +00:00
338f5079f7 MdePkg: Enable CompilerIntrinsicsLib for LoongArch
When arrays are lager enough, LoongArch compilers(such as GCC or Clang)
will replace some libc functions to improve performace, which may cause
building failures. Enabling this library can link edk2's own libc
functions and fix this problem.

Signed-off-by: Chao Li <lichao@loongson.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
2025-09-05 09:39:13 +00:00
4e41744142 MdePkg/Nvme.h: Add Power Loss Signaling defination
Add Nvme 2.1 spec update, specifically for Power Loss Signaling.
1. Update field in Identify Controller Data for Power Loss Signaling Information.
2. Add Power Loss Signaling Mode defination.
3. Add Power Loss Signaling feature identifer defination.

Signed-off-by: Hunter Chang <hunter.chang@intel.com>
2025-09-04 06:27:38 +00:00
fcbf985673 MdePkg/ArmFfaMemMgmtLib: Fix typo in structure definition and comments
Fix typo in FFA_ENDPOINT_MEMORY_ACCESS_DESCRIPTOR member and comments.

Signed-off-by: Vishal Oliyil Kunnil <vishalo@qti.qualcomm.com>
2025-09-03 08:06:24 +00:00
397479d748 MdePkg/IndustryStandard: Add MRDIMM into Smbios.h
Added the MRDIMM (0x08) entry to the MemoryDeviceMemoryTechnologyTable
in Smbios.h.  This enables proper display and decoding of MRDIMM memory
technology in SMBIOS Type 17 structures.

Signed-off-by: Ning Feng <ning.feng@intel.com>
2025-09-02 17:11:24 +00:00
2efffed938 MdePkg/Library/BaseRngLib/Riscv: use CPU RNG instructions only
Generate random number using risc-v CPU RNG instructions only,
as for the other architectures. This is safer than using Mersenne
Twister from a seed, which is the current implementation, as the
latter is known to be cryptographically unsafe (e.g. see
https://www.schutzwerk.com/en/blog/attacking-a-rng/)

Signed-off-by: Adriano Cordova <adriano.cordova@canonical.com>
2025-09-02 08:28:30 +00:00
77293f4711 MdePkg: Correct comments for ResolutionY and ResolutionZ in SimplePointer.h
Signed-off-by: Yang Gang <yanggang@byosoft.com.cn>
2025-09-02 10:55:44 +08:00
a56c2eb07e MdePkg/BaseFdtLib: Remove unused macros and string APIs
Removed legacy macros and string helper APIs that are no longer used
in the BaseFdtLib implementation. Specifically:
- Dropped strcmp macro that incorrectly expected 3 arguments but
  ignored the third parameter.
- Cleaned up other unused macros and redundant string APIs.

These changes align with the current upstream libfdt module and
reduce dead code.

Signed-off-by: Thamballi Sreelalitha <sreelali@qti.qualcomm.com>
2025-08-26 19:28:08 +00:00
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
d55642f537 MdePkg: added mocks for DevicePathLib and OpenProtocol
Added Google Mock test support for DevicePathLib.
Added OpenProtocol and CloseProtocol for UefiBootServicesTableLib
mock library.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2025-08-07 01:18:26 +00:00
0662754134 MdePkg/Library: Remove MM_STANDALONE LibraryClass in UefiDevicePathLib.inf
UefiDevicePathLib.inf consumes Boot Services in
MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesDxeSmm.c
- DevicePathFromHandle().
And so cannot be used by MM_STANDALONE drivers.

Instead, MM_STANDALONE drivers can use UefiDevicePathLibBase.inf
as the DevicePathLib of choice.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-08-06 17:43:56 +00:00
fdd6796d08 MdePkg/Library: Remove UefiDevicePathLibStandaloneMm.inf
The file UefiDevicePathLibStandaloneMm.inf was reintroduced in [#3187] to
give downstream platforms time to transition to UefiDevicePathLibBase.inf
As nearly three years have passed since that change,
and downstream consumers have had sufficient time to migrate,
this library can now be safely removed.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-08-06 17:43:56 +00:00
10f0364b61 MdePkg/Acpi50: Add revision macro for Serial Bus UART structure
The Serial Bus UART structure was introduced in ACPI 5.0.

This patch defines a revision macro for this structure and
also adds type specific flag macros.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-07-21 13:50:05 +00:00
988162092b MdePkg: Acpi66: Update FADT and MADT versions
According to the recently released ACPI 6.6 specification, the minor
version of the Fixed ACPI Description Table (FADT) should be updated to
revision 6, and the Multiple APIC Description Table (MADT) should use
revision 7. Update the macros to reflect this.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
2025-07-21 09:28:16 +00:00
b0fb8da1fa MdePkg: Acpi66: Add newly defined RISC-V affinity structure
ACPI 6.6 defines new affinity structure for RISC-V Intc. Add their
definitions.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
2025-07-21 09:28:16 +00:00
6b8522d007 MdePkg: Acpi66: Add RISC-V MADT and RHCT structures
ACPI 6.6 introduced new MADT structures for RISC-V and a new static
table RHCT. Add the definitions for these new structures.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
2025-07-21 09:28:16 +00:00
be053713c0 MdePkg: RISC-V: Add PeiServicesTablePointerLib
Based on PI 1.9, the PEI service pointer will be stored in the
scratch register.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-07-15 05:45:15 +00:00
4d80dc68c6 MdePkg: RISC-V: Remove firmware context APIs
Eliminate the APIs using the scratch register as PI 1.9 specifies
it for the PEI service table pointer.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-07-15 05:45:15 +00:00
8f62819df3 MdePkg/BaseCpuLib: Add FPU initialization support for RISC-V
Enable RISC-V support for the InitializeFloatingPointUnits function.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-07-15 05:45:15 +00:00
42b30dbc03 MdePkg: Include: Add defines for AA64PFR2 system register
The AA64PFR2 system register is required to detect GICv5 support.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-07-15 02:10:39 +00:00
dbf45a870b MdePkg: Add DEBUG_SECURITY Bit in PcdDebugPrintErrorLevel
Tcg2Dxe and its libraries are currently the noisiest modules in
edk2. For a sample platform printing at INFO level, Tcg2Dxe
printed 4,000 lines out of 5,700 total lines printed.

This commit defines a DEBUG_SECURITY bit to control the debug output
of Tcg2Dxe and other security related components. Most of the output is
not useful except for deep debugging of TPM transactions, so it is
appropriate to only print when the DEBUG_SECURITY bit is present.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-07-14 07:25:12 +00:00
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
c7569abdc4 MdePkg: Remove UGA support
The Universal Graphics Adapter (UGA) is a graphic abstraction.
The UGA I/O and Draw protocols are deprecated since UEFI 2.0 was
introduced. Cf. the UEFI spec v2.9:
"Appendix L - EFI 1.10 Protocol Changes and Deprecation List"
section L.2 "Deprecated Protocols"

Remove the UGA support.

Signed-off-by: GuoMinJ <newexplorerj@gmail.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-08 15:42:03 +00:00
0eae93e07c MdePkg: Correct spelling errors and typos
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-07-04 09:41:47 +08:00
a0d78f6625 MdePkg: ArmFfaMemMgmtLib: Introduce FF-A memory protocol library
This change introduced a library interface that implements the FF-A
memory protocol v1.3 ALP1:
https://developer.arm.com/documentation/den0140/f

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 17:38:28 +00:00
22142b4f4a MdePkg, MdeModulePkg: ArmFfaLib: Expose FFA_ARGS and ArmCallFfa
FFA is a framework that supports various protocols built on top. i.e.
memory protocol, which is nothing that can be done through existing
interfaces.

Instead of requiring protocol authors to check conduit PCD in every
implementation, exposing the ArmCallFfa is a unified way to allow other
protocols to leverage FFA interfaces.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 17:38:28 +00:00
d7110cd638 MdePkg: Add ACPI 5.1 table definition for WAET
This is a struct needed for virtualizing Windows.

https://uefi.org/acpi entry for WAET links to
https://learn.microsoft.com/en-us/previous-versions/gg487524(v=msdn.10)

which describes the 32-bit flags field with bits 0 and 1 defined.

Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
2025-06-25 20:53:49 +00:00
953b9d0e57 MdePkg: Use Library/GoogleTestLib.h
Update unit tests to use GoogleTestLib.h instead
of gtest.h so the edk2 extensions for google tests
are always available.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
510a5c2039 MdePkg/Acpi66.h: Add ACPI 6.6 header
Create Acpi66.h, which is copied from Acpi65.h, and make the following
changes:

1. Replace all occurences of "6.5/6_5" with "6.6/6_6".
2. Add "ResetVector" in Multiprocessor Wakeup Structure.
3. Add "Test" command for Multiprocessor Wakeup Mailbox.
4. Make Acpi66.h the latest ACPI definitions that Acpi.h contains.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-06-20 10:23:42 +08:00
dcfb898199 MdePkg: Fix EFI_SUCCESS typos
EFI_SUCESS -> EFI_SUCCESS

Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-06-12 17:50:45 +00:00
614d5ba332 MdePkg: Fix definition typos
`defintion`->`definition`

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2025-06-11 17:20:20 +00:00
6ec73a6c95 MdePkg: BaseLib: Add UUID-GUID conversion function
With interactions between Standalone MM partitions and normal UEFI
environment, there is constant need to convert UUID to GUID and back.

This change added 2 new interfaces to BaseLib that support such usage.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-05 05:01:57 +00:00
6b1b031cef MdePkg/BaseFdtLib: fix declaration/definition misalignment
Commit e25331fc45
("MdePkg,UefiPayloadPkg: clean up BaseFdtLib API confusion"),
missed out aligning the wrapper for fdt_node_offset_by_property_value
between heade and implementation.
Fix this by updating the header to declare FdtNodeOffsetByPropValue
instead of FdtNodeOffsetByPropertyValue.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-05-30 08:59:54 +00:00
72dc1d0104 MdePkg/BaseFdtLib: add a few new function wrappers
Add FdtSetPropString(), FdtDelNode() and FdtGetPath().

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-05-30 08:59:54 +00:00
365085f707 MdePkg/IndustryStandard: update Tpm2Acpi table to revision 5
Tpm2AcpiTable revision 5 adds new START_METHOD with Arm FF-A transfer.
add related information and update its generator.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-05-28 16:48:18 +00:00
9c1259b4ed MdePkg: Added MockHiiDatabase protocol
Signed-off-by: Bhavani Subramanian <v-bhavanisu@microsoft.com>
2025-05-28 08:01:10 +00:00
29520ddcbb MdePkg/IndustryStandard: add CRB Cap value in TpmPtp.h
add some value macro used for discerning CRB capabilties

Links: https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-05-28 03:17:05 +00:00