2 Library Routines to create IFR independent of string data - assume tokens already exist
3 Primarily to be used for exporting op-codes at a label in pre-defined forms.
5 Copyright (c) 2007 - 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
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.
16 #include "LibraryInternal.h"
18 STATIC EFI_GUID mIfrVendorGuid
= EFI_IFR_TIANO_GUID
;
21 Create GUIDed opcode for banner. Banner opcode
22 EFI_IFR_EXTEND_OP_BANNER is extended opcode specific
23 to Intel's implementation.
25 @param Title String ID for title
26 @param LineNumber Line number for this banner
27 @param Alignment Alignment for this banner, left, center or right
28 @param Data Destination for the created opcode binary
30 @retval EFI_SUCCESS Opcode create success
31 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
37 IN EFI_STRING_ID Title
,
40 IN OUT EFI_HII_UPDATE_DATA
*Data
43 EFI_IFR_GUID_BANNER Banner
;
46 ASSERT (Data
!= NULL
&& Data
->Data
!= NULL
);
48 if (Data
->Offset
+ sizeof (EFI_IFR_GUID_BANNER
) > Data
->BufferSize
) {
49 return EFI_BUFFER_TOO_SMALL
;
52 Banner
.Header
.OpCode
= EFI_IFR_GUID_OP
;
53 Banner
.Header
.Length
= sizeof (EFI_IFR_GUID_BANNER
);
54 Banner
.Header
.Scope
= 0;
55 CopyMem (&Banner
.Guid
, &mIfrVendorGuid
, sizeof (EFI_IFR_GUID
));
56 Banner
.ExtendOpCode
= EFI_IFR_EXTEND_OP_BANNER
;
58 Banner
.LineNumber
= LineNumber
;
59 Banner
.Alignment
= Alignment
;
61 LocalBuffer
= (UINT8
*) Data
->Data
+ Data
->Offset
;
62 CopyMem (LocalBuffer
, &Banner
, sizeof (EFI_IFR_GUID_BANNER
));
63 Data
->Offset
+= sizeof (EFI_IFR_GUID_BANNER
);