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