]>
Commit | Line | Data |
---|---|---|
f4cd24da RN |
1 | /** @file\r |
2 | Head file for BDS Architectural Protocol implementation\r | |
3 | \r | |
9f0d7651 | 4 | Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9d510e61 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
f4cd24da RN |
6 | \r |
7 | **/\r | |
8 | \r | |
9 | #ifndef _BDS_MODULE_H_\r | |
10 | #define _BDS_MODULE_H_\r | |
11 | \r | |
12 | #include <Uefi.h>\r | |
13 | #include <Guid/GlobalVariable.h>\r | |
14 | #include <Guid/ConnectConInEvent.h>\r | |
f4cd24da | 15 | #include <Guid/StatusCodeDataTypeVariable.h>\r |
048bcba1 | 16 | #include <Guid/EventGroup.h>\r |
f4cd24da RN |
17 | \r |
18 | #include <Protocol/Bds.h>\r | |
19 | #include <Protocol/LoadedImage.h>\r | |
20 | #include <Protocol/VariableLock.h>\r | |
048bcba1 | 21 | #include <Protocol/DeferredImageLoad.h>\r |
f4cd24da RN |
22 | \r |
23 | #include <Library/UefiDriverEntryPoint.h>\r | |
24 | #include <Library/DebugLib.h>\r | |
25 | #include <Library/BaseMemoryLib.h>\r | |
26 | #include <Library/UefiBootServicesTableLib.h>\r | |
27 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
28 | #include <Library/UefiLib.h>\r | |
29 | #include <Library/MemoryAllocationLib.h>\r | |
30 | #include <Library/ReportStatusCodeLib.h>\r | |
31 | #include <Library/BaseLib.h>\r | |
32 | #include <Library/PcdLib.h>\r | |
33 | #include <Library/PerformanceLib.h>\r | |
34 | #include <Library/DevicePathLib.h>\r | |
35 | #include <Library/PrintLib.h>\r | |
36 | \r | |
37 | #include <Library/UefiBootManagerLib.h>\r | |
38 | #include <Library/PlatformBootManagerLib.h>\r | |
39 | \r | |
67b1c254 RN |
40 | #if !defined (EFI_REMOVABLE_MEDIA_FILE_NAME)\r |
41 | #if defined (MDE_CPU_EBC)\r | |
42 | //\r | |
43 | // Uefi specification only defines the default boot file name for IA32, X64\r | |
44 | // and IPF processor, so need define boot file name for EBC architecture here.\r | |
45 | //\r | |
46 | #define EFI_REMOVABLE_MEDIA_FILE_NAME L"\\EFI\\BOOT\\BOOTEBC.EFI"\r | |
47 | #else\r | |
48 | #error "Can not determine the default boot file name for unknown processor type!"\r | |
49 | #endif\r | |
50 | #endif\r | |
51 | \r | |
f4cd24da RN |
52 | /**\r |
53 | \r | |
54 | Service routine for BdsInstance->Entry(). Devices are connected, the\r | |
55 | consoles are initialized, and the boot options are tried.\r | |
56 | \r | |
57 | @param This Protocol Instance structure.\r | |
58 | \r | |
59 | **/\r | |
60 | VOID\r | |
61 | EFIAPI\r | |
62 | BdsEntry (\r | |
63 | IN EFI_BDS_ARCH_PROTOCOL *This\r | |
64 | );\r | |
65 | \r | |
66 | /**\r | |
67 | Set the variable and report the error through status code upon failure.\r | |
68 | \r | |
69 | @param VariableName A Null-terminated string that is the name of the vendor's variable.\r | |
70 | Each VariableName is unique for each VendorGuid. VariableName must\r | |
71 | contain 1 or more characters. If VariableName is an empty string,\r | |
72 | then EFI_INVALID_PARAMETER is returned.\r | |
73 | @param VendorGuid A unique identifier for the vendor.\r | |
74 | @param Attributes Attributes bitmask to set for the variable.\r | |
d1102dba | 75 | @param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,\r |
4073f85d | 76 | or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero\r |
d1102dba LG |
77 | causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is\r |
78 | set, then a SetVariable() call with a DataSize of zero will not cause any change to\r | |
79 | the variable value (the timestamp associated with the variable may be updated however\r | |
80 | even if no new data value is provided,see the description of the\r | |
81 | EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not\r | |
82 | be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).\r | |
f4cd24da RN |
83 | @param Data The contents for the variable.\r |
84 | \r | |
85 | @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as\r | |
86 | defined by the Attributes.\r | |
87 | @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the\r | |
88 | DataSize exceeds the maximum allowed.\r | |
89 | @retval EFI_INVALID_PARAMETER VariableName is an empty string.\r | |
90 | @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r | |
91 | @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.\r | |
92 | @retval EFI_WRITE_PROTECTED The variable in question is read-only.\r | |
93 | @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.\r | |
4073f85d ZC |
94 | @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS\r |
95 | being set, but the AuthInfo does NOT pass the validation check carried out by the firmware.\r | |
f4cd24da RN |
96 | \r |
97 | @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.\r | |
98 | **/\r | |
99 | EFI_STATUS\r | |
100 | BdsDxeSetVariableAndReportStatusCodeOnError (\r | |
101 | IN CHAR16 *VariableName,\r | |
102 | IN EFI_GUID *VendorGuid,\r | |
103 | IN UINT32 Attributes,\r | |
104 | IN UINTN DataSize,\r | |
105 | IN VOID *Data\r | |
106 | );\r | |
107 | \r | |
108 | #endif\r |