summaryrefslogtreecommitdiff
path: root/PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
diff options
context:
space:
mode:
authormdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-03 05:16:57 +0000
committermdkinney <mdkinney@6f19259b-4bc3-4df7-8a09-765794883524>2010-08-03 05:16:57 +0000
commitbb77cee7d1222e3e48bcc1dae28915485c73af0d (patch)
tree7b90602271f894a90ec6504b6a65a7dde5dea933 /PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
parent27833309f822f7e471486067089e5582e3382aa1 (diff)
downloadedk2-bb77cee7d1222e3e48bcc1dae28915485c73af0d.zip
edk2-bb77cee7d1222e3e48bcc1dae28915485c73af0d.tar.gz
edk2-bb77cee7d1222e3e48bcc1dae28915485c73af0d.tar.bz2
Update KbcResetDxe to be more generic by layering it on top of the ResetSystemLib class.
Reduce number of source files from 3 to 1. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10768 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'PcAtChipsetPkg/KbcResetDxe/ResetEntry.c')
-rw-r--r--PcAtChipsetPkg/KbcResetDxe/ResetEntry.c48
1 files changed, 45 insertions, 3 deletions
diff --git a/PcAtChipsetPkg/KbcResetDxe/ResetEntry.c b/PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
index d43a516..0457fe6 100644
--- a/PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
+++ b/PcAtChipsetPkg/KbcResetDxe/ResetEntry.c
@@ -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.
**/
-#include "Reset.h"
+#include <PiDxe.h>
+
+#include <Library/DebugLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/ResetSystemLib.h>
+
+#include <Protocol/Reset.h>
//
// The handle onto which the Reset Architectural Protocol is installed
//
EFI_HANDLE mResetHandle = NULL;
+/**
+ Reset the system.
+
+ @param ResetType warm or cold
+ @param ResetStatus possible cause of reset
+ @param DataSize Size of ResetData in bytes
+ @param ResetData Optional Unicode string
+
+**/
+VOID
+EFIAPI
+KbcResetSystem (
+ IN EFI_RESET_TYPE ResetType,
+ IN EFI_STATUS ResetStatus,
+ IN UINTN DataSize,
+ IN VOID *ResetData OPTIONAL
+ )
+{
+ switch (ResetType) {
+ case EfiResetWarm:
+ ResetWarm ();
+ break;
+ case EfiResetCold:
+ ResetCold ();
+ break;
+ case EfiResetShutdown:
+ ResetShutdown ();
+ break;
+ default:
+ return;
+ }
+
+ //
+ // Given we should have reset getting here would be bad
+ //
+ ASSERT (FALSE);
+}
/**
Initialize the state information for the Reset Architectural Protocol
@@ -54,8 +97,7 @@ InitializeReset (
//
Status = gBS->InstallMultipleProtocolInterfaces (
&mResetHandle,
- &gEfiResetArchProtocolGuid,
- NULL,
+ &gEfiResetArchProtocolGuid, NULL,
NULL
);
ASSERT_EFI_ERROR (Status);