TianoCore EDK2 master
Loading...
Searching...
No Matches
QemuFwCfgS3PeiDxe.c
Go to the documentation of this file.
1
10#include <Library/BaseLib.h>
13
25BOOLEAN
26EFIAPI
28 VOID
29 )
30{
31 RETURN_STATUS Status;
32 FIRMWARE_CONFIG_ITEM FwCfgItem;
33 UINTN FwCfgSize;
34 UINT8 SystemStates[6];
35
36 if (TdIsEnabled ()) {
37 return FALSE;
38 }
39
40 Status = QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSize);
41 if ((Status != RETURN_SUCCESS) || (FwCfgSize != sizeof SystemStates)) {
42 return FALSE;
43 }
44
45 QemuFwCfgSelectItem (FwCfgItem);
46 QemuFwCfgReadBytes (sizeof SystemStates, SystemStates);
47 return (BOOLEAN)(SystemStates[3] & BIT7);
48}
UINT64 UINTN
#define RETURN_SUCCESS
Definition: Base.h:1066
#define FALSE
Definition: Base.h:307
BOOLEAN EFIAPI TdIsEnabled()
Definition: IntelTdxNull.c:79
RETURN_STATUS EFIAPI QemuFwCfgFindFile(IN CONST CHAR8 *Name, OUT FIRMWARE_CONFIG_ITEM *Item, OUT UINTN *Size)
Definition: QemuFwCfgLib.c:250
VOID EFIAPI QemuFwCfgReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
Definition: QemuFwCfgNull.c:66
VOID EFIAPI QemuFwCfgSelectItem(IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem)
Definition: QemuFwCfgLib.c:33
BOOLEAN EFIAPI QemuFwCfgS3Enabled(VOID)