]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/StatusCode/Dxe/SerialStatusCodeWorker.c
Fix EDKT497. In the patch:
[mirror_edk2.git] / EdkModulePkg / Universal / StatusCode / Dxe / SerialStatusCodeWorker.c
index a5fbf236782a93fbaa78c7d7011f244c96e40ad7..0b16dfeadb5d8b562a962a3f5cf4606ca641a8dd 100644 (file)
@@ -32,10 +32,10 @@ EfiSerialStatusCodeInitializeWorker (
   EFI_STATUS Status;\r
 \r
   Status = gBS->LocateProtocol (\r
-            &gEfiSerialIoProtocolGuid,\r
-            NULL,\r
-            (VOID **) &mSerialIoProtocol\r
-            );\r
+             &gEfiSerialIoProtocolGuid,\r
+             NULL,\r
+             (VOID **) &mSerialIoProtocol\r
+             );\r
 \r
   ASSERT_EFI_ERROR (Status);\r
 \r
@@ -46,13 +46,13 @@ EfiSerialStatusCodeInitializeWorker (
 /**\r
   Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
  \r
-  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions¡± below.\r
+  @param  CodeType      Indicates the type of status code being reported.  Type EFI_STATUS_CODE_TYPE is defined in "Related Definitions" below.\r
  \r
   @param  Value         Describes the current status of a hardware or software entity.  \r
                         This included information about the class and subclass that is used to classify the entity \r
                         as well as an operation.  For progress codes, the operation is the current activity. \r
                         For error codes, it is the exception.  For debug codes, it is not defined at this time. \r
-                        Type EFI_STATUS_CODE_VALUE is defined in ¡°Related Definitions¡± below.  \r
+                        Type EFI_STATUS_CODE_VALUE is defined in "Related Definitions" below.  \r
                         Specific values are discussed in the Intel? Platform Innovation Framework for EFI Status Code Specification.\r
  \r
   @param  Instance      The enumeration of a hardware or software entity within the system.  \r
@@ -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