audk/MdeModulePkg/Library/PiDxeS3BootScriptLib
lijun10x 77d6772708 MdeModulePkg/Library: PcdAcpiS3Enable set FALSE cause Assert
Some platforms don't support S3 with PcdAcpiS3Enable set as False.
Debug mode bios will ASSERT at this time as Follows.
ASSERT_RETURN_ERROR (Status = Out of Resources)
DXE_ASSERT!: Edk2\MdePkg\Library\BaseS3PciSegmentLib\S3PciSegmentLib.c
(61): !(((INTN)(RETURN_STATUS)(Status)) < 0)

Steps to reproduce the issue:
1.Set PcdAcpiS3Enable to FALSE.
2.Build the bios in debug mode.
3.Power on and Check the serial log.
Note: Prerequisite is that S3PciSegmentLib is Called and
the caller's code is run.

Root Cause:
S3PciSegmentLib call S3BootScriptLib controlled by PcdAcpiS3Enable.
If PcdAcpiS3Enable set as false, S3BootScriptLib will return error
status(Out of Resources).
S3PciSegmentLib will ASSERT if S3BootScriptLib return error.

Solution:
Make S3BootScriptLib return success if PcdAcpiS3Enable was disabled,
which behave as a null S3BootScriptLib instance which just return success
for no action is required to do.

Signed-off-by: JunX1 Li <junx1.li@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Sunny Wang <sunny.wang@arm.com>
Cc: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: G Edhaya Chandran <edhaya.chandran@arm.com>
Cc: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
2023-02-15 06:42:12 +00:00
..
BootScriptExecute.c MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootScriptInternalFormat.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
BootScriptSave.c MdeModulePkg/Library: PcdAcpiS3Enable set FALSE cause Assert 2023-02-15 06:42:12 +00:00
DxeS3BootScriptLib.inf MdeModulePkg: Enable/Disable S3BootScript dynamically. 2019-10-01 08:14:45 +08:00
DxeS3BootScriptLib.uni MdeModulePkg: Replace BSD License with BSD+Patent License 2019-04-09 10:58:08 -07:00
InternalBootScriptLib.h MdeModulePkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00