]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/BdsDxe/Bds.h
Driver health management implementation in BDS based on UEFI Specification 2.3.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / Bds.h
1 /** @file
2 Head file for BDS Architectural Protocol implementation
3
4 Copyright (c) 2004 - 2009, Intel Corporation. <BR>
5 All rights reserved. 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 _BDS_MODULE_H_
16 #define _BDS_MODULE_H_
17
18 #include <FrameworkDxe.h>
19 #include <IndustryStandard/PeImage.h>
20 #include <Guid/MdeModuleHii.h>
21 #include <Guid/FileSystemVolumeLabelInfo.h>
22 #include <Guid/HiiPlatformSetupFormset.h>
23 #include <Protocol/DevicePath.h>
24 #include <IndustryStandard/SmBios.h>
25 #include <Protocol/LoadFile.h>
26 #include <Protocol/CpuIo.h>
27 #include <Guid/FileInfo.h>
28 #include <Protocol/HiiConfigRouting.h>
29 #include <Protocol/Bds.h>
30 #include <Protocol/Smbios.h>
31 #include <Protocol/UgaDraw.h>
32 #include <Protocol/BlockIo.h>
33 #include <Guid/GlobalVariable.h>
34 #include <Guid/CapsuleVendor.h>
35 #include <Guid/StatusCodeDataTypeId.h>
36 #include <Protocol/GenericMemoryTest.h>
37 #include <Protocol/FormBrowser2.h>
38 #include <Protocol/HiiConfigAccess.h>
39 #include <Protocol/GraphicsOutput.h>
40 #include <Protocol/SimpleFileSystem.h>
41 #include <Protocol/HiiDatabase.h>
42 #include <Protocol/HiiString.h>
43 #include <Protocol/SerialIo.h>
44 #include <Protocol/LegacyBios.h>
45 #include <Protocol/SimpleTextInEx.h>
46 #include <Protocol/DriverHealth.h>
47
48 #include <Library/UefiDriverEntryPoint.h>
49 #include <Library/PrintLib.h>
50 #include <Library/DebugLib.h>
51 #include <Library/BaseMemoryLib.h>
52 #include <Library/UefiBootServicesTableLib.h>
53 #include <Library/UefiLib.h>
54 #include <Library/MemoryAllocationLib.h>
55 #include <Library/PerformanceLib.h>
56 #include <Library/ReportStatusCodeLib.h>
57 #include <Library/UefiRuntimeServicesTableLib.h>
58 #include <Library/HobLib.h>
59 #include <Library/BaseLib.h>
60 #include <Library/DevicePathLib.h>
61 #include <Library/PcdLib.h>
62 #include <Library/CapsuleLib.h>
63 #include <Library/HiiLib.h>
64 #include <Library/DevicePathLib.h>
65 #include <Library/PcdLib.h>
66 #include <Library/UefiHiiServicesLib.h>
67
68 #include <Library/GenericBdsLib.h>
69 #include <Library/PlatformBdsLib.h>
70
71 #pragma pack(1)
72
73 ///
74 /// HII specific Vendor Device Path definition.
75 ///
76 typedef struct {
77 VENDOR_DEVICE_PATH VendorDevicePath;
78 EFI_DEVICE_PATH_PROTOCOL End;
79 } HII_VENDOR_DEVICE_PATH;
80
81 #pragma pack()
82
83 /**
84
85 Show progress bar with title above it. It only works in Graphics mode.
86
87 @param TitleForeground Foreground color for Title.
88 @param TitleBackground Background color for Title.
89 @param Title Title above progress bar.
90 @param ProgressColor Progress bar color.
91 @param Progress Progress (0-100)
92 @param PreviousValue The previous value of the progress.
93
94 @retval EFI_STATUS Success update the progress bar
95
96 **/
97 EFI_STATUS
98 PlatformBdsShowProgress (
99 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleForeground,
100 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL TitleBackground,
101 IN CHAR16 *Title,
102 IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL ProgressColor,
103 IN UINTN Progress,
104 IN UINTN PreviousValue
105 );
106
107 //
108 // Prototypes
109 //
110
111 /**
112
113 Install Boot Device Selection Protocol
114
115 @param ImageHandle The image handle.
116 @param SystemTable The system table.
117
118 @retval EFI_SUCEESS BDS has finished initializing.
119 Return the dispatcher and recall BDS.Entry
120 @retval Other Return status from AllocatePool() or gBS->InstallProtocolInterface
121
122 **/
123 EFI_STATUS
124 EFIAPI
125 BdsInitialize (
126 IN EFI_HANDLE ImageHandle,
127 IN EFI_SYSTEM_TABLE *SystemTable
128 );
129
130 /**
131
132 Service routine for BdsInstance->Entry(). Devices are connected, the
133 consoles are initialized, and the boot options are tried.
134
135 @param This Protocol Instance structure.
136
137 **/
138 VOID
139 EFIAPI
140 BdsEntry (
141 IN EFI_BDS_ARCH_PROTOCOL *This
142 );
143
144
145 /**
146 Perform the memory test base on the memory test intensive level,
147 and update the memory resource.
148
149 @param Level The memory test intensive level.
150
151 @retval EFI_STATUS Success test all the system memory and update
152 the memory resource
153
154 **/
155 EFI_STATUS
156 BdsMemoryTest (
157 IN EXTENDMEM_COVERAGE_LEVEL Level
158 );
159
160 /**
161
162 This routine is called to see if there are any capsules we need to process.
163 If the boot mode is not UPDATE, then we do nothing. Otherwise find the
164 capsule HOBS and produce firmware volumes for them via the DXE service.
165 Then call the dispatcher to dispatch drivers from them. Finally, check
166 the status of the updates.
167
168 This function should be called by BDS in case we need to do some
169 sort of processing even if there is no capsule to process. We
170 need to do this if an earlier update went away and we need to
171 clear the capsule variable so on the next reset PEI does not see it and
172 think there is a capsule available.
173
174 @param BootMode the current boot mode
175
176 @retval EFI_INVALID_PARAMETER boot mode is not correct for an update
177 @retval EFI_SUCCESS There is no error when processing capsule
178
179 **/
180 EFI_STATUS
181 BdsProcessCapsules (
182 EFI_BOOT_MODE BootMode
183 );
184
185 #endif