]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
Update KbcResetDxe to be more generic by layering it on top of the ResetSystemLib...
[mirror_edk2.git] / PcAtChipsetPkg / KbcResetDxe / ResetEntry.c
index d43a516c87cb125904941e04c3aac93dbfdf8cbd..0457fe63b541b05dff37c2f24259be78e9da2af2 100644 (file)
@@ -11,13 +11,56 @@ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
 **/\r
 \r
-#include "Reset.h"\r
+#include <PiDxe.h>\r
+\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/ResetSystemLib.h>\r
+\r
+#include <Protocol/Reset.h>\r
 \r
 //\r
 // The handle onto which the Reset Architectural Protocol is installed\r
 //\r
 EFI_HANDLE  mResetHandle = NULL;\r
 \r
+/**\r
+  Reset the system.\r
+\r
+  @param ResetType       warm or cold\r
+  @param ResetStatus     possible cause of reset\r
+  @param DataSize        Size of ResetData in bytes\r
+  @param ResetData       Optional Unicode string\r
+\r
+**/\r
+VOID\r
+EFIAPI\r
+KbcResetSystem (\r
+  IN EFI_RESET_TYPE   ResetType,\r
+  IN EFI_STATUS       ResetStatus,\r
+  IN UINTN            DataSize,\r
+  IN VOID             *ResetData OPTIONAL\r
+  )\r
+{\r
+  switch (ResetType) {\r
+  case EfiResetWarm:\r
+    ResetWarm ();\r
+    break;\r
+  case EfiResetCold:\r
+    ResetCold ();\r
+    break;\r
+  case EfiResetShutdown:\r
+    ResetShutdown ();\r
+    break;\r
+  default:\r
+    return;\r
+  }\r
+\r
+  //\r
+  // Given we should have reset getting here would be bad\r
+  //\r
+  ASSERT (FALSE);\r
+}\r
 \r
 /**\r
   Initialize the state information for the Reset Architectural Protocol\r
@@ -54,8 +97,7 @@ InitializeReset (
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &mResetHandle,\r
-                  &gEfiResetArchProtocolGuid,\r
-                  NULL,\r
+                  &gEfiResetArchProtocolGuid, NULL,\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r