]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
The hotkey callback in BDS module should defer loading the boot option until the...
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Hotkey.h
CommitLineData
5c08e117 1/** @file\r
2 Provides a way for 3rd party applications to register themselves for launch by the\r
3 Boot Manager based on hot key\r
4\r
d394581d 5Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
180a5a35 6This program and the accompanying materials\r
5c08e117 7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef _HOTKEY_H_\r
17#define _HOTKEY_H_\r
18\r
19#include "Bds.h"\r
20#include "String.h"\r
21\r
a9e7937a 22#define GET_BOOT_OPTION_SUPPORT_KEY_COUNT(a) (((a) & EFI_BOOT_OPTION_SUPPORT_COUNT) >> 8)\r
23#define SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \\r
24 (a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << 8) & EFI_BOOT_OPTION_SUPPORT_COUNT); \\r
25 }\r
5c08e117 26\r
27#define BDS_HOTKEY_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'K', 'O')\r
a9e7937a 28\r
29\r
5c08e117 30typedef struct {\r
31 UINTN Signature;\r
32 LIST_ENTRY Link;\r
33\r
34 EFI_HANDLE NotifyHandle;\r
35 UINT16 BootOptionNumber;\r
36 UINT8 CodeCount;\r
37 UINT8 WaitingKey;\r
38 EFI_KEY_DATA KeyData[3];\r
39} BDS_HOTKEY_OPTION;\r
40\r
41#define BDS_HOTKEY_OPTION_FROM_LINK(a) CR (a, BDS_HOTKEY_OPTION, Link, BDS_HOTKEY_OPTION_SIGNATURE)\r
42\r
43#define VAR_KEY_ORDER L"KeyOrder"\r
44\r
45/**\r
46\r
47 Create Key#### for the given hotkey.\r
48\r
49\r
50 @param KeyOption - The Hot Key Option to be added.\r
51 @param KeyOptionNumber - The key option number for Key#### (optional).\r
52\r
53 @retval EFI_SUCCESS Register hotkey successfully.\r
54 @retval EFI_INVALID_PARAMETER The hotkey option is invalid.\r
55\r
56**/\r
57EFI_STATUS\r
58RegisterHotkey (\r
59 IN EFI_KEY_OPTION *KeyOption,\r
60 OUT UINT16 *KeyOptionNumber\r
61 );\r
62\r
63/**\r
64\r
65 Delete Key#### for the given Key Option number.\r
66\r
67\r
68 @param KeyOptionNumber - Key option number for Key####\r
69\r
70 @retval EFI_SUCCESS Unregister hotkey successfully.\r
71 @retval EFI_NOT_FOUND No Key#### is found for the given Key Option number.\r
72\r
73**/\r
74EFI_STATUS\r
75UnregisterHotkey (\r
76 IN UINT16 KeyOptionNumber\r
77 );\r
78\r
79\r
80/**\r
81\r
82 Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.\r
83\r
84\r
85 @param VOID\r
86\r
87 @retval EFI_SUCCESS Hotkey services successfully initialized.\r
88\r
89**/\r
90EFI_STATUS\r
91InitializeHotkeyService (\r
92 VOID\r
93 );\r
94\r
d394581d
RN
95/**\r
96 Try to boot the boot option triggered by hotkey.\r
97**/\r
98VOID\r
99HotkeyBoot (\r
100 VOID\r
101 );\r
102\r
5c08e117 103#endif\r