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