]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Library/PlatformBdsLib.h
Sync in bug fix from EDK I:
[mirror_edk2.git] / MdeModulePkg / Include / Library / PlatformBdsLib.h
CommitLineData
e2270e40 1/** @file\r
2 Platform BDS library definition. Platform package can provide hook library\r
3 instances to implement platform specific behavior.\r
93e3992d 4\r
e2270e40 5Copyright (c) 2008, Intel Corporation. <BR>\r
6All rights reserved. This program and the accompanying materials\r
7are licensed and made available under the terms and conditions of the BSD License\r
8which accompanies this distribution. The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php\r
93e3992d 10\r
e2270e40 11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
93e3992d 13\r
e2270e40 14**/\r
93e3992d 15\r
16#ifndef __PLATFORM_BDS_LIB_H_\r
17#define __PLATFORM_BDS_LIB_H_\r
18\r
93e3992d 19#include <Protocol/Bds.h>\r
20#include <Protocol/GenericMemoryTest.h>\r
21\r
22//\r
23// Bds AP Context data\r
24//\r
25#define EFI_BDS_ARCH_PROTOCOL_INSTANCE_SIGNATURE EFI_SIGNATURE_32 ('B', 'd', 's', 'A')\r
26typedef struct _EFI_BDS_ARCH_PROTOCOL_INSTANCE EFI_BDS_ARCH_PROTOCOL_INSTANCE;\r
27\r
28struct _EFI_BDS_ARCH_PROTOCOL_INSTANCE {\r
29 UINTN Signature;\r
30 EFI_HANDLE Handle;\r
31 EFI_BDS_ARCH_PROTOCOL Bds;\r
32 //\r
33 // Save the current boot mode\r
34 //\r
35 EFI_BOOT_MODE BootMode;\r
36 //\r
37 // Set true if boot with default settings\r
38 //\r
39 BOOLEAN DefaultBoot;\r
40 //\r
41 // The system default timeout for choose the boot option\r
42 //\r
43 UINT16 TimeoutDefault;\r
44 //\r
45 // Memory Test Level\r
46 //\r
47 EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel;\r
48};\r
49\r
e2270e40 50/**\r
51 Platform Bds init. Incude the platform firmware vendor, revision\r
52 and so crc check.\r
53\r
54 @param PrivateData The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance\r
55\r
e2270e40 56**/\r
93e3992d 57VOID\r
58EFIAPI\r
59PlatformBdsInit (\r
60 IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData\r
ed66e1bc 61 );\r
93e3992d 62\r
e2270e40 63/**\r
64 The function will excute with as the platform policy, current policy\r
65 is driven by boot mode. IBV/OEM can customize this code for their specific\r
66 policy action.\r
67\r
68 @param PrivateData The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance\r
69 @param DriverOptionList The header of the driver option link list\r
70 @param BootOptionList The header of the boot option link list\r
71\r
72**/\r
93e3992d 73VOID\r
74EFIAPI\r
75PlatformBdsPolicyBehavior (\r
76 IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData,\r
77 IN LIST_ENTRY *DriverOptionList,\r
78 IN LIST_ENTRY *BootOptionList\r
ed66e1bc 79 );\r
93e3992d 80\r
e2270e40 81/**\r
82 Hook point after a boot attempt fails.\r
83\r
84 @param Option Pointer to Boot Option that failed to boot.\r
85 @param Status Status returned from failed boot.\r
86 @param ExitData Exit data returned from failed boot.\r
87 @param ExitDataSize Exit data size returned from failed boot.\r
88\r
e2270e40 89**/\r
93e3992d 90VOID\r
e2270e40 91EFIAPI\r
93e3992d 92PlatformBdsBootFail (\r
93 IN BDS_COMMON_OPTION *Option,\r
94 IN EFI_STATUS Status,\r
95 IN CHAR16 *ExitData,\r
96 IN UINTN ExitDataSize\r
ed66e1bc 97 );\r
93e3992d 98\r
e2270e40 99/**\r
100 Hook point after a boot attempt succeeds. We don't expect a boot option to\r
101 return, so the UEFI 2.0 specification defines that you will default to an\r
102 interactive mode and stop processing the BootOrder list in this case. This\r
103 is alos a platform implementation and can be customized by IBV/OEM.\r
104\r
105 @param Option Pointer to Boot Option that succeeded to boot.\r
106\r
107**/\r
93e3992d 108VOID\r
e2270e40 109EFIAPI\r
93e3992d 110PlatformBdsBootSuccess (\r
111 IN BDS_COMMON_OPTION *Option\r
ed66e1bc 112 );\r
93e3992d 113\r
e2270e40 114\r
115/**\r
116 This function locks platform flash that is not allowed to be updated during normal boot path.\r
117 The flash layout is platform specific.\r
118\r
119 @retval EFI_SUCCESS The non-updatable flash areas.\r
e2270e40 120**/\r
93e3992d 121EFI_STATUS\r
122EFIAPI\r
123PlatformBdsLockNonUpdatableFlash (\r
124 VOID\r
ed66e1bc 125 );\r
93e3992d 126#endif\r