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