IN EXCEPTION_HANDLER_DATA *ExceptionHandlerData\r
)\r
{\r
+ EFI_STATUS Status;\r
EXCEPTION_HANDLER_CONTEXT *ExceptionHandlerContext;\r
RESERVED_VECTORS_DATA *ReservedVectors;\r
EFI_CPU_INTERRUPT_HANDLER *ExternalInterruptHandler;\r
\r
- if (ExceptionType == VC_EXCEPTION) {\r
- EFI_STATUS Status;\r
- //\r
- // #VC needs to be handled immediately upon enabling exception handling\r
- // and therefore can't use the RegisterCpuInterruptHandler() interface.\r
- //\r
- // Handle the #VC:\r
- // On EFI_SUCCESS - Exception has been handled, return\r
- // On other - ExceptionType contains (possibly new) exception\r
- // value\r
- //\r
- Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
- if (!EFI_ERROR (Status)) {\r
- return;\r
- }\r
+ switch (ExceptionType) {\r
+ case VC_EXCEPTION:\r
+ //\r
+ // #VC needs to be handled immediately upon enabling exception handling\r
+ // and therefore can't use the RegisterCpuInterruptHandler() interface.\r
+ //\r
+ // Handle the #VC:\r
+ // On EFI_SUCCESS - Exception has been handled, return\r
+ // On other - ExceptionType contains (possibly new) exception\r
+ // value\r
+ //\r
+ Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
+ if (!EFI_ERROR (Status)) {\r
+ return;\r
+ }\r
+\r
+ break;\r
+\r
+ case VE_EXCEPTION:\r
+ //\r
+ // #VE needs to be handled immediately upon enabling exception handling\r
+ // and therefore can't use the RegisterCpuInterruptHandler() interface.\r
+ //\r
+ // Handle the #VE:\r
+ // On EFI_SUCCESS - Exception has been handled, return\r
+ // On other - ExceptionType contains (possibly new) exception\r
+ // value\r
+ //\r
+ Status = VmTdExitHandleVe (&ExceptionType, SystemContext);\r
+ if (!EFI_ERROR (Status)) {\r
+ return;\r
+ }\r
+\r
+ break;\r
+\r
+ default:\r
+ break;\r
}\r
\r
ExceptionHandlerContext = (EXCEPTION_HANDLER_CONTEXT *)(UINTN)(SystemContext.SystemContextIa32);\r
IN EFI_SYSTEM_CONTEXT SystemContext\r
)\r
{\r
- if (ExceptionType == VC_EXCEPTION) {\r
- EFI_STATUS Status;\r
- //\r
- // #VC needs to be handled immediately upon enabling exception handling\r
- // and therefore can't use the RegisterCpuInterruptHandler() interface\r
- // (which isn't supported under Sec and Pei anyway).\r
- //\r
- // Handle the #VC:\r
- // On EFI_SUCCESS - Exception has been handled, return\r
- // On other - ExceptionType contains (possibly new) exception\r
- // value\r
- //\r
- Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
- if (!EFI_ERROR (Status)) {\r
- return;\r
- }\r
+ EFI_STATUS Status;\r
+\r
+ switch (ExceptionType) {\r
+ case VC_EXCEPTION:\r
+ //\r
+ // #VC needs to be handled immediately upon enabling exception handling\r
+ // and therefore can't use the RegisterCpuInterruptHandler() interface\r
+ // (which isn't supported under Sec and Pei anyway).\r
+ //\r
+ // Handle the #VC:\r
+ // On EFI_SUCCESS - Exception has been handled, return\r
+ // On other - ExceptionType contains (possibly new) exception\r
+ // value\r
+ //\r
+ Status = VmgExitHandleVc (&ExceptionType, SystemContext);\r
+ if (!EFI_ERROR (Status)) {\r
+ return;\r
+ }\r
+\r
+ break;\r
+\r
+ case VE_EXCEPTION:\r
+ //\r
+ // #VE needs to be handled immediately upon enabling exception handling\r
+ // and therefore can't use the RegisterCpuInterruptHandler() interface\r
+ // (which isn't supported under Sec and Pei anyway).\r
+ //\r
+ // Handle the #VE:\r
+ // On EFI_SUCCESS - Exception has been handled, return\r
+ // On other - ExceptionType contains (possibly new) exception\r
+ // value\r
+ //\r
+ Status = VmTdExitHandleVe (&ExceptionType, SystemContext);\r
+ if (!EFI_ERROR (Status)) {\r
+ return;\r
+ }\r
+\r
+ break;\r
+\r
+ default:\r
+ break;\r
}\r
\r
//\r