Commit Graph

2280 Commits

Author SHA1 Message Date
Ard Biesheuvel ea2f6c68ee MdePkg/Base: Don't error out on missing compiler CPP macros
STATIC_ASSERT is #define'd to a compiler specific value, based on
built-in macros exposed by those compilers. If none of those are found,
an #error is raised.

This breaks the DTCPP build rule, which relies on the C preprocessor
for header file inclusion and value substitution, but doesn't define any
of the compiler macros we look for.

So drop the error case. If STATIC_ASSERT is used without a definition,
an error will be raised anyway.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2025-01-17 16:39:29 +00:00
Nickle Wang 1301e0b47e MdePkg: Add manageability status code defined in PI 1.9 Spec.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4483

This change introduces EFI_COMPUTING_UNIT_MANAGEABILITY status code.
EFI_COMPUTING_UNIT_MANAGEABILITY is created as one of the subclasses in
computing unit class. EFI_COMPUTING_UNIT_MANAGEABILITY will be used in
edk2 RedfishPkg and edk2-redfish-client RedfishClientPkg to report
Redfish operation errors. It will also be used to report errors in
edk2-platforms ManageabilityPkg.

PI 1.9 specification, 6.4.1.4.9. Manageability Subclass:
* https://uefi.org/specs/PI/1.9/V3_Status_Codes.html#manageability-subclass

RFC:
* https://edk2.groups.io/g/devel/message/105525
* https://edk2.groups.io/g/devel/message/105595
* https://edk2.groups.io/g/rfc/message/802

Signed-off-by: Nickle Wang <nicklew@nvidia.com>
2025-01-17 04:36:00 +00:00
Michael D Kinney 8b2256fbf2 MdePkg/Include: Use _Static_assert for clang and GNUC
The clang compiler generates the following error

error: use of 'static_assert' without inclusion of <assert.h>

This is due to the use of the MSC Extension static_assert.
Use _Static_assert instead for clang and GNUC compilers.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-01-16 05:33:13 +00:00
Sarah Walker 7216013b36 MdePkg: Tpm2Acpi.h: Add defines for TPM2 ACPI table revision 5
Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-01-09 12:41:19 +08:00
INDIA\sachinganesh 114b54e3fb MdePkg: Update AtaPassThru header to UEFI 2.10A
UEFI 2.10A Specification has added a new error case to
EFI_ATA_PASS_THRU_PROTOCOL.GetNextDevice API which handles
port multiplier not being connected to the Port.

Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-01-09 12:40:45 +08:00
INDIA\sachinganesh e4d74bb592 MdePkg: Add UEFI Specification macros
Add macros for UEFI 2.9 and UEFI 2.10 Specifications

Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-01-09 12:40:45 +08:00
INDIA\sachinganesh a872cc18e0 MdePkg: Clarify return status of FMP Protocol GetImage()
Clarifed the return status of EFI_FIRMWARE_MANAGEMENT_PROTOCOL.GetImage().
As intended in UEFI 2.10 Specification.

Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-01-09 12:40:45 +08:00
INDIA\sachinganesh 9144bb940a MdePkg: Update Default IP TTL
Default IP TTL (Time to Live) has been updated in UEFI 2.10 A
Specification. To comply with IANA recommendations.

REF: https://www.iana.org/assignments/ip-parameters/ip-parameters.xhtml#ip-parameters-2

Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-01-09 12:40:45 +08:00
Phil Noh 7e03c40659 MdePkg: Update BASE_CR macro in Base.h for a Coverity error
Coverity is a static analysis tool. It detects the macro as an error
(case to incompatible type, cert_exp39_c_violation). The update resolves
the error and supports compliance with the static analysis tool.

Signed-off-by: Phil Noh <Phil.Noh@amd.com>
2025-01-07 09:28:02 +08:00
Chris Fernald cef65b2e93 MdePkg BootManagerPolicy.h: Define GUID for connecting storage devices.
Some platforms require connecting storage media while booting to
network, or require enumerating storage protocols that were not initially
enumerated during BDS. This change adds a GUID to allow implementation
of boot manager's ConnectDeviceClass to connect storage media.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
2024-12-17 04:15:46 +00:00
Christopher Zurcher 7936ffa1e6 MdePkg/Ufs.h: Update to UFS 4.0
Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com>
2024-12-16 15:39:35 +08:00
Christopher Zurcher 29ebe5ee5a MdePkg/IndustryStandard: Add UFS definitions
These files are direct ports from the (identical) files:
MdeModulePkg\Bus\Ufs\UfsBlockIoPei\UfsHci.h
MdeModulePkg\Bus\Ufs\UfsPassThruDxe\UfsPassThruHci.h

Signed-off-by: Christopher Zurcher <christopher.zurcher@microsoft.com>
2024-12-16 15:39:35 +08:00
Oleg Ilyasov 1a440d9638 Retrieve the USB class specific data from the configuration descriptor
If USB device reports class specific descriptors, it is currently the job of
device driver to parse the configuration to find the class specific data.
The new library functions parse the configuration descriptor and return class
specific interface and class specific endpoint descriptors.
Also, these new functions allow to retrieve the data from non-default alternate
settings without performing a switch to this setting. Switching to the
alternate setting currently implies the execution of UsbSetInterface function
that performs USB control trnasfer.
In some cases this switch is not desirable so the new functions
UsbGetInterfaceDescriptorSetting and UsbGetEndpointDescriptorSetting come
in handy.

Signed-off-by: Oleg Ilyasov <olegi@ami.com>
2024-12-13 23:56:10 +00:00
Chao Li 3c8e10c8b3 MdePkg: Synchronize UEFI2.11 LoongArch64 DebugSupportLib definition
Synchronize the changes about LoongArch64 in section 18.2.5 of UEFI2.11.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Signed-off-by: Chao Li <lichao@loongson.cn>
2024-12-12 04:57:03 +00:00
Kun Qin 6539b693d1 MdePkg: ArmLib: Return UINT32 for ArmCacheWritebackGranule
ArmCacheWritebackGranule should not return value higher than MAX_UINT32.

This change will allow the usage without architecture depenedent return
size.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Sami Mujawar <sami.mujawar@arm.com>

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2024-12-11 18:21:29 +00:00
Raymond Yang 232003ce5a MdePkg: Update StatusCodeDataTypeId.h
Refine comments for EFI_STATUS_CODE_SPECIFIC_DATA_GUID .
Add the structs defined in this file for EFI_STATUS_CODE_SPECIFIC_DATA_GUID to comment.

Signed-off-by: Raymond Yang <yangrongwei@hotmail.com>
2024-12-11 09:54:54 +08:00
John Chung 5b760ca087 MdePkg/IndustryStandard: Add definitions for IPMI Serial
Add IPMI Serial definitions

Specification reference:
https://www.intel.com/content/www/us/en/products/docs/servers/ipmi/ipmi-second-gen-interface-spec-v2-rev1-1.html

Signed-off-by: John Chung <john.chung@arm.com>
2024-12-09 19:57:53 +00:00
Michael D Kinney da1084ccf4 MdePkg/Include/IndustryStandard: Address C++ keyword collisions
Update Tpm12.h and Tpm20.h and not use c++ reserved keywords
operator and xor in C structures to support use of these
include files when building with a C++ compiler.

This patch removes the temporary use of anonymous unions and
warning 4201 disable for VS20xx tool chains to complete the
following field name changes:

* operator -> operator_
* xor -> xor_

NOTE: This is a non-backwards compatible change to Tpm12.h
and Tmp20.h. And consumers of these include files that access
the "operator" or "xor" fields must be updated.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-12-03 06:25:32 +00:00
Michael D Kinney 05ac9a58f5 MdePkg/Include/IndustryStandard: Add operator_ and xor_ field names
Update Tpm12.h and Tpm20.h and not use c++ reserved keywords
operator and xor in C structures to support use of these
include files when building with a C++ compiler.

This patch temporarily introduces an anonymous union to add
operator_ and xor_ fields to support migration from the current
field names to the new field names.

Warning 4201 is disabled for VS20xx tool chains is a temporary
change to allow the use of anonymous unions.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2024-12-03 06:25:32 +00:00
Ard Biesheuvel c2827283a8 MdePkg/AArch64: Add some missing MMU related constants
Add definitions for the non-global page tables descriptor attribute, as
well as the E2H TCR bit, so that we can use them in the MMU code.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
2024-11-26 23:53:16 +00:00
Jessica Clarke 1bd09ad193 MdePkg: Define AARCH64_CPTR_RES1 and AARCH64_CPTR_DEFAULT
These constants give the set of RES1 bits in CPTR_EL2, as 1s, and the
default value to use for CPTR_EL2 in order to enable all known (or
harmless) features but no unknown ones that require EL2 knowledge. This
will be used by ArmPlatformPkg in the following commit, separated due to
being different packages, even though the combined change is tiny.

Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
2024-11-14 06:25:27 +00:00
Jessica Clarke ef35863880 ArmPlatformPkg,MdePkg: Rename AARCH64 CPACR_CP_FULL_ACCESS
CP_FULL_ACCESS is a misnomer, we only enable access to SIMD/FP state,
and although the register's mnemonic is CPACR_EL1, its full name is
"Architectural Feature Access Control Register", with AArch64 having no
coprocessors like AArch32 did, so the "CP" is also not appropriate.
Rename it to show it's the default value we use on entry, and define it
in terms of the existing CPACR_FPEN_FULL rather than a magic constant
with the same value to more clearly document that fact. Also update
comments to reflect all this (including the CPTR_EL2 case).

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com>
2024-11-14 06:25:27 +00:00
Kun Qin 961a9e1d76 MdePkg: Added definition of AMD specific public MSRs
Added definition of AMD specific public MSRs:
1. SMBASE
2. SMM_ADDR
3. SMM_MASK

Signed-off-by: Kun Qin <kuqin@microsoft.com>
2024-11-12 01:07:12 +00:00
Michael Kubacki b7735a087a MdePkg: CodeQL Fixes.
Includes changes across the repo for the following CodeQL rules:
- cpp/comparison-with-wider-type
- cpp/overflow-buffer
- cpp/redundant-null-check-param
- cpp/uselesstest

Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
2024-11-01 04:30:39 +00:00
Sienski Piotr 9c557575a1 MdePkg/Include/Guid: Fix EFI_CXL_COMPONENT_EVENT_LOG in Cper.h
[Issue Description]
CXL_ERROR_PCIE_DEV_ID in Cper.h was renamed to EFI_CXL_ERROR_PCIE_DEV_ID,
but EFI_CXL_COMPONENT_EVENT_LOG still uses previous name.

[Resolution]
Modify EFI_CXL_COMPONENT_EVENT_LOG to use EFI_CXL_ERROR_PCIE_DEV_ID

Signed-off-by: Sienski Piotr <piotr.sienski@intel.com>
2024-10-22 21:01:27 +00:00
Revathy V 9dc7fb819c MdePkg: Updated Type 4 Info as per Smbios 3.8.0
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4861

Added PROCESSOR_FAMILY_NAME support in MdePkg.

Signed-off-by: Revathy <revathyv@ami.com>
2024-10-22 18:25:54 +00:00
Sienski Piotr a19f50bb95 MdePkg/Include/Guid: Rename CXL definitions in Cper.h
[Issue Description]
In MdePkg/Include/Guid/Cper.h there are multiple definitions
regarding CXL that can do use EFI_ prefix in their names

[Resolution]
Rename these definitions in MdePkg/Include/Guid/Cper.h

Signed-off-by: Sienski Piotr <piotr.sienski@intel.com>
2024-10-21 15:59:39 +00:00
Mike Beaton ae83c6b7fd MdePkg: Fix null macros for XCODE5 and CLANG
When building OvmfPkg in RELEASE mode in the XCODE5 toolchain, the
ASSERT_EFI_ERROR change prevents this error:

.../MdePkg/Library/UefiMemoryAllocationLib/MemoryAllocationLib.c:141:15:
error: variable 'Status' set but not used [-Werror,-Wunused-but-set-variable]
  EFI_STATUS  Status;
              ^

which is currently stopping the build.

When building in RELEASE mode in the CLANGPDB toolchain,the DEBUG macro
change prevents this error:

.../edk2/OvmfPkg/VirtioSerialDxe/VirtioSerial.c:28:22: error:
variable &apos;EventNames&apos; is not needed and will not be
emitted [-Werror,-Wunneeded-internal-declaration]
STATIC CONST CHAR8  *EventNames[] = {
                     ^

which is currently stopping the build.

CLANGDWARF produces the same error as CLANGPDB above, if
-Wno-unneeded-internal-declaration is removed from its build flags.
With the null DEBUG macro change, this warning suppression
can be removed from CLANGDWARF, which is considered a benefit
as it has the potential to catch real coding errors. This is
done in a subsequent commit.

This commit has the desirable side effect that we no longer require
(and cannot use) explicit `#ifndef MDEPKG_NDEBUG` around items only
used in DEBUG macros. This requires the ArmPkg change made here to
be in the same commit as the MdePkg changes.

Note: In common with existing macros in EDK II, including the pre-existing
and unchanged DEBUG/NOOPT versions of the macros which are modified here,
we use the standard approach of adding `do { ... } while (FALSE)` wrapping
to ensure that the macros behave correctly with surrounding code
(e.g. require a following ';' and do not combine in unexpected ways with
nearby conditionals).

Continuous-integration-options: PatchCheck.ignore-multi-package
Co-authored-by: Mikhail Krichanov <krichanov@ispras.ru>
Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2024-10-18 16:22:07 +00:00
Sienski Piotr 1b70dcd375 MdePkg/Include/Guid: Add missing CXL definitions to Cper.h
[Issue Description]
In MdePkg/Include/Guid/Cper.h there are missing multiple definitions
regarding CXL that can be found in UEFI 2.10 spec
chapters N.2.13 and N.2.14

[Resolution]
Add these definitions to MdePkg/Include/Guid/Cper.h

Signed-off-by: Sienski Piotr <piotr.sienski@intel.com>
2024-10-17 11:24:28 +00:00
Kun Qin b3f36e151d MdePkg: Update Delayed Dispatch PPI as per PI 1.8 A Spec
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4496

PI spec defined the `Register` function input argument `Delay` as output.
However, this parameter should be used to define the minmal time delay
the callback should fire. Thus it should be an input parameter.

This change fixed the argument type.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>

Co-authored-by: Mike Turner <mikeyt@pobox.com>
Co-authored-by: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Kun Qin <kuqin12@gmail.com>
2024-10-17 08:51:15 +00:00
Oleg Ilyasov 1b19ccfdfa Add USB Association Descriptor definitions
- USB 3.0 spec, Section 9.6.4
- Add class specific descriptor types

Signed-off-by: Oleg Ilyasov <olegi@ami.com>
2024-10-16 17:42:26 +00:00
INDIA\sachinganesh 92c1274467 MdePkg: Describe storage location of config tables as per PI 1.7 A spec
Added comments to describe the storage location of DXE Services Table,
HOB List Table and PEI Vector Handoff Table.

As defined in PI 1.7 A Errata specification.

Cc: Felix Polyudov <felixp@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2024-10-16 00:27:51 +00:00
INDIA\sachinganesh caec6089cf MdePkg: Clarify EFI_MM_SX_DISPATCH_PROTOCOL.Register() as per PI 1.7 A spec
Clarified comments regarding the usage of RegisterContext parameter of
Register() API in EFI_MM_SX_DISPATCH_PROTOCOL.

As defined in the PI 1.7 A Errata specification.

Cc: Felix Polyudov <felixp@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2024-10-16 00:27:51 +00:00
INDIA\sachinganesh c80f456ef4 MdePkg: Define PI Specification Version Macro
Defined PI specification version.
Used them to define revisions of PEI/DXE/MM system tables.

Cc: Felix Polyudov <felixp@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2024-10-16 00:27:51 +00:00
Oliver Smith-Denny d99045f392 MdePkg: DebugLib: Check Signature in CR in Release Builds
The CR macro is used to access an enclosing structure from a
pointer within the structure. In DEBUG builds (i.e. when
MDEPKG_NDEBUG is not set and debug asserts are enabled), this
macro does signature validation checking to ensure that the
structure that has been found is the correct structure, based
on a signature passed in by the caller.

However, if MDEPKG_NDEBUG is set or debug asserts are disabled,
no signature validation is performed, meaning that CR may return
an invalid structure that the caller believes is valid and has had
signature validation on, causing undefined behavior (memory
corruption). We should where at all possible have defined behavior,
particularly in RELEASE builds, which are what typical platforms
will ship to consumers.

This patch updates CR to do the signature validation in all scenarios
to provide defined behavior from the macro. In the event of a
signature failure, CR will either 1) assert if !MDEPKG_NDEBUG and
debug asserts are enabled (existing behavior) or 2) return NULL to
indicate to the caller that signature validation failed.

There exist consumers today who already, erroneously, rely on this
behavior.

Another macro, BASE_CR, exists for callers who do not wish to perform
signature validation. Any code that wishes to avoid the signature
validation should move to this macro.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-10-08 00:31:58 +00:00
Heinrich Schuchardt 28dd588ca8 MdePkg/BaseLib: RISC-V: Add FPU CSR constants
* Define CSR fcsr
* Define bitmasks for vs and fs bit fields in the mstatus register

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
2024-10-04 04:53:21 +00:00
Abdul Lateef Attar 0958b762fb MdePkg/IndustryStandard: Adds SPMI macros
Adds macro which defines SPMI table revision
and interface type as per the specification.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Cc: Pierre Gondois <pierre.gondois@arm.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2024-10-03 08:58:50 +00:00
Leif Lindholm 9a1d54665c MdePkg: add various additional functions to BaseFdtLib
- FdtOffsetPointer
- FdtParentOffset
- FdtNodeOffsetByPhandle
- FdtStringListContains
- FdtGetAliasNameLen
- FdtPathOffsetNameLen
- FdtPathOffset

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Leif Lindholm 450a001c09 MdePkg: export additional Property functions from BaseFdtLib
- FdtSetPropU64
- FdtAppendProp
- FdtDelProp

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Leif Lindholm 5bad560935 MdePkg: export FdtAddressCells/FdtSizeCells from BaseFdtLib
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Leif Lindholm 9ba11ee131 MdePkg: export FdtOpenInto/FdtPack from BaseFdtLib
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Leif Lindholm 9dc9a4bae6 MdePkg: export some additional macros from BaseFdtLib
- FDT_TAGSIZE and FDT_MAX_NCELLS
- FdtGetHeader/FdtTotalSize
- FdtForEachSubnode

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Leif Lindholm 8292296893 MdePkg: add FdtStrerror wrapper to BaseFdtLib
Add a wrapper for fdt_strerror () and add the currently supported error
code defines from submodule.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Leif Lindholm 8040fdbb8b MdePkg: consistently use "Property" in BaseFdtLib
There is currently a mix on functions named as Prop or Property.
The latter is in majority, and the better fit for tianocore coding style,
so rename FdtNodeOffsetByPropValue () and FdtSetProp () for consistency.

To avoid breaking bisect, change existing users in UefiPayloadPkg.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Leif Lindholm bf7dbf6380 MdePkg,UefiPayloadPkg: improve BaseFdtLib memreserve helper style
FdtNumRsv and FdtGetMemRsv were added for the benefit of UefiPayloadPkg,
but their naming matches neither upstream libfdt nor tianocore coding
style rules. And there was scope for improvement of the doxygen
descriptions as well.

These functions currently have only one in-tree user, UefiPayloadPkg
FdtParserLib. So rename them more conformant
FdtGetNumberOfReserveMapEntries
and
FdtGetReserveMapEntry
and update the description comment blocks, at the same time as
updating the existing user.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
2024-10-02 02:58:31 +00:00
Mike Beaton 0aa93aecb7 MdePkg: Fix DEBUG_CODE and PERF_CODE macros for XCODE5
Without these changes, we get the error:

  error: variable '__DebugCodeLocal' set but not used

from the DebugLib.h DEBUG_CODE_BEGIN()/END() macros on XCODE5.

Similarly, in NOOPT builds only, we get:

  error: variable '__PerformanceCodeLocal' set but not used

from the PerformanceLib.h PERF_CODE_BEGIN()/END() macros on XCODE5.

It is important to note that the previous code involving a local
variable was intended to ensure correct behaviour of ; following
the macros, in particular that ; should be required:
 - https://github.com/tianocore/edk2/pull/6226#issuecomment-2364087866
 - https://github.com/tianocore/edk2/pull/6226#issuecomment-2364619759
This converted version repeats the
standard do { ... } while (FALSE) idiom (which is already used in
the END macro) to achieve the same affect.

The modified versions work on all toolchains.

Signed-off-by: Mike Beaton <mjsbeaton@gmail.com>
2024-09-27 16:57:36 +00:00
Dhaval 043045cd6e MdePkg: Add reserved mem fdt helpers
Devicetree defines a short hand way of defining reserved memory
ranges. Add APIs to access such nodes

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
2024-09-14 03:38:47 +00:00
Chun-Yi Lee 5c8bdb190f MdePkg DebugLib: Enable FILE NAME as DEBUG ASSERT for GCC12
Using __FILE_NAME__ is useful for reducing the size of debug image and
it's also good for reproducable builds. The gcc-12 also supported this
macro.

Ref: https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=1a9b3f04c11eb467a8dc504a37dad57a371a0d4c

This patch removed the checking of __clang__ when using __FILE_NAME__.

References: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42579
Signed-off-by: Chun-Yi Lee <jlee@suse.com>
2024-09-13 12:45:29 +00:00
Leandro Becker 5262108822 MdePkg/Http11.h: Add HTTP header definitions.
Added HTTP header definitions for the following headers:
"Content-Range", "Last-Modified" and "If-Unmodified-Since"

Signed-off-by: Leandro Gustavo Biss Becker <lbecker@positivo.com.br>
2024-09-13 10:26:09 +00:00
Taylor Beebe ac43bbacde MdePkg: Create Stack Check Null Libs
Add Null libs for Stack Check and Stack Check Failure Hook Lib that
allow a platform to opt out of stack checks and the stack check failure
hook lib.

StackCheckLib allows implementation (or in this case null implementation)
of stack checks on binaries. There is a Host Application specific version
of this null lib because MSVC host applications must not be linked against
our lib (so the file here is a no-op but that doesn't cause the build
system to fail the build for not building a file for MSVC) as it links
against the MSVC C runtime lib that provides the stack cookie definitions.
GCC host applications do not link against such a C runtime lib and must
be linked against our version.

StackCheckFailureHookLib lets a platform do custom functionality when a
stack check failure occurs (such as log it to a platform defined
mechanism). The null lib simply returns.

Signed-off-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2024-09-13 03:58:46 +00:00