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