]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
d73a1cbeeb1136f5d684fe67db8aab98bff52f52
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Hotkey.h
1 /** @file
2 Provides a way for 3rd party applications to register themselves for launch by the
3 Boot Manager based on hot key
4
5 Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef _HOTKEY_H_
11 #define _HOTKEY_H_
12
13 #include "Bds.h"
14 #include "String.h"
15
16 #define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \
17 (a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)) & EFI_BOOT_OPTION_SUPPORT_COUNT); \
18 }
19
20 #define BDS_HOTKEY_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'K', 'O')
21
22
23 typedef struct {
24 UINTN Signature;
25 LIST_ENTRY Link;
26
27 VOID *NotifyHandle;
28 UINT16 BootOptionNumber;
29 UINT8 CodeCount;
30 UINT8 WaitingKey;
31 EFI_KEY_DATA KeyData[3];
32 } BDS_HOTKEY_OPTION;
33
34 #define BDS_HOTKEY_OPTION_FROM_LINK(a) CR (a, BDS_HOTKEY_OPTION, Link, BDS_HOTKEY_OPTION_SIGNATURE)
35
36 /**
37
38 Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.
39
40
41 @param VOID
42
43 @retval EFI_SUCCESS Hotkey services successfully initialized.
44
45 **/
46 EFI_STATUS
47 InitializeHotkeyService (
48 VOID
49 );
50
51 /**
52 Try to boot the boot option triggered by hotkey.
53 @retval EFI_SUCCESS There is HotkeyBootOption & it is processed
54 @retval EFI_NOT_FOUND There is no HotkeyBootOption
55 **/
56 EFI_STATUS
57 HotkeyBoot (
58 VOID
59 );
60
61 #endif