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