]> git.proxmox.com Git - mirror_edk2.git/blobdiff - DuetPkg/KbcResetDxe/Ia32/Ia32Reset.c
Porting Duet module from EDKI to EDKII
[mirror_edk2.git] / DuetPkg / KbcResetDxe / Ia32 / Ia32Reset.c
diff --git a/DuetPkg/KbcResetDxe/Ia32/Ia32Reset.c b/DuetPkg/KbcResetDxe/Ia32/Ia32Reset.c
new file mode 100644 (file)
index 0000000..00c5223
--- /dev/null
@@ -0,0 +1,79 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. 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
+Module Name:\r
+  Ia32Reset.c\r
+\r
+Abstract:\r
+\r
+--*/\r
+\r
+#include "Reset.h"\r
+\r
+//\r
+// The handle onto which the Reset Architectural Protocol is installed\r
+//\r
+EFI_HANDLE  mResetHandle = NULL;\r
+\r
+\r
+EFI_STATUS\r
+EFIAPI\r
+InitializeReset (\r
+  IN EFI_HANDLE        ImageHandle,\r
+  IN EFI_SYSTEM_TABLE  *SystemTable\r
+  )\r
+/*++\r
+\r
+Routine Description:\r
+\r
+  Initialize the state information for the Reset Architectural Protocol\r
+\r
+Arguments:\r
+\r
+  ImageHandle of the loaded driver\r
+  Pointer to the System Table\r
+\r
+Returns:\r
+\r
+  Status\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
+\r
+--*/\r
+// TODO:    SystemTable - add argument and description to function comment\r
+{\r
+  EFI_STATUS  Status;\r
+\r
+  //\r
+  // Make sure the Reset Architectural Protocol is not already installed in the system\r
+  //\r
+  ASSERT_PROTOCOL_ALREADY_INSTALLED (NULL, &gEfiResetArchProtocolGuid);\r
+\r
+  //\r
+  // Hook the runtime service table\r
+  //\r
+  SystemTable->RuntimeServices->ResetSystem = KbcResetSystem;\r
+\r
+  //\r
+  // Now install the Reset RT AP on a new handle\r
+  //\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &mResetHandle,\r
+                  &gEfiResetArchProtocolGuid,\r
+                  NULL,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  return Status;\r
+}\r