X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;ds=sidebyside;f=IntelFsp2Pkg%2FLibrary%2FBaseFspCommonLib%2FFspCommonLib.c;h=0c5f0b306ea4a187ea86b60abf6d843216ce595f;hb=6b5677e1bb62c289fba7848bbfde08220fc37ba1;hp=151b1893433d726316586dd91ddae38a4c8e2899;hpb=fda7cd4f25f831f93b71c3264143618b3cebfb33;p=mirror_edk2.git diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c index 151b189343..0c5f0b306e 100644 --- a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c +++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c @@ -18,6 +18,7 @@ #include #include #include +#include #pragma pack(1) @@ -544,3 +545,31 @@ GetFspCarSize ( } return CarSize; } + +/** + This function updates the return status of the FSP API with requested reset type and returns to Boot Loader. + + @param[in] FspResetType Reset type that needs to returned as API return status + +**/ +VOID +EFIAPI +FspApiReturnStatusReset ( + IN UINT32 FspResetType + ) +{ + volatile BOOLEAN LoopUntilReset; + + LoopUntilReset = TRUE; + DEBUG ((DEBUG_INFO, "FSP returning control to Bootloader with reset required return status %x\n",FspResetType)); + /// + /// Below code is not an infinite loop.The control will go back to API calling function in BootLoader each time BootLoader + /// calls the FSP API without honoring the reset request by FSP + /// + do { + SetFspApiReturnStatus ((EFI_STATUS)FspResetType); + Pei2LoaderSwitchStack (); + DEBUG ((DEBUG_ERROR, "!!!ERROR: FSP has requested BootLoader for reset. But BootLoader has not honored the reset\n")); + DEBUG ((DEBUG_ERROR, "!!!ERROR: Please add support in BootLoader to honour the reset request from FSP\n")); + } while (LoopUntilReset); +}