Fix EDKT497. In the patch:
[mirror_edk2.git] / EdkModulePkg / Universal / StatusCode / Dxe / SerialStatusCodeWorker.c
index d491283..0b16dfe 100644 (file)
@@ -90,10 +90,19 @@ SerialStatusCodeReportWorker (
   UINTN           CharCount;\r
   VA_LIST         Marker;\r
   EFI_DEBUG_INFO  *DebugInfo;\r
+  EFI_TPL         CurrentTpl;\r
 \r
 \r
-  if (FeaturePcdGet (PcdStatusCodeUseEfiSerial) && EfiAtRuntime ()) {\r
-    return EFI_DEVICE_ERROR;\r
+  if (FeaturePcdGet (PcdStatusCodeUseEfiSerial)) {\r
+    if (EfiAtRuntime ()) {\r
+      return EFI_DEVICE_ERROR;\r
+    }\r
+    CurrentTpl = gBS->RaiseTPL (EFI_TPL_HIGH_LEVEL);\r
+    gBS->RestoreTPL (CurrentTpl);\r
+\r
+    if (CurrentTpl > EFI_TPL_CALLBACK ) {\r
+      return EFI_DEVICE_ERROR;\r
+    }\r
   }\r
 \r
   Buffer[0] = '\0';\r