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