summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Library/AcpiLib
AgeCommit message (Collapse)AuthorFilesLines
2026-08-12EmbeddedPkg/AcpiLib: Fix memory corruption in AcpiAmlObjectUpdateIntegeredk2-stable202608Johnny.Fan1-3/+55
The original implementation of AcpiAmlObjectUpdateInteger had a critical bug when updating integer objects that were encoded with AML_ZERO_OP(0x00) or AML_ONE_OP(0x01), which are 1-byte optimized encodings. When the caller tried to update such an object to a value other than 0 or 1, the code would: 1. Overwrite the opcode byte with the new value's LSB 2. This changed the opcode itself, e.g. 0x0B becomes AML_WORD_PREFIX 3. Subsequent AML bytes (name segments of following objects) get misinterpreted as integer data 4. Result: silent AML structure is silently corrupted, causing the OS to fail parsing ACPI tables and eventually crash. The fix: 1. Only allow 0 -> 0 or 1 updates using the original 1-byte encoding 2. For any other value, explicitly fail with a diagnostic 3. Provide clear debug instructions on how to fix the ASL source Reviewed-by: jie.fu <jie.fu@cixtech.com> Signed-off-by: Johnny.Fan <Johnny.Fan@cixtech.com>
2024-11-27EmbeddedPkg: reduce "Found ACPI table" messages from ERROR to INFORebecca Cran1-1/+1
The "Found ACPI table" messages are informative and don't indicate an error, so reduce the debug level from DEBUG_ERROR to DEBUG_INFO. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2024-08-30EmbeddedPkg: Improve LocateAndInstallAcpiFromFvConditionalRebecca Cran1-41/+45
LocateAndInstallAcpiFromFvConditional was always returning EFI_SUCCESS even when it failed to find `AcpiFile`. Fix that, and improve the layout by checking if an error occurred and breaking earlier. Signed-off-by: Rebecca Cran <rebecca@bsdio.com>
2022-10-03EmbeddedPkg/AcpiLib: Fix code formatting errorsMichael Kubacki1-48/+50
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4046 This package did not have CI enabled so code changes were merged that fail uncrustify formatting. This change updates those files to include uncustify formatting. Cc: Leif Lindholm <quic_llindhol@quicinc.com> Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Abner Chang <abner.chang@amd.com> Cc: Daniel Schaefer <git@danielschaefer.me> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Acked-by: Ard Biesheuvel <ardb@kernel.org>
2021-12-17EmbeddedPkg/AcpiLib: Add more helper functionsNhi Pham2-0/+220
This adds more helper functions that assist in calculating the checksum, locating an ACPI table by signature, and updating an AML integer object. Cc: Ard Biesheuvel <ardb+tianocore@kernel.org> Cc: Daniel Schaefer <daniel.schaefer@hpe.com> Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com> Acked-by: Leif Lindholm <leif@nuviainc.com> Reviewed-by: Abner Chang <abner.chang@hpe.com>
2021-12-07EmbeddedPkg: Apply uncrustify changesMichael Kubacki1-46/+49
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the EmbeddedPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Andrew Fish <afish@apple.com>
2021-12-07EmbeddedPkg: Change use of EFI_D_* to DEBUG_*Michael D Kinney1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2019-04-09EmbeddedPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2-13/+2
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2015-05-29EmbeddedPkg/AcpiLib: Introduced LocateAndInstallAcpiFromFvConditional()Olivier Martin1-14/+46
This new helper function allows to install ACPI Table on condition. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17540 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-23EmbeddedPkg: Introduced AcpiLibOlivier Martin2-0/+182
AcpiLib is a library to help working with ACPI Tables. In this initial implementation, the library provides: - a helper function to locate and install the ACPI Tables within a Firmware Volume - Some helper macros to initialize some ACPI structures Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Graeme Gregory <graeme.gregory@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16650 6f19259b-4bc3-4df7-8a09-765794883524