ddac74d1 |
1 | /** @file\r |
2 | Platform BDS library definition. Platform package can provide hook library\r |
3 | instances to implement platform specific behavior.\r |
4 | \r |
5 | Copyright (c) 2008, Intel Corporation. <BR>\r |
6 | All rights reserved. This program and the accompanying materials\r |
7 | are licensed and made available under the terms and conditions of the BSD License\r |
8 | which accompanies this distribution. The full text of the license may be found at\r |
9 | http://opensource.org/licenses/bsd-license.php\r |
10 | \r |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r |
13 | \r |
14 | **/\r |
15 | \r |
16 | #ifndef __PLATFORM_BDS_LIB_H_\r |
17 | #define __PLATFORM_BDS_LIB_H_\r |
18 | \r |
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 SIGNATURE_32 ('B', 'd', 's', 'A')\r |
26 | typedef struct _EFI_BDS_ARCH_PROTOCOL_INSTANCE EFI_BDS_ARCH_PROTOCOL_INSTANCE;\r |
27 | \r |
28 | struct _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 |
50 | /**\r |
51 | Platform Bds init. Include 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 |
56 | **/\r |
57 | VOID\r |
58 | EFIAPI\r |
59 | PlatformBdsInit (\r |
60 | IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData\r |
61 | );\r |
62 | \r |
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 |
73 | VOID\r |
74 | EFIAPI\r |
75 | PlatformBdsPolicyBehavior (\r |
76 | IN EFI_BDS_ARCH_PROTOCOL_INSTANCE *PrivateData,\r |
77 | IN LIST_ENTRY *DriverOptionList,\r |
78 | IN LIST_ENTRY *BootOptionList\r |
79 | );\r |
80 | \r |
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 |
89 | **/\r |
90 | VOID\r |
91 | EFIAPI\r |
92 | PlatformBdsBootFail (\r |
93 | IN BDS_COMMON_OPTION *Option,\r |
94 | IN EFI_STATUS Status,\r |
95 | IN CHAR16 *ExitData,\r |
96 | IN UINTN ExitDataSize\r |
97 | );\r |
98 | \r |
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 |
108 | VOID\r |
109 | EFIAPI\r |
110 | PlatformBdsBootSuccess (\r |
111 | IN BDS_COMMON_OPTION *Option\r |
112 | );\r |
113 | \r |
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 |
120 | **/\r |
121 | EFI_STATUS\r |
122 | EFIAPI\r |
123 | PlatformBdsLockNonUpdatableFlash (\r |
124 | VOID\r |
125 | );\r |
126 | #endif\r |