IN UINT32 Control\r
)\r
{\r
- volatile FW_CFG_DMA_ACCESS Access;\r
+ volatile FW_CFG_DMA_ACCESS LocalAccess;\r
+ volatile FW_CFG_DMA_ACCESS *Access;\r
UINT32 AccessHigh, AccessLow;\r
UINT32 Status;\r
\r
return;\r
}\r
\r
- Access.Control = SwapBytes32 (Control);\r
- Access.Length = SwapBytes32 (Size);\r
- Access.Address = SwapBytes64 ((UINTN)Buffer);\r
+ Access = &LocalAccess;\r
+\r
+ Access->Control = SwapBytes32 (Control);\r
+ Access->Length = SwapBytes32 (Size);\r
+ Access->Address = SwapBytes64 ((UINTN)Buffer);\r
\r
//\r
// Delimit the transfer from (a) modifications to Access, (b) in case of a\r
//\r
// Start the transfer.\r
//\r
- AccessHigh = (UINT32)RShiftU64 ((UINTN)&Access, 32);\r
- AccessLow = (UINT32)(UINTN)&Access;\r
+ AccessHigh = (UINT32)RShiftU64 ((UINTN)Access, 32);\r
+ AccessLow = (UINT32)(UINTN)Access;\r
IoWrite32 (FW_CFG_IO_DMA_ADDRESS, SwapBytes32 (AccessHigh));\r
IoWrite32 (FW_CFG_IO_DMA_ADDRESS + 4, SwapBytes32 (AccessLow));\r
\r
// Wait for the transfer to complete.\r
//\r
do {\r
- Status = SwapBytes32 (Access.Control);\r
+ Status = SwapBytes32 (Access->Control);\r
ASSERT ((Status & FW_CFG_DMA_CTL_ERROR) == 0);\r
} while (Status != 0);\r
\r
\r
return RETURN_NOT_FOUND;\r
}\r
-\r
-\r
-/**\r
- Determine if S3 support is explicitly enabled.\r
-\r
- @retval TRUE if S3 support is explicitly enabled.\r
- FALSE otherwise. This includes unavailability of the firmware\r
- configuration interface.\r
-**/\r
-BOOLEAN\r
-EFIAPI\r
-QemuFwCfgS3Enabled (\r
- VOID\r
- )\r
-{\r
- RETURN_STATUS Status;\r
- FIRMWARE_CONFIG_ITEM FwCfgItem;\r
- UINTN FwCfgSize;\r
- UINT8 SystemStates[6];\r
-\r
- Status = QemuFwCfgFindFile ("etc/system-states", &FwCfgItem, &FwCfgSize);\r
- if (Status != RETURN_SUCCESS || FwCfgSize != sizeof SystemStates) {\r
- return FALSE;\r
- }\r
- QemuFwCfgSelectItem (FwCfgItem);\r
- QemuFwCfgReadBytes (sizeof SystemStates, SystemStates);\r
- return (BOOLEAN) (SystemStates[3] & BIT7);\r
-}\r