diff mbox

[7/9] ArmPlatformPkg/Bds: Add Reboot and Shutdown options to main menu

Message ID 1371801922-15142-8-git-send-email-ryan.harkin@linaro.org
State New
Headers show

Commit Message

Ryan Harkin June 21, 2013, 8:05 a.m. UTC
Add Reboot and Shutdown options to the main BDS menu so that users can
control the platform remotely without having to physically reboot/shutdown
the board.

Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
---
 ArmPlatformPkg/Bds/BootMenu.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
diff mbox

Patch

diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c
index 4094d41..09e1075 100644
--- a/ArmPlatformPkg/Bds/BootMenu.c
+++ b/ArmPlatformPkg/Bds/BootMenu.c
@@ -614,12 +614,32 @@  BootShell (
   return Status;
 }
 
+EFI_STATUS
+Reboot (
+  IN LIST_ENTRY *BootOptionsList
+  )
+{
+  gRT->ResetSystem(EfiResetCold, EFI_SUCCESS, 0, NULL);
+  return EFI_UNSUPPORTED;
+}
+
+EFI_STATUS
+Shutdown (
+  IN LIST_ENTRY *BootOptionsList
+  )
+{
+  gRT->ResetSystem(EfiResetShutdown, EFI_SUCCESS, 0, NULL);
+  return EFI_UNSUPPORTED;
+}
+
 struct BOOT_MAIN_ENTRY {
   CONST CHAR16* Description;
   EFI_STATUS (*Callback) (IN LIST_ENTRY *BootOptionsList);
 } BootMainEntries[] = {
     { L"Boot Manager", BootMenuManager },
     { L"Shell", BootShell },
+    { L"Reboot", Reboot },
+    { L"Shutdown", Shutdown },
 };