]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/PlatformBdsLib.h
c24e29ab4526e1446e0e92fc895d6693400b5000
[mirror_edk2.git] / MdeModulePkg / Include / Library / PlatformBdsLib.h
1 /** @file
2 Platform BDS library definition. Platform package can provide hook library
3 instances to implement platform specific behavior.
4
5 Copyright (c) 2008, Intel Corporation. <BR>
6 All rights reserved. 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 __PLATFORM_BDS_LIB_H_
17 #define __PLATFORM_BDS_LIB_H_
18
19 #include <PiDxe.h>
20 #include <Protocol/Bds.h>
21 #include <Protocol/GenericMemoryTest.h>
22
23 //
24 // Bds AP Context data
25 //
26 #define EFI_BDS_ARCH_PROTOCOL_INSTANCE_SIGNATURE EFI_SIGNATURE_32 ('B', 'd', 's', 'A')
27 typedef struct _EFI_BDS_ARCH_PROTOCOL_INSTANCE EFI_BDS_ARCH_PROTOCOL_INSTANCE;
28
29 struct _EFI_BDS_ARCH_PROTOCOL_INSTANCE {
30 UINTN Signature;
31 EFI_HANDLE Handle;
32 EFI_BDS_ARCH_PROTOCOL Bds;
33 //
34 // Save the current boot mode
35 //
36 EFI_BOOT_MODE BootMode;
37 //
38 // Set true if boot with default settings
39 //
40 BOOLEAN DefaultBoot;
41 //
42 // The system default timeout for choose the boot option
43 //
44 UINT16 TimeoutDefault;
45 //
46 // Memory Test Level
47 //
48 EXTENDMEM_COVERAGE_LEVEL MemoryTestLevel;
49 };
50
51 /**
52 Platform Bds init. Incude the platform firmware vendor, revision
53 and so crc check.
54
55 @param PrivateData The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance
56
57 @return None.
58
59 **/
60 VOID
61 EFIAPI
62 PlatformBdsInit (
63 IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData
64 )
65 ;
66
67 /**
68 The function will excute with as the platform policy, current policy
69 is driven by boot mode. IBV/OEM can customize this code for their specific
70 policy action.
71
72 @param PrivateData The EFI_BDS_ARCH_PROTOCOL_INSTANCE instance
73 @param DriverOptionList The header of the driver option link list
74 @param BootOptionList The header of the boot option link list
75
76 **/
77 VOID
78 EFIAPI
79 PlatformBdsPolicyBehavior (
80 IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData,
81 IN LIST_ENTRY *DriverOptionList,
82 IN LIST_ENTRY *BootOptionList
83 )
84 ;
85
86 /**
87 Hook point after a boot attempt fails.
88
89 @param Option Pointer to Boot Option that failed to boot.
90 @param Status Status returned from failed boot.
91 @param ExitData Exit data returned from failed boot.
92 @param ExitDataSize Exit data size returned from failed boot.
93
94 @return None.
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 /**
108 Hook point after a boot attempt succeeds. We don't expect a boot option to
109 return, so the UEFI 2.0 specification defines that you will default to an
110 interactive mode and stop processing the BootOrder list in this case. This
111 is alos a platform implementation and can be customized by IBV/OEM.
112
113 @param Option Pointer to Boot Option that succeeded to boot.
114
115 **/
116 VOID
117 EFIAPI
118 PlatformBdsBootSuccess (
119 IN BDS_COMMON_OPTION *Option
120 )
121 ;
122
123
124 /**
125 This function locks platform flash that is not allowed to be updated during normal boot path.
126 The flash layout is platform specific.
127
128 @retval EFI_SUCCESS The non-updatable flash areas.
129 @retval Others Some error occurs when locking non-updatable flash areas.
130 **/
131 EFI_STATUS
132 EFIAPI
133 PlatformBdsLockNonUpdatableFlash (
134 VOID
135 )
136 ;
137 #endif