]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/BdsDxe/Bds.h
MdeModulePkg: Add BdsDxe driver and PlatformBootManagerNull library.
[mirror_edk2.git] / MdeModulePkg / Universal / BdsDxe / Bds.h
1 /** @file
2 Head file for BDS Architectural Protocol implementation
3
4 Copyright (c) 2004 - 2015, 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/Performance.h>
22 #include <Guid/StatusCodeDataTypeVariable.h>
23
24 #include <Protocol/Bds.h>
25 #include <Protocol/LoadedImage.h>
26 #include <Protocol/VariableLock.h>
27 #include <Protocol/BlockIo.h>
28 #include <Protocol/LoadFile.h>
29 #include <Protocol/SimpleFileSystem.h>
30
31 #include <Library/UefiDriverEntryPoint.h>
32 #include <Library/DebugLib.h>
33 #include <Library/BaseMemoryLib.h>
34 #include <Library/UefiBootServicesTableLib.h>
35 #include <Library/UefiRuntimeServicesTableLib.h>
36 #include <Library/UefiLib.h>
37 #include <Library/MemoryAllocationLib.h>
38 #include <Library/ReportStatusCodeLib.h>
39 #include <Library/BaseLib.h>
40 #include <Library/PcdLib.h>
41 #include <Library/PerformanceLib.h>
42 #include <Library/DevicePathLib.h>
43 #include <Library/PrintLib.h>
44
45 #include <Library/UefiBootManagerLib.h>
46 #include <Library/PlatformBootManagerLib.h>
47
48 /**
49
50 Service routine for BdsInstance->Entry(). Devices are connected, the
51 consoles are initialized, and the boot options are tried.
52
53 @param This Protocol Instance structure.
54
55 **/
56 VOID
57 EFIAPI
58 BdsEntry (
59 IN EFI_BDS_ARCH_PROTOCOL *This
60 );
61
62 /**
63 Set the variable and report the error through status code upon failure.
64
65 @param VariableName A Null-terminated string that is the name of the vendor's variable.
66 Each VariableName is unique for each VendorGuid. VariableName must
67 contain 1 or more characters. If VariableName is an empty string,
68 then EFI_INVALID_PARAMETER is returned.
69 @param VendorGuid A unique identifier for the vendor.
70 @param Attributes Attributes bitmask to set for the variable.
71 @param DataSize The size in bytes of the Data buffer. Unless the EFI_VARIABLE_APPEND_WRITE,
72 EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS, or
73 EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS attribute is set, a size of zero
74 causes the variable to be deleted. When the EFI_VARIABLE_APPEND_WRITE attribute is
75 set, then a SetVariable() call with a DataSize of zero will not cause any change to
76 the variable value (the timestamp associated with the variable may be updated however
77 even if no new data value is provided,see the description of the
78 EFI_VARIABLE_AUTHENTICATION_2 descriptor below. In this case the DataSize will not
79 be zero since the EFI_VARIABLE_AUTHENTICATION_2 descriptor will be populated).
80 @param Data The contents for the variable.
81
82 @retval EFI_SUCCESS The firmware has successfully stored the variable and its data as
83 defined by the Attributes.
84 @retval EFI_INVALID_PARAMETER An invalid combination of attribute bits, name, and GUID was supplied, or the
85 DataSize exceeds the maximum allowed.
86 @retval EFI_INVALID_PARAMETER VariableName is an empty string.
87 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
88 @retval EFI_DEVICE_ERROR The variable could not be retrieved due to a hardware error.
89 @retval EFI_WRITE_PROTECTED The variable in question is read-only.
90 @retval EFI_WRITE_PROTECTED The variable in question cannot be deleted.
91 @retval EFI_SECURITY_VIOLATION The variable could not be written due to EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS
92 or EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACESS being set, but the AuthInfo
93 does NOT pass the validation check carried out by the firmware.
94
95 @retval EFI_NOT_FOUND The variable trying to be updated or deleted was not found.
96 **/
97 EFI_STATUS
98 BdsDxeSetVariableAndReportStatusCodeOnError (
99 IN CHAR16 *VariableName,
100 IN EFI_GUID *VendorGuid,
101 IN UINT32 Attributes,
102 IN UINTN DataSize,
103 IN VOID *Data
104 );
105
106 #endif