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