Check fdt_getprop_by_offset() return value for NULL pointer (like all
other callers) to prevent a Coverity issue (CWE-476).
Signed-off-by: Bruno Achauer <bruno.achauer@intel.com>
error log:
MdePkg\Library\BaseFdtLib\libfdt\libfdt\fdt_rw.c(194) : error C2220: the following warning is treated as an error
MdePkg\Library\BaseFdtLib\libfdt\libfdt\fdt_rw.c(111) : warning C4706: assignment within conditional expression
MdePkg\Library\BaseFdtLib\libfdt\libfdt\fdt_rw.c(194) : warning C4706: assignment within conditional expression
MdePkg\Library\BaseFdtLib\libfdt\libfdt\fdt_rw.c(89) : error C2220: the following warning is treated as an error
ref: https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4706?view=msvc-170
Signed-off-by: Randy <randy.lin@intel.com>
The FdtLib is from EDK2 stable branch 202311.
FdtLib is used to boot FIT image.
Replace tab with space to follow EDK2 coding style.
Signed-off-by: Guo Dong <guo.dong@intel.com>
The current BaseTools aligned with edk2-stable202311
introduces the replacement of __FUNCTION__ with __func__,
which causes compiler failure if the toolchain is using
VS2015. It is because VS2015 doesn't support __func__.
This patch reverts the change and its checker to continue
the VS2015 support.
Reference commit IDs from edk2 repo: b17a3a1 and c9fb11f
Test command: python BuildLoader.py build xxxx -t VS2015
Signed-off-by: Vincent Chen <vincent.chen@intel.com>
* Sync BaseTools to align with edk2-stable202311
Keep the SBL specific change (e.g. Lz4).
Signed-off-by: Guo Dong <guo.dong@intel.com>
* feat: Sync MdePkg from EDK2 edk2-stable202311 branch
Only sync required file without any changes to EDK2 files.
Signed-off-by: Guo Dong <guo.dong@intel.com>
* feat: Update MdePkg for SBL after sync from EDK2
Signed-off-by: Guo Dong <guo.dong@intel.com>
* Update SBL after updating Basetool and MdePkg
After Sync BaseTool and MdePkg to edk2-stable202311,
Need update SBL code to align with this change.
Signed-off-by: Guo Dong <guo.dong@intel.com>
* feat: rollback some changes after mdepkg sync
New change from MdePkg requires new NASM version.
To make sure NASM 2.14.02 still works, just rollback
few changes.
Signed-off-by: Guo Dong <guo.dong@intel.com>
* feat: Update component size to fix build failure
After syncing BaseTool and MdePkg, some components would
have a little bigger size. So update the config to fix the
build failure.
Signed-off-by: Guo Dong <guo.dong@intel.com>
* feat: Remove unused asl code
Some ASL files don't exist but they are included in other asl files.
It would cause build failure with new build BaseTool. So just remove
them to fix the build failure.
Signed-off-by: Guo Dong <guo.dong@intel.com>
---------
Signed-off-by: Guo Dong <guo.dong@intel.com>
Much like the corresponding Stage1A patch, this patch aligns the
Ia32 Stage1B and Stage2 stacks to 16 bytes, like what is already the
case for X64, so that we follow Version 1.0 of the System V Intel386
ABI supplement, and satisfy any expectations our compiler may have
regarding stack alignment.
A nice side effect of this change is that it allows building an Ia32
Slimbootloader with -msse which can run on real hardware, which requires
16-byte stack alignment. Slimbootloader currently already enables SSE
in XCR0 early on in Stage1A, and it has SSE versions of various helper
functions written in assembly, in other words, it already makes use of
SSE, but allowing the compiler to emit SSE instructions requires 16-byte
stack alignment, because access to unaligned on-stack SSE variables
will throw #GP on real hardware. (QEMU doesn't seem to enforce the
requirement for natural alignment of SSE memory arguments.)
Suggested-by: Peter Edwards <peadar@arista.com>
Signed-off-by: Lennert Buytenhek <buytenh@arista.com>
Much like the corresponding Stage1A patch, this patch aligns the
Ia32 Stage1B and Stage2 stacks to 16 bytes, like what is already the
case for X64, so that we follow Version 1.0 of the System V Intel386
ABI supplement, and satisfy any expectations our compiler may have
regarding stack alignment.
A nice side effect of this change is that it allows building an Ia32
Slimbootloader with -msse which can run on real hardware, which requires
16-byte stack alignment. Slimbootloader currently already enables SSE
in XCR0 early on in Stage1A, and it has SSE versions of various helper
functions written in assembly, in other words, it already makes use of
SSE, but allowing the compiler to emit SSE instructions requires 16-byte
stack alignment, because access to unaligned on-stack SSE variables
will throw #GP on real hardware. (QEMU doesn't seem to enforce the
requirement for natural alignment of SSE memory arguments.)
Suggested-by: Peter Edwards <peadar@arista.com>
Signed-off-by: Lennert Buytenhek <buytenh@arista.com>
Convert the line endings stored for all text files in the repository to
LF. The majority previously used DOS-style CRLF line endings. Add a
.gitattributes file to enforce this and treat certain extensions as
never being text files.
Update PatchCheck.py to insist on LF line endings rather than CRLF.
However, its other checks fail on this commit due to lots of
pre-existing complaints that it only notices because the line endings
have changed.
Silicon/QemuSocPkg/FspBin/Patches/0001-Build-QEMU-FSP-2.0-binaries.patch
needs to be treated as binary since it contains a mixture of line
endings.
This change has implications depending on the client platform you are
using the repository from:
* Windows
The usual configuration for Git on Windows means that text files will
be checked out to the work tree with DOS-style CRLF line endings. If
that's not the case then you can configure Git to do so for the entire
machine with:
git config --global core.autocrlf true
or for just the repository with:
git config core.autocrlf true
Line endings will be normalised to LF when they are committed to the
repository. If you commit a text file with only LF line endings then it
will be converted to CRLF line endings in your work tree.
* Linux, MacOS and other Unices
The usual configuration for Git on such platforms is to check files out
of the repository with LF line endings. This is probably the right thing
for you. In the unlikely even that you are using Git on Unix but editing
or compiling on Windows for some reason then you may need to tweak your
configuration to force the use of CRLF line endings as described above.
* General
For more information see
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings .
Fixes: https://github.com/slimbootloader/slimbootloader/issues/1400
Signed-off-by: Mike Crowe <mac@mcrowe.com>
This patch added PciSegmentLib implementation from EDK2 MdePkg.
This library can be used by silicon libraries to access PCI
device with multiple segments. As part of this change, the
duplicated files were removed for CML and CMLV.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
* Add missing X64 MdePkg Library
This adds some missing Library from EDKII Stable201911.
- MdePkg/Library/BaseMemoryLibRepStr/X64
- MdePkg/Library/BaseSynchronizationLib/X64
Signed-off-by: Aiden Park <aiden.park@intel.com>
* Make X64 target buildable
This is just to build X64 target - Not functional.
Signed-off-by: Aiden Park <aiden.park@intel.com>
Synced up MdePkg, IntelFsp2Pkg and BaseTools to EDK2 stable tag
edk2-stable201905.
There are several changes for MdePkg and BaseTools.
MdePkg:
- Support light print to reduce SBL size
MdePkg\Library\BasePrintLib\PrintLibInternal.c
MdePkg\Include\Library\DebugLib.h
- TCG TPM2 spec changes and remove dependencies
MdePkg\Include\IndustryStandard\UefiTcgPlatform.h
MdePkg\Include\IndustryStandard\Tpm2Acpi.h
- Use old NVM protocol file
MdePkg\Include\Protocol\NvmExpressPassthru.h
- Removed unused files
BaseTools:
- Added LZ4 support
- Removed unused files
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Copying the MdePkg BaseMemoryLibSse2 library into
SBL for faster CopyMem and other routines to improve
boot performance every where except for Stage1A &
Stage1B due to 'movntdq' usage limitation in earlier
stages. Remove all of the X64 files since SBL is compiled
as 32-bit. Also patch PCI enumeration code to perform
manual memory copying (using SSE2 CopyMem gives some
issue as tested on APL).
The BaseMemoryLibSse2 folder was copied from EDK2
GitHub based on the following commit ID:
9344f0921518309295da89c221d10cbead8531aa
Signed-off-by: James Gutbub <james.gutbub@intel.com>