38 ExitInfo.Uint64 = Ghcb->SaveArea.SwExitInfo1;
40 (ExitInfo.Elements.Lower32Bits == 0) ||
41 (ExitInfo.Elements.Lower32Bits == 1)
45 if (ExitInfo.Elements.Lower32Bits == 0) {
49 if (ExitInfo.Elements.Lower32Bits == 1) {
50 ASSERT (Ghcb->SaveArea.SwExitInfo2 != 0);
55 Event.Uint64 = Ghcb->SaveArea.SwExitInfo2;
56 if (Event.Elements.Valid &&
57 (Event.Elements.Type == GHCB_EVENT_INJECTION_TYPE_EXCEPTION))
59 switch (Event.Elements.Vector) {
65 Status = Event.Uint64;
74 GpEvent.Elements.Vector = GP_EXCEPTION;
75 GpEvent.Elements.Type = GHCB_EVENT_INJECTION_TYPE_EXCEPTION;
76 GpEvent.Elements.Valid = 1;
78 Status = GpEvent.Uint64;
112 Ghcb->SaveArea.SwExitCode = ExitCode;
113 Ghcb->SaveArea.SwExitInfo1 = ExitInfo1;
114 Ghcb->SaveArea.SwExitInfo2 = ExitInfo2;
147 IN OUT BOOLEAN *InterruptState
155 if (*InterruptState) {
159 SetMem (&Ghcb->SaveArea, sizeof (Ghcb->SaveArea), 0);
177 IN BOOLEAN InterruptState
180 if (InterruptState) {
199 IN GHCB_REGISTER Offset
205 OffsetIndex = Offset / 8;
206 OffsetBit = Offset % 8;
208 Ghcb->SaveArea.ValidBitmap[OffsetIndex] |= (1 << OffsetBit);
228 IN GHCB_REGISTER Offset
234 OffsetIndex = Offset / 8;
235 OffsetBit = Offset % 8;
237 return ((Ghcb->SaveArea.ValidBitmap[OffsetIndex] & (1 << OffsetBit)) != 0);
BOOLEAN EFIAPI GetInterruptState(VOID)
VOID EFIAPI MemoryFence(VOID)
VOID EFIAPI EnableInterrupts(VOID)
VOID EFIAPI DisableInterrupts(VOID)
VOID *EFIAPI SetMem(OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
#define ASSERT(Expression)
VOID EFIAPI VmgSetOffsetValid(IN OUT GHCB *Ghcb, IN GHCB_REGISTER Offset)
BOOLEAN EFIAPI VmgIsOffsetValid(IN GHCB *Ghcb, IN GHCB_REGISTER Offset)
UINT64 EFIAPI VmgExit(IN OUT GHCB *Ghcb, IN UINT64 ExitCode, IN UINT64 ExitInfo1, IN UINT64 ExitInfo2)
VOID EFIAPI VmgInit(IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState)
STATIC UINT64 VmgExitErrorCheck(IN GHCB *Ghcb)
VOID EFIAPI VmgDone(IN OUT GHCB *Ghcb, IN BOOLEAN InterruptState)