]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystem.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / ResetSystemRuntimeDxe / ResetSystem.c
index 77aedcba6e04ad04b0427a2cb8e1c9fa29b8881e..42f1b1d0158f08e3a7563ada7d53d40b945c27c5 100644 (file)
@@ -9,7 +9,7 @@
 \r
 #include "ResetSystem.h"\r
 \r
-GLOBAL_REMOVE_IF_UNREFERENCED CHAR16 *mResetTypeStr[] = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED CHAR16  *mResetTypeStr[] = {\r
   L"Cold", L"Warm", L"Shutdown", L"PlatformSpecific"\r
 };\r
 \r
@@ -42,13 +42,13 @@ UINTN  mResetNotifyDepth = 0;
 EFI_STATUS\r
 EFIAPI\r
 RegisterResetNotify (\r
-  IN EFI_RESET_NOTIFICATION_PROTOCOL *This,\r
-  IN EFI_RESET_SYSTEM                ResetFunction\r
+  IN EFI_RESET_NOTIFICATION_PROTOCOL  *This,\r
+  IN EFI_RESET_SYSTEM                 ResetFunction\r
   )\r
 {\r
-  RESET_NOTIFICATION_INSTANCE        *Instance;\r
-  LIST_ENTRY                         *Link;\r
-  RESET_NOTIFY_ENTRY                 *Entry;\r
+  RESET_NOTIFICATION_INSTANCE  *Instance;\r
+  LIST_ENTRY                   *Link;\r
+  RESET_NOTIFY_ENTRY           *Entry;\r
 \r
   if (ResetFunction == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -57,9 +57,10 @@ RegisterResetNotify (
   Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This);\r
 \r
   for ( Link = GetFirstNode (&Instance->ResetNotifies)\r
-      ; !IsNull (&Instance->ResetNotifies, Link)\r
-      ; Link = GetNextNode (&Instance->ResetNotifies, Link)\r
-      ) {\r
+        ; !IsNull (&Instance->ResetNotifies, Link)\r
+        ; Link = GetNextNode (&Instance->ResetNotifies, Link)\r
+        )\r
+  {\r
     Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);\r
     if (Entry->ResetNotify == ResetFunction) {\r
       return EFI_ALREADY_STARTED;\r
@@ -71,6 +72,7 @@ RegisterResetNotify (
   if (Entry == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
+\r
   Entry->Signature   = RESET_NOTIFY_ENTRY_SIGNATURE;\r
   Entry->ResetNotify = ResetFunction;\r
   InsertTailList (&Instance->ResetNotifies, &Entry->Link);\r
@@ -95,13 +97,13 @@ RegisterResetNotify (
 EFI_STATUS\r
 EFIAPI\r
 UnregisterResetNotify (\r
-  IN EFI_RESET_NOTIFICATION_PROTOCOL *This,\r
-  IN EFI_RESET_SYSTEM                ResetFunction\r
+  IN EFI_RESET_NOTIFICATION_PROTOCOL  *This,\r
+  IN EFI_RESET_SYSTEM                 ResetFunction\r
   )\r
 {\r
-  RESET_NOTIFICATION_INSTANCE        *Instance;\r
-  LIST_ENTRY                         *Link;\r
-  RESET_NOTIFY_ENTRY                 *Entry;\r
+  RESET_NOTIFICATION_INSTANCE  *Instance;\r
+  LIST_ENTRY                   *Link;\r
+  RESET_NOTIFY_ENTRY           *Entry;\r
 \r
   if (ResetFunction == NULL) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -110,9 +112,10 @@ UnregisterResetNotify (
   Instance = RESET_NOTIFICATION_INSTANCE_FROM_THIS (This);\r
 \r
   for ( Link = GetFirstNode (&Instance->ResetNotifies)\r
-      ; !IsNull (&Instance->ResetNotifies, Link)\r
-      ; Link = GetNextNode (&Instance->ResetNotifies, Link)\r
-      ) {\r
+        ; !IsNull (&Instance->ResetNotifies, Link)\r
+        ; Link = GetNextNode (&Instance->ResetNotifies, Link)\r
+        )\r
+  {\r
     Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);\r
     if (Entry->ResetNotify == ResetFunction) {\r
       RemoveEntryList (&Entry->Link);\r
@@ -124,7 +127,7 @@ UnregisterResetNotify (
   return EFI_INVALID_PARAMETER;\r
 }\r
 \r
-RESET_NOTIFICATION_INSTANCE mResetNotification = {\r
+RESET_NOTIFICATION_INSTANCE  mResetNotification = {\r
   RESET_NOTIFICATION_INSTANCE_SIGNATURE,\r
   {\r
     RegisterResetNotify,\r
@@ -133,7 +136,7 @@ RESET_NOTIFICATION_INSTANCE mResetNotification = {
   INITIALIZE_LIST_HEAD_VARIABLE (mResetNotification.ResetNotifies)\r
 };\r
 \r
-RESET_NOTIFICATION_INSTANCE mPlatformSpecificResetFilter = {\r
+RESET_NOTIFICATION_INSTANCE  mPlatformSpecificResetFilter = {\r
   RESET_NOTIFICATION_INSTANCE_SIGNATURE,\r
   {\r
     RegisterResetNotify,\r
@@ -142,7 +145,7 @@ RESET_NOTIFICATION_INSTANCE mPlatformSpecificResetFilter = {
   INITIALIZE_LIST_HEAD_VARIABLE (mPlatformSpecificResetFilter.ResetNotifies)\r
 };\r
 \r
-RESET_NOTIFICATION_INSTANCE mPlatformSpecificResetHandler = {\r
+RESET_NOTIFICATION_INSTANCE  mPlatformSpecificResetHandler = {\r
   RESET_NOTIFICATION_INSTANCE_SIGNATURE,\r
   {\r
     RegisterResetNotify,\r
@@ -189,10 +192,14 @@ InitializeResetSystem (
   Handle = NULL;\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &Handle,\r
-                  &gEfiResetArchProtocolGuid,         NULL,\r
-                  &gEfiResetNotificationProtocolGuid, &mResetNotification.ResetNotification,\r
-                  &gEdkiiPlatformSpecificResetFilterProtocolGuid, &mPlatformSpecificResetFilter.ResetNotification,\r
-                  &gEdkiiPlatformSpecificResetHandlerProtocolGuid, &mPlatformSpecificResetHandler.ResetNotification,\r
+                  &gEfiResetArchProtocolGuid,\r
+                  NULL,\r
+                  &gEfiResetNotificationProtocolGuid,\r
+                  &mResetNotification.ResetNotification,\r
+                  &gEdkiiPlatformSpecificResetFilterProtocolGuid,\r
+                  &mPlatformSpecificResetFilter.ResetNotification,\r
+                  &gEdkiiPlatformSpecificResetHandlerProtocolGuid,\r
+                  &mPlatformSpecificResetHandler.ResetNotification,\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
@@ -218,10 +225,10 @@ InitializeResetSystem (
 VOID\r
 EFIAPI\r
 RuntimeServiceResetSystem (\r
-  IN EFI_RESET_TYPE   ResetType,\r
-  IN EFI_STATUS       ResetStatus,\r
-  IN UINTN            DataSize,\r
-  IN VOID             *ResetData OPTIONAL\r
+  IN EFI_RESET_TYPE  ResetType,\r
+  IN EFI_STATUS      ResetStatus,\r
+  IN UINTN           DataSize,\r
+  IN VOID            *ResetData OPTIONAL\r
   )\r
 {\r
   LIST_ENTRY          *Link;\r
@@ -239,8 +246,10 @@ RuntimeServiceResetSystem (
 \r
   mResetNotifyDepth++;\r
   DEBUG ((\r
-    DEBUG_INFO, "DXE ResetSystem2: ResetType %s, Call Depth = %d.\n",\r
-    mResetTypeStr[ResetType], mResetNotifyDepth\r
+    DEBUG_INFO,\r
+    "DXE ResetSystem2: ResetType %s, Call Depth = %d.\n",\r
+    mResetTypeStr[ResetType],\r
+    mResetNotifyDepth\r
     ));\r
 \r
   if (mResetNotifyDepth <= MAX_RESET_NOTIFY_DEPTH) {\r
@@ -250,31 +259,36 @@ RuntimeServiceResetSystem (
       // EDKII_PLATFORM_SPECIFIC_RESET_FILTER_PROTOCOL.\r
       //\r
       for ( Link = GetFirstNode (&mPlatformSpecificResetFilter.ResetNotifies)\r
-          ; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link)\r
-          ; Link = GetNextNode (&mPlatformSpecificResetFilter.ResetNotifies, Link)\r
-          ) {\r
+            ; !IsNull (&mPlatformSpecificResetFilter.ResetNotifies, Link)\r
+            ; Link = GetNextNode (&mPlatformSpecificResetFilter.ResetNotifies, Link)\r
+            )\r
+      {\r
         Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);\r
         Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);\r
       }\r
+\r
       //\r
       // Call reset notification functions registered through the\r
       // EFI_RESET_NOTIFICATION_PROTOCOL.\r
       //\r
       for ( Link = GetFirstNode (&mResetNotification.ResetNotifies)\r
-          ; !IsNull (&mResetNotification.ResetNotifies, Link)\r
-          ; Link = GetNextNode (&mResetNotification.ResetNotifies, Link)\r
-          ) {\r
+            ; !IsNull (&mResetNotification.ResetNotifies, Link)\r
+            ; Link = GetNextNode (&mResetNotification.ResetNotifies, Link)\r
+            )\r
+      {\r
         Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);\r
         Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);\r
       }\r
+\r
       //\r
       // call reset notification functions registered through the\r
       // EDKII_PLATFORM_SPECIFIC_RESET_HANDLER_PROTOCOL.\r
       //\r
       for ( Link = GetFirstNode (&mPlatformSpecificResetHandler.ResetNotifies)\r
-          ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link)\r
-          ; Link = GetNextNode (&mPlatformSpecificResetHandler.ResetNotifies, Link)\r
-          ) {\r
+            ; !IsNull (&mPlatformSpecificResetHandler.ResetNotifies, Link)\r
+            ; Link = GetNextNode (&mPlatformSpecificResetHandler.ResetNotifies, Link)\r
+            )\r
+      {\r
         Entry = RESET_NOTIFY_ENTRY_FROM_LINK (Link);\r
         Entry->ResetNotify (ResetType, ResetStatus, DataSize, ResetData);\r
       }\r
@@ -285,25 +299,25 @@ RuntimeServiceResetSystem (
   }\r
 \r
   switch (ResetType) {\r
-  case EfiResetWarm:\r
+    case EfiResetWarm:\r
 \r
-    ResetWarm ();\r
-    break;\r
+      ResetWarm ();\r
+      break;\r
 \r
- case EfiResetCold:\r
-    ResetCold ();\r
-    break;\r
   case EfiResetCold:\r
+      ResetCold ();\r
+      break;\r
 \r
-  case EfiResetShutdown:\r
-    ResetShutdown ();\r
-    return ;\r
+    case EfiResetShutdown:\r
+      ResetShutdown ();\r
+      return;\r
 \r
-  case EfiResetPlatformSpecific:\r
-    ResetPlatformSpecific (DataSize, ResetData);\r
-    return;\r
+    case EfiResetPlatformSpecific:\r
+      ResetPlatformSpecific (DataSize, ResetData);\r
+      return;\r
 \r
-  default:\r
-    return ;\r
+    default:\r
+      return;\r
   }\r
 \r
   //\r