summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/Bds/BootMenu.c
diff options
context:
space:
mode:
authorRonald Cron <ronald.cron@arm.com>2014-07-04 14:46:21 +0000
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>2014-07-04 14:46:21 +0000
commit42de09370fddac6446e071d1b613f477b20fc6bc (patch)
treea079cc91aed9fd66ad401aca7e115298da4f2462 /ArmPlatformPkg/Bds/BootMenu.c
parent1b0ac0dedf19041512de152f047cc5a943598521 (diff)
downloadedk2-platforms-42de09370fddac6446e071d1b613f477b20fc6bc.tar.xz
ArmPlatformPkg/Bds: Added boot timeout setting
Added boot timeout setting in UEFI boot manager menu Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ronald Cron <ronald.cron@arm.com> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15629 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPlatformPkg/Bds/BootMenu.c')
-rw-r--r--ArmPlatformPkg/Bds/BootMenu.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/ArmPlatformPkg/Bds/BootMenu.c b/ArmPlatformPkg/Bds/BootMenu.c
index 62e7927def..39013cf802 100644
--- a/ArmPlatformPkg/Bds/BootMenu.c
+++ b/ArmPlatformPkg/Bds/BootMenu.c
@@ -648,6 +648,54 @@ EXIT:
return Status;
}
+/**
+ Set boot timeout
+
+ Ask for the boot timeout in seconds and if the input succeeds assign the
+ input value to the UEFI global variable "Timeout". This function is called
+ when the user selects the "Set Boot Timeout" of the boot manager menu.
+
+ @param[in] BootOptionsList List of the boot devices, not used here
+
+ @retval EFI_SUCCESS Boot timeout in second retrieved from the standard
+ input and assigned to the UEFI "Timeout" global
+ variable
+ @retval !EFI_SUCCESS Either the input or the setting of the UEFI global
+ variable "Timeout" has failed.
+**/
+EFI_STATUS
+STATIC
+BootMenuSetBootTimeout (
+ IN LIST_ENTRY *BootOptionsList
+ )
+{
+ EFI_STATUS Status;
+ UINTN Input;
+ UINT16 Timeout;
+
+ Print (L"Timeout duration (in seconds): ");
+ Status = GetHIInputInteger (&Input);
+ if (EFI_ERROR (Status)) {
+ Print (L"\n");
+ goto ErrorExit;
+ }
+
+ Timeout = Input;
+ Status = gRT->SetVariable (
+ (CHAR16*)L"Timeout",
+ &gEfiGlobalVariableGuid,
+ EFI_VARIABLE_NON_VOLATILE |
+ EFI_VARIABLE_BOOTSERVICE_ACCESS |
+ EFI_VARIABLE_RUNTIME_ACCESS,
+ sizeof (UINT16),
+ &Timeout
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ErrorExit:
+ return Status;
+}
+
struct BOOT_MANAGER_ENTRY {
CONST CHAR16* Description;
EFI_STATUS (*Callback) (IN LIST_ENTRY *BootOptionsList);
@@ -656,6 +704,7 @@ struct BOOT_MANAGER_ENTRY {
{ L"Update Boot Device Entry", BootMenuUpdateBootOption },
{ L"Remove Boot Device Entry", BootMenuRemoveBootOption },
{ L"Update FDT path", UpdateFdtPath },
+ { L"Set Boot Timeout", BootMenuSetBootTimeout },
};
EFI_STATUS