]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkModulePkg/Universal/BdsDxe/Hotkey.h
Correct a typo: Change the type of the 4th parameter of EFI_DRIVER_HEALTH_PROTOCOL...
[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
2df686c6 5Copyright (c) 2007 - 2012, 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 SET_BOOT_OPTION_SUPPORT_KEY_COUNT(a, c) { \\r
53cdd439 23 (a) = ((a) & ~EFI_BOOT_OPTION_SUPPORT_COUNT) | (((c) << LowBitSet32 (EFI_BOOT_OPTION_SUPPORT_COUNT)) & EFI_BOOT_OPTION_SUPPORT_COUNT); \\r
a9e7937a 24 }\r
5c08e117 25\r
26#define BDS_HOTKEY_OPTION_SIGNATURE SIGNATURE_32 ('B', 'd', 'K', 'O')\r
a9e7937a 27\r
53cdd439
RN
28/**\r
29 Get the revision of the EFI_KEY_OPTION structure.\r
30\r
31 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
32\r
33 @return Revision.\r
34**/\r
35#define KEY_OPTION_REVISION(KeyOption) ((KeyOption)->KeyData & EFI_KEY_OPTION_REVISION_MASK)\r
36\r
37/**\r
38 Get the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3.\r
39\r
40 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
41\r
42 @return Actual number of entries in EFI_KEY_OPTION.Keys.\r
43**/\r
44#define KEY_OPTION_INPUT_KEY_COUNT(KeyOption) (((KeyOption)->KeyData & EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK) >> LowBitSet32 (EFI_KEY_OPTION_INPUT_KEY_COUNT_MASK))\r
45\r
46/**\r
47 Return whether the Shift key needs pressed.\r
48\r
49 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
50\r
51 @retval TRUE Shift key needs pressed.\r
52 @retval FALSE Shift key needn't pressed.\r
53**/\r
54#define KEY_OPTION_SHIFT_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_SHIFT_PRESSED_MASK) != 0)\r
55\r
56/**\r
57 Return whether the Control key needs pressed.\r
58\r
59 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
60\r
61 @retval TRUE Control key needs pressed.\r
62 @retval FALSE Control key needn't pressed.\r
63**/\r
64#define KEY_OPTION_CONTROL_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_CONTROL_PRESSED_MASK) != 0)\r
65\r
66/**\r
67 Return whether the Alt key needs pressed.\r
68\r
69 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
70\r
71 @retval TRUE Alt key needs pressed.\r
72 @retval FALSE Alt key needn't pressed.\r
73**/\r
74#define KEY_OPTION_ALT_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_ALT_PRESSED_MASK) != 0)\r
75\r
76/**\r
77 Return whether the Logo key needs pressed.\r
78\r
79 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
80\r
81 @retval TRUE Logo key needs pressed.\r
82 @retval FALSE Logo key needn't pressed.\r
83**/\r
84#define KEY_OPTION_LOGO_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_LOGO_PRESSED_MASK) != 0)\r
85\r
86/**\r
87 Return whether the Menu key needs pressed.\r
88\r
89 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
90\r
91 @retval TRUE Menu key needs pressed.\r
92 @retval FALSE Menu key needn't pressed.\r
93**/\r
94#define KEY_OPTION_MENU_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_MENU_PRESSED_MASK) != 0)\r
95\r
96/**\r
97 Return whether the SysReq key needs pressed.\r
98\r
99 @param KeyOption Pointer to the EFI_KEY_OPTION structure. \r
100\r
101 @retval TRUE SysReq key needs pressed.\r
102 @retval FALSE SysReq key needn't pressed.\r
103**/\r
104#define KEY_OPTION_SYS_REQ_PRESSED(KeyOption) (BOOLEAN) (((KeyOption)->KeyData & EFI_KEY_OPTION_SYS_REQ_PRESSED_MASK) != 0)\r
a9e7937a 105\r
5c08e117 106typedef struct {\r
107 UINTN Signature;\r
108 LIST_ENTRY Link;\r
109\r
402e4a9d 110 VOID *NotifyHandle;\r
5c08e117 111 UINT16 BootOptionNumber;\r
112 UINT8 CodeCount;\r
113 UINT8 WaitingKey;\r
114 EFI_KEY_DATA KeyData[3];\r
115} BDS_HOTKEY_OPTION;\r
116\r
117#define BDS_HOTKEY_OPTION_FROM_LINK(a) CR (a, BDS_HOTKEY_OPTION, Link, BDS_HOTKEY_OPTION_SIGNATURE)\r
118\r
5c08e117 119/**\r
120\r
121 Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.\r
122\r
123\r
124 @param VOID\r
125\r
126 @retval EFI_SUCCESS Hotkey services successfully initialized.\r
127\r
128**/\r
129EFI_STATUS\r
130InitializeHotkeyService (\r
131 VOID\r
132 );\r
133\r
d394581d
RN
134/**\r
135 Try to boot the boot option triggered by hotkey.\r
2df686c6 136 @retval EFI_SUCCESS There is HotkeyBootOption & it is processed\r
137 @retval EFI_NOT_FOUND There is no HotkeyBootOption\r
d394581d 138**/\r
2df686c6 139EFI_STATUS\r
d394581d
RN
140HotkeyBoot (\r
141 VOID\r
142 );\r
143\r
5c08e117 144#endif\r