Implement BlEfiGetSystemConfigurationTable() and move BlEfiGetSecureBootStatus() to desired place

This commit is contained in:
2022-10-17 15:47:09 +02:00
parent ade2d189ae
commit 71e8bb76de
3 changed files with 76 additions and 32 deletions

View File

@@ -162,38 +162,6 @@ BlDbgPrint(IN PUINT16 Format,
}
}
/**
* This routine checks whether SecureBoot is enabled or not.
*
* @return Numeric representation of SecureBoot status (0 = Disabled, >0 = Enabled, <0 SetupMode).
*
* @since XT 1.0
*/
INT_PTR
BlEfiGetSecureBootStatus()
{
EFI_GUID VarGuid = EFI_GLOBAL_VARIABLE_GUID;
INT_PTR SecureBootStatus = 0;
UCHAR VarValue = 0;
UINT_PTR Size;
Size = sizeof(VarValue);
if(EfiSystemTable->RuntimeServices->GetVariable(L"SecureBoot", &VarGuid,
NULL, &Size, &VarValue) == STATUS_EFI_SUCCESS)
{
SecureBootStatus = (INT_PTR)VarValue;
if((EfiSystemTable->RuntimeServices->GetVariable(L"SetupMode", &VarGuid,
NULL, &Size, &VarValue) == STATUS_EFI_SUCCESS) && VarValue != 0)
{
SecureBootStatus = -1;
}
}
/* Return SecureBoot status */
return SecureBootStatus;
}
/**
* This routine allocates a pool memory.
*