]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkModulePkg/Universal/StatusCode/Dxe/Ipf/DxeStatusCodeIpf.c
Follow up EDKT247-253
[mirror_edk2.git] / EdkModulePkg / Universal / StatusCode / Dxe / Ipf / DxeStatusCodeIpf.c
index 47442a97644dd17e31b9f3047bd17200dd3fbe61..3838069bb57764f3cecaa3c8ce3e165c93ef682f 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
 /** @file\r
-  Status code driver for IA32/X64/EBC architecture.\r
+* Status code driver for IPF architecture.\r
 \r
   Copyright (c) 2006, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
 \r
   Copyright (c) 2006, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
@@ -76,8 +76,8 @@ ReportEsalServiceEntry (
     // Use atom operation to avoid the reentant of report.\r
     // If current status is not zero, then the function is reentrancy.\r
     //\r
     // Use atom operation to avoid the reentant of report.\r
     // If current status is not zero, then the function is reentrancy.\r
     //\r
-    if (InterlockedCompareExchange32 (&DxeStatusCode->StatusCodeNestStatus, 0, 1)) {\r
-      ReturnVal.Status = EFI_DEVICE_ERROR ;\r
+    if (1 == InterlockedCompareExchange32 (&DxeStatusCode->StatusCodeNestStatus, 0, 1)) {\r
+      ReturnVal.Status = EFI_DEVICE_ERROR;\r
       return ReturnVal;\r
     }\r
 \r
       return ReturnVal;\r
     }\r
 \r
@@ -150,6 +150,8 @@ DxeStatusCodeDriverEntry (
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
   IN EFI_SYSTEM_TABLE  *SystemTable\r
   )\r
 {\r
+  EFI_STATUS Status;\r
+\r
   //\r
   // Dispatch initialization request to supported devices\r
   //\r
   //\r
   // Dispatch initialization request to supported devices\r
   //\r
@@ -158,13 +160,14 @@ DxeStatusCodeDriverEntry (
   //\r
   // Initialize ESAL capabilities.\r
   //\r
   //\r
   // Initialize ESAL capabilities.\r
   //\r
-  RegisterEsalClass (\r
-    &gEfiExtendedSalStatusCodeServicesProtocolGuid,\r
-    &gDxeStatusCode,\r
-    ReportEsalServiceEntry,\r
-    StatusCode,\r
-    NULL\r
-    );\r
+  Status = RegisterEsalClass (\r
+             &gEfiExtendedSalStatusCodeServicesProtocolGuid,\r
+             &gDxeStatusCode,\r
+             ReportEsalServiceEntry,\r
+             StatusCode,\r
+             NULL\r
+             );\r
+  ASSERT_EFI_ERROR (Status);\r
 \r
   return EFI_SUCCESS;\r
 }\r
 \r
   return EFI_SUCCESS;\r
 }\r