]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Include/Library/ExtendedIfrSupportLib.h
Correct typo in comments, clean IfrSupportLib.h
[mirror_edk2.git] / MdeModulePkg / Include / Library / ExtendedIfrSupportLib.h
1 /** @file
2 Library header file defines APIs that is related to IFR operations but
3 specific to EDK II implementation.
4
5 Copyright (c) 2006 - 2008, Intel Corporation. <BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __EXTENDED_IFR_SUPPORT_LIB_H__
17 #define __EXTENDED_IFR_SUPPORT_LIB_H__
18
19 /**
20 Create GUIDed opcode for banner. Banner opcode
21 EFI_IFR_EXTEND_OP_BANNER is extended opcode specific
22 to Intel's implementation.
23
24 @param Title String ID for title
25 @param LineNumber Line number for this banner
26 @param Alignment Alignment for this banner, left, center or right
27 @param Data Destination for the created opcode binary
28
29 @retval EFI_SUCCESS Opcode create success
30 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
31
32 **/
33 EFI_STATUS
34 EFIAPI
35 CreateBannerOpCode (
36 IN EFI_STRING_ID Title,
37 IN UINT16 LineNumber,
38 IN UINT8 Alignment,
39 IN OUT EFI_HII_UPDATE_DATA *Data
40 );
41
42 /**
43 This function initialize the data structure for dynamic opcode.
44
45 @param UpdateData The adding data;
46 @param BufferSize Length of the buffer to fill dynamic opcodes.
47
48 @retval EFI_SUCCESS Update data is initialized.
49 @retval EFI_INVALID_PARAMETER UpdateData is NULL.
50 @retval EFI_OUT_OF_RESOURCES No enough memory to allocate.
51
52 **/
53 EFI_STATUS
54 EFIAPI
55 IfrLibInitUpdateData (
56 IN OUT EFI_HII_UPDATE_DATA *UpdateData,
57 IN UINT32 BufferSize
58 )
59 ;
60
61 /**
62
63 This function free the resource of update data.
64
65 @param UpdateData The adding data;
66
67 **/
68 VOID
69 EFIAPI
70 IfrLibFreeUpdateData (
71 IN EFI_HII_UPDATE_DATA *UpdateData
72 )
73 ;
74
75 /**
76 This function allows the caller to update a form that has
77 previously been registered with the EFI HII database.
78 The update make use of a extended opcode EFI_IFR_EXTEND_OP_LABEL
79 specific to Intel's implementation to complete the operation.
80
81
82 @param Handle Hii Handle
83 @param FormSetGuid The formset should be updated.
84 @param FormId The form should be updated.
85 @param Label Update information starting immediately after this
86 label in the IFR
87 @param Insert If TRUE and Data is not NULL, insert data after
88 Label. If FALSE, replace opcodes between two
89 labels with Data.
90 @param Data The adding data; If NULL, remove opcodes between
91 two Label.
92
93 @retval EFI_SUCCESS Update success.
94 @retval Other Update fail.
95
96 **/
97 EFI_STATUS
98 EFIAPI
99 IfrLibUpdateForm (
100 IN EFI_HII_HANDLE Handle,
101 IN EFI_GUID *FormSetGuid, OPTIONAL
102 IN EFI_FORM_ID FormId,
103 IN UINT16 Label,
104 IN BOOLEAN Insert,
105 IN EFI_HII_UPDATE_DATA *Data
106 );
107
108 /**
109 Extract EDKII extended formset class for a given HII handle.
110
111 If Handle is not a valid EFI_HII_HANDLE in the default HII database, then
112 ASSERT.
113
114 If Class is NULL, then ASSERT.
115 IfFormSetTitle is NULL, then ASSERT.
116 If FormSetHelp is NULL, then ASSERT.
117
118 @param HiiHandle Hii handle
119 @param Class On output, Class of the formset
120 @param FormSetTitle On output, Formset title string
121 @param FormSetHelp On output, Formset help string
122
123 @retval EFI_SUCCESS Successfully extract Class for specified Hii
124 handle.
125
126 **/
127 EFI_STATUS
128 EFIAPI
129 IfrLibExtractClassFromHiiHandle (
130 IN EFI_HII_HANDLE Handle,
131 OUT UINT16 *Class,
132 OUT EFI_STRING_ID *FormSetTitle,
133 OUT EFI_STRING_ID *FormSetHelp
134 );
135
136 /**
137 Configure the buffer accrording to ConfigBody strings in the format of
138 <Length:4 bytes>, <Offset: 2 bytes>, <Width:2 bytes>, <Data:n bytes>.
139 This ConfigBody strings is generated by EDKII UEFI VfrCompiler for the default
140 values in a Form Set. The name of the ConfigBody strings is VfrMyIfrNVDataDefault0000
141 constructed following this rule:
142 "Vfr" + varstore.name + "Default" + defaultstore.attributes.
143 Check the generated C file in Output for details.
144
145 @param Buffer the start address of buffer.
146 @param BufferSize the size of buffer.
147 @param Number the number of the ConfigBody strings.
148 @param ... the ConfigBody strings
149
150 @retval EFI_BUFFER_TOO_SMALL the BufferSize is too small to operate.
151 @retval EFI_INVALID_PARAMETER Buffer is NULL or BufferSize is 0.
152 @retval EFI_SUCCESS Operation successful.
153
154 **/
155 EFI_STATUS
156 EFIAPI
157 IfrLibExtractDefault(
158 IN VOID *Buffer,
159 IN UINTN *BufferSize,
160 UINTN Number,
161 ...
162 );
163
164 #endif
165