From nobody Tue Apr 30 04:05:17 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1492637070936197.83543445026555; Wed, 19 Apr 2017 14:24:30 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DFF7721954084; Wed, 19 Apr 2017 14:24:26 -0700 (PDT) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 834A321A0483B for ; Wed, 19 Apr 2017 14:24:25 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP; 19 Apr 2017 14:24:25 -0700 Received: from mdkinney-mobl.amr.corp.intel.com ([10.241.98.51]) by FMSMGA003.fm.intel.com with ESMTP; 19 Apr 2017 14:24:24 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,222,1488873600"; d="scan'208";a="847772815" From: Michael Kinney To: edk2-devel@lists.01.org Date: Wed, 19 Apr 2017 14:24:21 -0700 Message-Id: <1492637061-14768-2-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 In-Reply-To: <1492637061-14768-1-git-send-email-michael.d.kinney@intel.com> References: <1492637061-14768-1-git-send-email-michael.d.kinney@intel.com> Subject: [edk2] [edk2-BuildSpecification PATCH] Add support for HII Image Packs X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin W Shaw , Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D476 Cc: Liming Gao Cc: Yonghong Zhu Cc: Kevin W Shaw Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Kinney Reviewed-by: Yonghong Zhu =20 --- .../82_auto-generation_process.md | 3 + .../83_auto-generated_code.md | 137 +++++++++++++++++= +--- README.md | 1 + 3 files changed, 122 insertions(+), 19 deletions(-) diff --git a/8_pre-build_autogen_stage/82_auto-generation_process.md b/8_pr= e-build_autogen_stage/82_auto-generation_process.md index b7c81ea..6868d62 100644 --- a/8_pre-build_autogen_stage/82_auto-generation_process.md +++ b/8_pre-build_autogen_stage/82_auto-generation_process.md @@ -1077,6 +1077,9 @@ permissible to set them here. * Determine if a module has specified Unicode file names, designated by the `.uni` file extension, in the INF file. =20 +* Determine if a module has specified Image definition file names, designa= ted + by the `.idf` file extension, in the INF file. + * Any Visual Forms Representation (.vfr) files found during the pre-proces= sing steps will be processed during the $(MAKE) stage. Refer to the "VFR Programming Language" document for additional details. diff --git a/8_pre-build_autogen_stage/83_auto-generated_code.md b/8_pre-bu= ild_autogen_stage/83_auto-generated_code.md index b3b911c..3738d92 100644 --- a/8_pre-build_autogen_stage/83_auto-generated_code.md +++ b/8_pre-build_autogen_stage/83_auto-generated_code.md @@ -53,6 +53,7 @@ processing rules for generating the Makefiles for the $(M= AKE) stage. | .i | IPF Assembly include files = | ASCII Text, DOS EOL | | .vfr | Visual Forms Representation files = | ASCII Text, DOS EOL | | .uni | HII Unicode string files = | UCS-2 Characters | +| .idf | HII Image Definition files = | ASCII Text, DOS EOL | | .asl | C formatted ACPI code files - these files are processed inde= pendent from the C code files | ASCII Text, DOS EOL | | .asi | ACPI Header Files = | ASCII Text, DOS EOL | | .aslc | C formatted ACPI table files - these files are processed ind= ependent from the C code files | ASCII Text, DOS EOL | @@ -278,7 +279,78 @@ these files are as follows. If one Unicode file uses a= `#include` statement to include other Unicode files, these secondary Unicode files must also be li= sted in the INF file's [Sources] section. =20 -### 8.3.5 AutoGen.h file +### 8.3.5 HII Image Pack + +The HII Image package data is stored in `.idf` files. The build tools perf= orm +the following steps to convert the image information into an HII Image pac= kage +data structure. + +* The build tools retrieve all the image IDs, the optional `TRANSPARENT` s= etting + and the associated image file name from the `.idf` files. The `TRANSPARE= NT` + setting is optional. If it is specified, build tools apply the `TRANS` i= mage + block type to the input image file. The _UEFI Specification_ does not de= fine + the `TRANS` block type for JPG or PNG images. The `TRANSPARENT` setting = is + ignored for JPG and PNG images. The image file name should be listed in = the + `[Sources]` section of the INF file, and the extension of the image file= must + be one of `.bmp`, `.jpg`, or `.png`. The extension is case insensitive. + +* Search all source files in the include path of the module to find out wh= ich + image IDs are used. Macros are generated in `AutoGen.h` for the image IDs + used. For example: + ```c + include_statement(AutoGen.h, " + // + //Image ID + // + #define IMG_FULL_LOGO 0x0001 + #define IMG_OEM_LOGO 0x0002 + "); + ``` + +* The HII Image package data is generated in `Idf.hpk` or = in + `AutoGen.c` in the form of a data array, with array name + `Images`. For example: + ```c + include_statement(AutoGen.c, " + // + //Image Pack Definition + // + unsigned char HelloWorldImages[] =3D { + // STRGATHER_OUTPUT_HEADER + 0xD9, 0xCA, 0x01, 0x00, + // Image PACKAGE HEADER + 0xD5, 0xCA, 0x01, 0x06, 0x0C, 0x00, 0x00, 0x00, 0x97, 0xC7, 0x01, 0x= 00, + // Image DATA + // 0x0001: IMG_FULL_LOGO: 0x0001 + 0x12, 0x01, 0x90, 0x01, 0xDC, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x= FF, 0xFF, + ... + ... + // 0x0002: IMG_OEM_LOGO: 0x0002 + 0x14, 0x02, 0x25, 0x01, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x= 00, 0x00, 0x00, + ... + ... + // End of the Image Info + 0x00, + // Palette Header + 0x03, 0x00, + // Palette Data + // 0x0001: IMG_FULL_LOGO: 0x0001 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x80, 0x= 80, 0x80, 0x00, 0x00, 0x80, + 0x00, 0x80, 0x80, 0x80, 0x00, 0x80, 0x80, 0x80, 0xC0, 0xC0, 0xC0, 0x= 00, 0x00, 0xFF, 0x00, 0xFF, + ... + ... + // 0x0002: IMG_OEM_LOGO: 0x0002 + 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x00, 0x00, 0x80, 0= x80, + ... + ... + }; + "); + ``` + +* If more than one image definition file is required by a module, the buil= d tools + combine the images from the multiple `.idf` files into a single HII Imag= e Pack. + +### 8.3.6 AutoGen.h file =20 The code generated in AutoGen.h includes: =20 @@ -289,10 +361,11 @@ The code generated in AutoGen.h includes: extern definitions * Global variable definitions and the database of PCDs used * Unicode string database definitions. +* Image package database definitions. =20 The file will contain: =20 -#### 8.3.5.1 Header prologue +#### 8.3.6.1 Header prologue =20 The macro name is composed with GUID value of INF file. =20 @@ -307,7 +380,7 @@ include_statement (AutoGen.h, " "); ``` =20 -#### 8.3.5.2 Global macro definitions +#### 8.3.6.2 Global macro definitions =20 If they are defined in INF file, un-defining them first is for backward compatibility with EDK module build, because these macros are not defined = in @@ -323,7 +396,7 @@ include_statement (AutoGen.h, " "); ``` =20 -#### 8.3.5.3 Header file inclusion. +#### 8.3.6.3 Header file inclusion. =20 Only one header file is included. =20 @@ -333,7 +406,7 @@ include_statement (AutoGen.h, " "); ``` =20 -#### 8.3.5.4 Caller ID GUID definition. +#### 8.3.6.4 Caller ID GUID definition. =20 The GUID value is the same as INF file GUID. The macro, `EFI_CALLER_ID_GUI= D`, is generated only for non - library module. @@ -348,12 +421,12 @@ include_statement (AutoGen.h, " "); ``` =20 -#### 8.3.5.5 PCD definitions +#### 8.3.6.5 PCD definitions =20 There are differences in the generated code for library and non-library modules, which are illustrated in pseudo-code below. =20 -##### 8.3.5.5.1 Non-library Module +##### 8.3.6.5.1 Non-library Module =20 ```c include_statement(AutoGen.h, " @@ -470,7 +543,7 @@ If (PCD_type =3D=3D DYNAMIC_EX) { } ``` =20 -##### 8.3.5.5.2 Library Module +##### 8.3.6.5.2 Library Module =20 ```c nclude_statement(AutoGen.h, " @@ -555,7 +628,7 @@ If (PCD_type =3D=3D DYNAMIC_EX) { } ``` =20 -##### 8.3.5.5.3 HII string pack definitions, +##### 8.3.6.5.3 HII string pack definitions, =20 These are generated only if `.uni` files are found. For details, please re= fer to section 7.3.2. @@ -580,7 +653,24 @@ include_statement (AutoGen.h, " "); ``` =20 -#### 8.3.5.6 AutoGen Epilogue +##### 8.3.6.5.4 HII image pack definitions + +These are generated only if `.idf` files are found. +``` +include_statement(AutoGen.h, " + // + //Image ID + // + #define IMG_FULL_LOGO 0x0001 + #define IMG_OEM_LOGO 0x0002 + + extern unsigned char HelloWorldImages[]; + + #define IMAGE_ARRAY_NAME HelloWorldImages +"); +``` + +#### 8.3.6.6 AutoGen Epilogue =20 ```c #ifdef __cplusplus @@ -590,7 +680,7 @@ include_statement (AutoGen.h, " #endif ``` =20 -### 8.3.6 AutoGen.c file +### 8.3.7 AutoGen.c file =20 The code generated in AutoGen.c includes: =20 @@ -600,6 +690,7 @@ The code generated in AutoGen.c includes: * Global variables for GUID/Protocol/PPIs value used, global variables and database for PCDs used * Unicode string pack definition. +* Image pack definition. =20 `AutoGen.c` file is only generated for EDK II non-library modules. The fol= lowing sections identify what lines of information are included in the file as we= ll as @@ -607,7 +698,7 @@ pseudo-code to references on to how a variable () might be generated. =20 The file will contain: =20 -#### 8.3.6.1 Header files inclusion. +#### 8.3.7.1 Header files inclusion. =20 Which files are included is determined by module type. =20 @@ -664,7 +755,7 @@ included. Where the `` is the value of the `BASE_NAME` from the module I= NF file's `[Defines]` section. =20 -#### 8.3.6.2 Caller ID GUID variable definition. +#### 8.3.7.2 Caller ID GUID variable definition. =20 Because not all GUID variables are required, a link-time optimization remo= ves items that are not referenced by other parts of the code to save on space = in @@ -677,7 +768,7 @@ include_statement (AutoGen.c, " "); ``` =20 -#### 8.3.6.3 Library Constructor Statements +#### 8.3.7.3 Library Constructor Statements =20 If there are `CONSTRUCTOR`s defined in `[Defines]` section in INF file of = the library instances that are being linked to. @@ -811,7 +902,7 @@ include_statement (AutoGen.c, " "); ``` =20 -####8.3.6.4 Library Destructor Statements +#### 8.3.7.4 Library Destructor Statements =20 Contained if there are `DESTRUCTOR`s defined in `[Defines]` section in INF= file of the library instances that are being linked to. @@ -939,7 +1030,7 @@ include_statement (AutoGen.c, " "); ``` =20 -#### 8.3.6.5 Module Entry Point Statements +#### 8.3.7.5 Module Entry Point Statements =20 Contained if there are `ENTRY_POINT`s defined `[Defines]` section in INF f= ile. =20 @@ -1247,7 +1338,7 @@ If (ENTRY_POINT defined in INF) { } ``` =20 -#### 8.3.6.6 Module Unload Image Statements +#### 8.3.7.6 Module Unload Image Statements =20 The following algorithm is used to process potential `UNLOAD_IMAGE` statem= ents that might be defined in the `[Defines]` section in the INF file. @@ -1332,10 +1423,10 @@ If (Number of UNLOAD_IMAGE in INF > 1) { } ``` =20 -#### 8.3.6.7 Global variables +#### 8.3.7.7 Global variables =20 These are generated from "Guids", "Protocols", "Ppis", "xxxPcd" sections o= f the -`.inf` file and `.uni` files. +`.inf` file and `.uni` and `.idf` files. =20 ```c InfList =3D []; @@ -1401,5 +1492,13 @@ foreach INF in InfList { } "); } + + If (.IDF file found in INF SourcesSection) { + include_statement (AutoGen.c, " + unsigned char HelloWorldImages[] =3D { + ...... + } + "); + } } ``` diff --git a/README.md b/README.md index 21bb782..4b524ce 100644 --- a/README.md +++ b/README.md @@ -206,3 +206,4 @@ Copyright (c) 2008-2017, Intel Corporation. All rights = reserved. | | [#483](https://bugzilla.tianocore.org/show_bug.cgi?id=3D483= ) Build Spec: add description for merge Pre-build and Post-build into build= process = = |= | | | [#490](https://bugzilla.tianocore.org/show_bug.cgi?id=3D490= ) Build Spec: specify the alignment requirements for VOID* PCDs stored in a= PCD section = = |= | | | [#479](https://bugzilla.tianocore.org/show_bug.cgi?id=3D479= ) Build spec: add description for nmake long command line handling = = = |= | +| | [#476](https://bugzilla.tianocore.org/show_bug.cgi?id=3D476= ) Build spec: add support for HII image package = = = |= | --=20 2.6.3.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel