]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/BdsDxe/Hotkey.h
Clean up BootMaint module in BdsDxe.
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / Hotkey.h
CommitLineData
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 5Copyright (c) 2007 - 2008, Intel Corporation. <BR>\r
93e3992d 6All rights reserved. This program and the accompanying materials\r
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
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
25typedef 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
b30312ba 40/**\r
41\r
42 Create Key#### for the given hotkey.\r
43\r
44\r
45 @param KeyOption - The Hot Key Option to be added.\r
46 @param KeyOptionNumber - The key option number for Key#### (optional).\r
47\r
48 @retval EFI_SUCCESS Register hotkey successfully.\r
49 @retval EFI_INVALID_PARAMETER The hotkey option is invalid.\r
50\r
51**/\r
93e3992d 52EFI_STATUS\r
53RegisterHotkey (\r
54 IN EFI_KEY_OPTION *KeyOption,\r
55 OUT UINT16 *KeyOptionNumber\r
56)\r
b30312ba 57;\r
93e3992d 58\r
b30312ba 59/**\r
93e3992d 60\r
b30312ba 61 Delete Key#### for the given Key Option number.\r
93e3992d 62\r
93e3992d 63\r
b30312ba 64 @param KeyOptionNumber - Key option number for Key####\r
93e3992d 65\r
b30312ba 66 @retval EFI_SUCCESS Unregister hotkey successfully.\r
67 @retval EFI_NOT_FOUND No Key#### is found for the given Key Option number.\r
93e3992d 68\r
b30312ba 69**/\r
93e3992d 70EFI_STATUS\r
71UnregisterHotkey (\r
72 IN UINT16 KeyOptionNumber\r
73)\r
b30312ba 74;\r
93e3992d 75\r
93e3992d 76\r
b30312ba 77/**\r
93e3992d 78\r
b30312ba 79 Process all the "Key####" variables, associate Hotkeys with corresponding Boot Options.\r
93e3992d 80\r
93e3992d 81\r
b30312ba 82 @param VOID\r
93e3992d 83\r
b30312ba 84 @retval EFI_SUCCESS Hotkey services successfully initialized.\r
93e3992d 85\r
b30312ba 86**/\r
93e3992d 87EFI_STATUS\r
88InitializeHotkeyService (\r
89 VOID\r
90 )\r
93e3992d 91;\r
92\r
93#endif\r