38 return (CcWorkAreaHeader !=
NULL && CcWorkAreaHeader->GuestType != CcGuestTypeNonEncrypted);
72 IoWrite16 (FW_CFG_IO_SELECTOR, (UINT16)QemuFwCfgItemSignature);
73 IoReadFifo8 (FW_CFG_IO_DATA,
sizeof Signature, &Signature);
74 IoWrite16 (FW_CFG_IO_SELECTOR, (UINT16)QemuFwCfgItemInterfaceVersion);
75 IoReadFifo8 (FW_CFG_IO_DATA,
sizeof Revision, &Revision);
79 *DmaSupported =
FALSE;
80 if ((Signature ==
SIGNATURE_32 (
'Q',
'E',
'M',
'U')) && (Revision >= 1)) {
82 if ((Revision & FW_CFG_F_DMA) && !CcGuest) {
89 "%a: Supported %d, DMA %d\n",
98QemuFwCfgGetPlatformInfo (
106 if (GuidHob ==
NULL) {
112 if (!PlatformInfoHob->QemuFwCfgChecked) {
114 &PlatformInfoHob->QemuFwCfgSupported,
115 &PlatformInfoHob->QemuFwCfgDmaSupported
117 PlatformInfoHob->QemuFwCfgChecked =
TRUE;
120 return PlatformInfoHob;
148 return PlatformInfoHob->QemuFwCfgSupported;
165 return PlatformInfoHob->QemuFwCfgDmaSupported;
186 IN OUT VOID *Buffer OPTIONAL,
191 UINT32 AccessHigh, AccessLow;
195 Control == FW_CFG_DMA_CTL_WRITE || Control == FW_CFG_DMA_CTL_READ ||
196 Control == FW_CFG_DMA_CTL_SKIP
223 AccessLow = (UINT32)(
UINTN)&Access;
237 ASSERT ((Status & FW_CFG_DMA_CTL_ERROR) == 0);
238 }
while (Status != 0);
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID EFIAPI MemoryFence(VOID)
UINT32 EFIAPI SwapBytes32(IN UINT32 Value)
UINT64 EFIAPI RShiftU64(IN UINT64 Operand, IN UINTN Count)
UINT64 EFIAPI SwapBytes64(IN UINT64 Value)
VOID EFIAPI IoReadFifo8(IN UINTN Port, IN UINTN Count, OUT VOID *Buffer)
UINT32 EFIAPI IoWrite32(IN UINTN Port, IN UINT32 Value)
UINT16 EFIAPI IoWrite16(IN UINTN Port, IN UINT16 Value)
#define SIGNATURE_32(A, B, C, D)
#define DEBUG(Expression)
#define FixedPcdGet32(TokenName)
STATIC BOOLEAN QemuFwCfgIsCcGuest(VOID)
BOOLEAN InternalQemuFwCfgIsAvailable(VOID)
VOID InternalQemuFwCfgDmaBytes(IN UINT32 Size, IN OUT VOID *Buffer OPTIONAL, IN UINT32 Control)
BOOLEAN InternalQemuFwCfgDmaIsAvailable(VOID)
BOOLEAN EFIAPI QemuFwCfgIsAvailable(VOID)