From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (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 A7AA521A04804 for ; Wed, 19 Apr 2017 20:32:47 -0700 (PDT) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Apr 2017 20:32:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,223,1488873600"; d="scan'208";a="89993692" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 19 Apr 2017 20:32:46 -0700 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 19 Apr 2017 20:32:46 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.319.2; Wed, 19 Apr 2017 20:32:46 -0700 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.117]) by SHSMSX104.ccr.corp.intel.com ([10.239.4.70]) with mapi id 14.03.0319.002; Thu, 20 Apr 2017 11:32:42 +0800 From: "Zhu, Yonghong" To: "Kinney, Michael D" , "edk2-devel@lists.01.org" CC: "Gao, Liming" , "Shaw, Kevin W" , "Zhu, Yonghong" Thread-Topic: [edk2-BuildSpecification PATCH] Add support for HII Image Packs Thread-Index: AQHSuVNUVQgmtQAVZU2ai4RDvZ4Nh6HMrduAgADs3mA= Date: Thu, 20 Apr 2017 03:32:41 +0000 Message-ID: References: <1492637061-14768-1-git-send-email-michael.d.kinney@intel.com> <1492637061-14768-2-git-send-email-michael.d.kinney@intel.com> In-Reply-To: <1492637061-14768-2-git-send-email-michael.d.kinney@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMTY5YmJmYmUtZTk0Yi00YmQxLWI1OTUtNzU5MWYzYjhkZjFjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IktkUXlcL3dQRTR4ZTV4ajlHekxlZDdrZ2t5M3pRdWloQWxnUFhPRXZiaWhBPSJ9 x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [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: , X-List-Received-Date: Thu, 20 Apr 2017 03:32:47 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yonghong Zhu =20 Best Regards, Zhu Yonghong -----Original Message----- From: Kinney, Michael D=20 Sent: Thursday, April 20, 2017 5:24 AM To: edk2-devel@lists.01.org Cc: Gao, Liming ; Zhu, Yonghong ; Shaw, Kevin W Subject: [edk2-BuildSpecification PATCH] Add support for HII Image Packs 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 --- .../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 th= e `.uni` file extension, in the INF file. =20 +* Determine if a module has specified Image definition file names,=20 +designated + 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 Unic= ode files must also be listed 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=20 +perform the following steps to convert the image information into an=20 +HII Image package data structure. + +* The build tools retrieve all the image IDs, the optional=20 +`TRANSPARENT` setting + and the associated image file name from the `.idf` files. The=20 +`TRANSPARENT` + setting is optional. If it is specified, build tools apply the=20 +`TRANS` image + block type to the input image file. The _UEFI Specification_ does not=20 +define + the `TRANS` block type for JPG or PNG images. The `TRANSPARENT`=20 +setting is + ignored for JPG and PNG images. The image file name should be listed=20 +in the + `[Sources]` section of the INF file, and the extension of the image=20 +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=20 +which + image IDs are used. Macros are generated in `AutoGen.h` for the image=20 +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`=20 +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=20 +build 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 c= ompatibility 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 m= odules, 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 fil= e as well as @@ -607,7 +698,7 @@ pseudo-code to references on to how a vari= able () 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 sp= ace 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 = = = |= | -- 2.6.3.windows.1