39 ExitInfo.Uint64 = Ghcb->SaveArea.SwExitInfo1;
41 (ExitInfo.Elements.Lower32Bits == 0) ||
42 (ExitInfo.Elements.Lower32Bits == 1)
46 if (ExitInfo.Elements.Lower32Bits == 0) {
50 if (ExitInfo.Elements.Lower32Bits == 1) {
51 ASSERT (Ghcb->SaveArea.SwExitInfo2 != 0);
56 Event.Uint64 = Ghcb->SaveArea.SwExitInfo2;
57 if (Event.Elements.Valid &&
58 (Event.Elements.Type == GHCB_EVENT_INJECTION_TYPE_EXCEPTION))
60 switch (Event.Elements.Vector) {
66 Status = Event.Uint64;
75 GpEvent.Elements.Vector = GP_EXCEPTION;
76 GpEvent.Elements.Type = GHCB_EVENT_INJECTION_TYPE_EXCEPTION;
77 GpEvent.Elements.Valid = 1;
79 Status = GpEvent.Uint64;
113 Ghcb->SaveArea.SwExitCode = ExitCode;
114 Ghcb->SaveArea.SwExitInfo1 = ExitInfo1;
115 Ghcb->SaveArea.SwExitInfo2 = ExitInfo2;
148 IN OUT BOOLEAN *InterruptState
156 if (*InterruptState) {
160 SetMem (&Ghcb->SaveArea, sizeof (Ghcb->SaveArea), 0);
178 IN BOOLEAN InterruptState
181 if (InterruptState) {
200 IN GHCB_REGISTER Offset
206 OffsetIndex = Offset / 8;
207 OffsetBit = Offset % 8;
209 Ghcb->SaveArea.ValidBitmap[OffsetIndex] |= (1 << OffsetBit);
229 IN GHCB_REGISTER Offset
235 OffsetIndex = Offset / 8;
236 OffsetBit = Offset % 8;
238 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)
UINT64 EFIAPI CcExitVmgExit(IN OUT GHCB *Ghcb, IN UINT64 ExitCode, IN UINT64 ExitInfo1, IN UINT64 ExitInfo2)
BOOLEAN EFIAPI CcExitVmgIsOffsetValid(IN GHCB *Ghcb, IN GHCB_REGISTER Offset)
VOID EFIAPI CcExitVmgSetOffsetValid(IN OUT GHCB *Ghcb, IN GHCB_REGISTER Offset)
VOID EFIAPI CcExitVmgInit(IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState)
VOID EFIAPI CcExitVmgDone(IN OUT GHCB *Ghcb, IN BOOLEAN InterruptState)
STATIC UINT64 VmgExitErrorCheck(IN GHCB *Ghcb)