diff options
author | Marvin Häuser <mhaeuser@posteo.de> | 2023-03-22 00:02:40 -0700 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-04-01 23:11:44 +0000 |
commit | 836042ffd8f1b423d76d01dbdb19982ee5339205 (patch) | |
tree | 463e06b6bc15726e6000cafb77bcb597feb5c1b5 /License.txt | |
parent | 24e6daa2bcfb64bbe871f76d8e9774d67f247717 (diff) | |
download | edk2-836042ffd8f1b423d76d01dbdb19982ee5339205.tar.gz |
MdePkg/Base.h: Introduce various alignment-related macros
ALIGNOF: Determining the alignment requirement of data types is
crucial to ensure safe memory accesses when parsing untrusted data.
IS_POW2: Determining whether a value is a power of two is important
to verify whether untrusted values are valid alignment values.
IS_ALIGNED: In combination with ALIGNOF data offsets can be verified.
A more general version of the IS_ALIGNED macro previously defined by
several modules.
ADDRESS_IS_ALIGNED: Variant of IS_ALIGNED for pointers and addresses.
Replaces module-specific definitions throughout the code base.
ALIGN_VALUE_ADDEND: The addend to align up can be used to directly
determine the required offset for data alignment.
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Vitaly Cheptsov <vit9696@protonmail.com>
Signed-off-by: Marvin Häuser <mhaeuser@posteo.de>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Diffstat (limited to 'License.txt')
0 files changed, 0 insertions, 0 deletions