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"
19 Create GUIDed opcode for banner. Banner opcode
20 EFI_IFR_EXTEND_OP_BANNER is extended opcode specific
21 to Intel's implementation.
23 @param Title String ID for title
24 @param LineNumber Line number for this banner
25 @param Alignment Alignment for this banner, left, center or right
26 @param Data Destination for the created opcode binary
28 @retval EFI_SUCCESS Opcode create success
29 @retval EFI_BUFFER_TOO_SMALL The space reserved in Data field is too small.
35 IN EFI_STRING_ID Title
,
38 IN OUT EFI_HII_UPDATE_DATA
*Data
41 EFI_IFR_GUID_BANNER Banner
;
44 ASSERT (Data
!= NULL
&& Data
->Data
!= NULL
);
46 if (Data
->Offset
+ sizeof (EFI_IFR_GUID_BANNER
) > Data
->BufferSize
) {
47 return EFI_BUFFER_TOO_SMALL
;
50 Banner
.Header
.OpCode
= EFI_IFR_GUID_OP
;
51 Banner
.Header
.Length
= sizeof (EFI_IFR_GUID_BANNER
);
52 Banner
.Header
.Scope
= 0;
53 CopyMem (&Banner
.Guid
, &mIfrVendorGuid
, sizeof (EFI_IFR_GUID
));
54 Banner
.ExtendOpCode
= EFI_IFR_EXTEND_OP_BANNER
;
56 Banner
.LineNumber
= LineNumber
;
57 Banner
.Alignment
= Alignment
;
59 LocalBuffer
= (UINT8
*) Data
->Data
+ Data
->Offset
;
60 CopyMem (LocalBuffer
, &Banner
, sizeof (EFI_IFR_GUID_BANNER
));
61 Data
->Offset
+= sizeof (EFI_IFR_GUID_BANNER
);