2 Shared code for the PEI fw_cfg and DXE fw_cfg instances of the QemuFwCfgS3Lib
5 Copyright (C) 2017, Red Hat, Inc.
7 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #include <Library/QemuFwCfgLib.h>
11 #include <Library/QemuFwCfgS3Lib.h>
14 Determine if S3 support is explicitly enabled.
16 @retval TRUE If S3 support is explicitly enabled. Other functions in this
17 library may be called (subject to their individual
20 FALSE Otherwise. This includes unavailability of the firmware
21 configuration interface. No other function in this library
31 FIRMWARE_CONFIG_ITEM FwCfgItem
;
33 UINT8 SystemStates
[6];
35 Status
= QemuFwCfgFindFile ("etc/system-states", &FwCfgItem
, &FwCfgSize
);
36 if (Status
!= RETURN_SUCCESS
|| FwCfgSize
!= sizeof SystemStates
) {
39 QemuFwCfgSelectItem (FwCfgItem
);
40 QemuFwCfgReadBytes (sizeof SystemStates
, SystemStates
);
41 return (BOOLEAN
) (SystemStates
[3] & BIT7
);