EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

EdkCompatibilityPkg/Compatibility/BootScriptThunkHelper/BootScriptThunkHelper.c

Go to the documentation of this file.
00001 
00019 #include <PiDxe.h>
00020 #include <Library/BaseLib.h>
00021 #include <Library/PcdLib.h>
00022 #include <Library/DebugLib.h>
00023 #include <Library/LockBoxLib.h>
00024 
00025 #include <Guid/BootScriptThunkData.h>
00026 
00027 EFI_GUID mBootScriptThunkGuid = {
00028   0xa053f561, 0xf56b, 0x4140, {0x89, 0x1, 0xb4, 0xcb, 0x5d, 0x70, 0x92, 0x9e}
00029 };
00030 
00040 EFI_STATUS
00041 EFIAPI
00042 BootScriptThunkHelperMain (
00043   IN EFI_HANDLE        ImageHandle,
00044   IN EFI_SYSTEM_TABLE  *SystemTable
00045   )
00046 {
00047   BOOT_SCRIPT_THUNK_DATA        *BootScriptThunkData;
00048   EFI_STATUS                    Status;
00049 
00050   //
00051   // Get BootScriptThunk variable
00052   //
00053   BootScriptThunkData = (BOOT_SCRIPT_THUNK_DATA *)(UINTN)PcdGet64(BootScriptThunkDataPtr);
00054   ASSERT (BootScriptThunkData != NULL);
00055   if (BootScriptThunkData == NULL) {
00056     return EFI_NOT_FOUND;
00057   }
00058 
00059   //
00060   // Save BootScriptThunk image
00061   //
00062   Status = SaveLockBox (
00063              &mBootScriptThunkGuid,
00064              (VOID *)(UINTN)BootScriptThunkData->BootScriptThunkBase,
00065              (UINTN)BootScriptThunkData->BootScriptThunkLength
00066              );
00067   ASSERT_EFI_ERROR (Status);
00068 
00069   Status = SetLockBoxAttributes (&mBootScriptThunkGuid, LOCK_BOX_ATTRIBUTE_RESTORE_IN_PLACE);
00070   ASSERT_EFI_ERROR (Status);
00071 
00072   return Status;
00073 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines