EmbeddedPkg: add platform boot manager protocol
[mirror_edk2.git] / EmbeddedPkg / Include / Protocol / PlatformBootManager.h
1 /** @file
2
3 Copyright (c) 2018, Linaro. All rights reserved.<BR>
4
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
16 #define __PLATFORM_BOOT_MANAGER_PROTOCOL_H__
17
18 //
19 // Protocol interface structure
20 //
21 typedef struct _PLATFORM_BOOT_MANAGER_PROTOCOL PLATFORM_BOOT_MANAGER_PROTOCOL;
22
23 //
24 // Function Prototypes
25 //
26
27 /*
28 Get predefined boot options for platform.
29
30 @param[out] Count The number of elements in each of
31 BootOptions and BootKeys. On successful
32 return, Count is at least one.
33
34 @param[out] BootOptions An array of platform boot options.
35 BootOptions is pool-allocated by
36 GET_PLATFORM_BOOT_OPTIONS_AND_KEYS, and
37 GET_PLATFORM_BOOT_OPTIONS_AND_KEYS populates
38 every element in BootOptions with
39 EfiBootManagerInitializeLoadOption().
40 BootOptions shall not contain duplicate
41 entries. The caller is responsible for
42 releasing BootOptions after use with
43 EfiBootManagerFreeLoadOptions().
44
45 @param[out] BootKeys A pool-allocated array of platform boot
46 hotkeys. For every 0 <= Index < Count, if
47 BootOptions[Index] is not to be associated
48 with a hotkey, then BootKeys[Index] is
49 zero-filled. Otherwise, BootKeys[Index]
50 specifies the boot hotkey for
51 BootOptions[Index]. BootKeys shall not
52 contain duplicate entries (other than
53 zero-filled entries). The caller is
54 responsible for releasing BootKeys with
55 FreePool() after use.
56
57 @retval EFI_SUCCESS Count, BootOptions and BootKeys have
58 been set.
59
60 @retval EFI_OUT_OF_RESOURCES Memory allocation failed.
61
62 @retval EFI_UNSUPPORTED The platform doesn't provide boot options
63 as a feature.
64
65 @retval EFI_NOT_FOUND The platform could provide boot options
66 as a feature, but none have been
67 configured.
68
69 @return Error codes propagated from underlying
70 functions.
71 */
72 typedef
73 EFI_STATUS
74 (EFIAPI *GET_PLATFORM_BOOT_OPTIONS_AND_KEYS) (
75 OUT UINTN *Count,
76 OUT EFI_BOOT_MANAGER_LOAD_OPTION **BootOptions,
77 OUT EFI_INPUT_KEY **BootKeys
78 );
79
80 struct _PLATFORM_BOOT_MANAGER_PROTOCOL {
81 GET_PLATFORM_BOOT_OPTIONS_AND_KEYS GetPlatformBootOptionsAndKeys;
82 };
83
84 extern EFI_GUID gPlatformBootManagerProtocolGuid;
85
86 #endif /* __PLATFORM_BOOT_MANAGER_PROTOCOL_H__ */