]>
Commit | Line | Data |
---|---|---|
fd6a62f3 | 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 | |
93e3992d | 4 | \r |
fd6a62f3 | 5 | Copyright (c) 2007 - 2008, Intel Corporation. <BR>\r |
93e3992d | 6 | All rights reserved. This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
fd6a62f3 | 14 | **/\r |
93e3992d | 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 | |
22 | #define GET_KEY_CODE_COUNT(KeyOptions) (((KeyOptions) & EFI_KEY_CODE_COUNT) >> 8)\r | |
23 | \r | |
24 | #define BDS_HOTKEY_OPTION_SIGNATURE EFI_SIGNATURE_32 ('B', 'd', 'K', 'O')\r | |
25 | typedef struct {\r | |
26 | UINTN Signature;\r | |
27 | LIST_ENTRY Link;\r | |
28 | \r | |
29 | EFI_HANDLE NotifyHandle;\r | |
30 | UINT16 BootOptionNumber;\r | |
31 | UINT8 CodeCount;\r | |
32 | UINT8 WaitingKey;\r | |
33 | EFI_KEY_DATA KeyData[3];\r | |
34 | } BDS_HOTKEY_OPTION;\r | |
35 | \r | |
36 | #define BDS_HOTKEY_OPTION_FROM_LINK(a) CR (a, BDS_HOTKEY_OPTION, Link, BDS_HOTKEY_OPTION_SIGNATURE)\r | |
37 | \r | |
38 | #define VarKeyOrder L"KeyOrder"\r | |
39 | \r | |
40 | EFI_STATUS\r | |
41 | RegisterHotkey (\r | |
42 | IN EFI_KEY_OPTION *KeyOption,\r | |
43 | OUT UINT16 *KeyOptionNumber\r | |
44 | )\r | |
45 | /*++\r | |
46 | \r | |
47 | Routine Description:\r | |
48 | \r | |
49 | Create Key#### for the given hotkey.\r | |
50 | \r | |
51 | Arguments:\r | |
52 | \r | |
53 | KeyOption - The Hot Key Option to be added.\r | |
54 | KeyOptionNumber - The key option number for Key#### (optional).\r | |
55 | \r | |
56 | Returns:\r | |
57 | \r | |
58 | EFI_SUCCESS - Register hotkey successfully.\r | |
59 | EFI_INVALID_PARAMETER - The hotkey option is invalid.\r | |
60 | \r | |
61 | --*/\r | |
62 | ;\r | |
63 | \r | |
64 | EFI_STATUS\r | |
65 | UnregisterHotkey (\r | |
66 | IN UINT16 KeyOptionNumber\r | |
67 | )\r | |
68 | /*++\r | |
69 | \r | |
70 | Routine Description:\r | |
71 | \r | |
72 | Delete Key#### for the given Key Option number.\r | |
73 | \r | |
74 | Arguments:\r | |
75 | \r | |
76 | KeyOptionNumber - Key option number for Key####\r | |
77 | \r | |
78 | Returns:\r | |
79 | \r | |
80 | EFI_SUCCESS - Unregister hotkey successfully.\r | |
81 | EFI_NOT_FOUND - No Key#### is found for the given Key Option number.\r | |
82 | \r | |
83 | --*/\r | |
84 | ;\r | |
85 | \r | |
86 | \r | |
87 | EFI_STATUS\r | |
88 | InitializeHotkeyService (\r | |
89 | VOID\r | |
90 | )\r | |
91 | /*++\r | |
92 | \r | |
93 | Routine Description:\r | |
94 | \r | |
95 | Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.\r | |
96 | \r | |
97 | Arguments:\r | |
98 | \r | |
99 | None\r | |
100 | \r | |
101 | Returns:\r | |
102 | \r | |
103 | EFI_SUCCESS - Hotkey services successfully initialized.\r | |
104 | \r | |
105 | --*/\r | |
106 | ;\r | |
107 | \r | |
108 | #endif\r |