]> git.proxmox.com Git - mirror_edk2.git/blobdiff - PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
RefRefine soma code to make code run safely.
[mirror_edk2.git] / PcAtChipsetPkg / KbcResetDxe / ResetEntry.c
index bcef440fcf3ef083583f1d65d3e60522a9ffb7e7..03b425019d511ce7818b9d324b836472d6c7c78f 100644 (file)
@@ -1,53 +1,84 @@
-/*++\r
+/** @file\r
+  Driver entry for KbcReset driver.\r
 \r
-Copyright (c) 2009, Intel Corporation                                                         \r
-All rights reserved. This program and the accompanying materials                          \r
+Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials                          \r
 are licensed and made available under the terms and conditions of the BSD License         \r
 which accompanies this distribution.  The full text of the license may be found at        \r
 http://opensource.org/licenses/bsd-license.php                                            \r
                                                                                           \r
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+**/\r
 \r
+#include <PiDxe.h>\r
 \r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/ResetSystemLib.h>\r
 \r
---*/\r
-\r
-#include "Reset.h"\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
-EFI_STATUS\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
-InitializeReset (\r
-  IN EFI_HANDLE        ImageHandle,\r
-  IN EFI_SYSTEM_TABLE  *SystemTable\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
-\r
-Routine Description:\r
-\r
-  Initialize the state information for the Reset Architectural Protocol\r
-\r
-Arguments:\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
-  ImageHandle of the loaded driver\r
-  Pointer to the System Table\r
+  //\r
+  // Given we should have reset getting here would be bad\r
+  //\r
+  ASSERT (FALSE);\r
+}\r
 \r
-Returns:\r
+/**\r
+  Initialize the state information for the Reset Architectural Protocol.\r
 \r
-  Status\r
+  @param ImageHandle     Handle of the loaded driver \r
+  @param SystemTable     Pointer to the System Table\r
 \r
-  EFI_SUCCESS           - thread can be successfully created\r
-  EFI_OUT_OF_RESOURCES  - cannot allocate protocol data structure\r
-  EFI_DEVICE_ERROR      - cannot create the timer service\r
+  @retval EFI_SUCCESS           Thread can be successfully created\r
+  @retval EFI_OUT_OF_RESOURCES  Cannot allocate protocol data structure\r
+  @retval EFI_DEVICE_ERROR      Cannot create the timer service\r
 \r
---*/\r
-// TODO:    SystemTable - add argument and description to function comment\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeReset (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -66,8 +97,7 @@ Returns:
   //\r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &mResetHandle,\r
-                  &gEfiResetArchProtocolGuid,\r
-                  NULL,\r
+                  &gEfiResetArchProtocolGuid, NULL,\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r