]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Include/Library/PlatformBdsLib.h
IntelFrameworkModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Library / PlatformBdsLib.h
1 /** @file
2 Platform BDS library definition. A platform can implement
3 instances to support platform-specific behavior.
4
5 Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
7
8 **/
9
10 #ifndef __PLATFORM_BDS_LIB_H_
11 #define __PLATFORM_BDS_LIB_H_
12
13 #include <Protocol/GenericMemoryTest.h>
14 #include <Library/GenericBdsLib.h>
15
16 /**
17 Perform the memory test base on the memory test intensive level,
18 and update the memory resource.
19
20 @param Level The memory test intensive level.
21
22 @retval EFI_STATUS Successfully test all the system memory, and update
23 the memory resource
24
25 **/
26 typedef
27 EFI_STATUS
28 (EFIAPI *BASEM_MEMORY_TEST)(
29 IN EXTENDMEM_COVERAGE_LEVEL Level
30 );
31
32 /**
33 This routine is called to see if there are any capsules we need to process.
34 If the boot mode is not UPDATE, then we do nothing. Otherwise, find the
35 capsule HOBS and produce firmware volumes for them via the DXE service.
36 Then call the dispatcher to dispatch drivers from them. Finally, check
37 the status of the updates.
38
39 This function should be called by BDS in case we need to do some
40 sort of processing even if there is no capsule to process. We
41 need to do this if an earlier update went away and we need to
42 clear the capsule variable so on the next reset PEI does not see it and
43 think there is a capsule available.
44
45 @param BootMode The current boot mode
46
47 @retval EFI_INVALID_PARAMETER The boot mode is not correct for an update.
48 @retval EFI_SUCCESS There is no error when processing a capsule.
49
50 **/
51 typedef
52 EFI_STATUS
53 (EFIAPI *PROCESS_CAPSULES)(
54 IN EFI_BOOT_MODE BootMode
55 );
56
57 /**
58 Platform Bds initialization. Includes the platform firmware vendor, revision
59 and so crc check.
60
61 **/
62 VOID
63 EFIAPI
64 PlatformBdsInit (
65 VOID
66 );
67
68 /**
69 The function will execute with as the platform policy, current policy
70 is driven by boot mode. IBV/OEM can customize this code for their specific
71 policy action.
72
73 @param DriverOptionList The header of the driver option link list
74 @param BootOptionList The header of the boot option link list
75 @param ProcessCapsules A pointer to ProcessCapsules()
76 @param BaseMemoryTest A pointer to BaseMemoryTest()
77
78 **/
79 VOID
80 EFIAPI
81 PlatformBdsPolicyBehavior (
82 IN LIST_ENTRY *DriverOptionList,
83 IN LIST_ENTRY *BootOptionList,
84 IN PROCESS_CAPSULES ProcessCapsules,
85 IN BASEM_MEMORY_TEST BaseMemoryTest
86 );
87
88 /**
89 Hook point for a user-provided function, for after a boot attempt fails.
90
91 @param Option A pointer to Boot Option that failed to boot.
92 @param Status The status returned from failed boot.
93 @param ExitData The exit data returned from failed boot.
94 @param ExitDataSize The exit data size returned from failed boot.
95
96 **/
97 VOID
98 EFIAPI
99 PlatformBdsBootFail (
100 IN BDS_COMMON_OPTION *Option,
101 IN EFI_STATUS Status,
102 IN CHAR16 *ExitData,
103 IN UINTN ExitDataSize
104 );
105
106 /**
107 Hook point after a boot attempt succeeds. We don't expect a boot option to
108 return, so the UEFI 2.0 specification defines that you will default to an
109 interactive mode and stop processing the BootOrder list in this case. This
110 is also a platform implementation, and can be customized by an IBV/OEM.
111
112 @param Option A pointer to the Boot Option that successfully booted.
113
114 **/
115 VOID
116 EFIAPI
117 PlatformBdsBootSuccess (
118 IN BDS_COMMON_OPTION *Option
119 );
120
121
122 /**
123 This function locks platform flash that is not allowed to be updated during normal boot path.
124 The flash layout is platform specific.
125
126 **/
127 VOID
128 EFIAPI
129 PlatformBdsLockNonUpdatableFlash (
130 VOID
131 );
132
133 /**
134 Lock the ConsoleIn device in system table. All key
135 presses will be ignored until the Password is typed in. The only way to
136 disable the password is to type it in to a ConIn device.
137
138 @param Password The password used to lock ConIn device.
139
140 @retval EFI_SUCCESS Lock the Console In Spliter virtual handle successfully.
141 @retval EFI_UNSUPPORTED Password not found.
142
143 **/
144 EFI_STATUS
145 EFIAPI
146 LockKeyboards (
147 IN CHAR16 *Password
148 );
149
150 #endif