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