From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web10.825.1572482482084372814 for ; Wed, 30 Oct 2019 17:41:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: liming.gao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Oct 2019 17:41:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,248,1569308400"; d="scan'208";a="194152186" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 30 Oct 2019 17:41:20 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 30 Oct 2019 17:41:20 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.439.0; Wed, 30 Oct 2019 17:41:20 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.127]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.213]) with mapi id 14.03.0439.000; Thu, 31 Oct 2019 08:41:18 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "pierre.gondois@arm.com" CC: "Feng, Bob C" , "Sami.Mujawar@arm.com" , "nd@arm.com" Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C files Thread-Topic: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C files Thread-Index: AQHVjykLkE2UHp5bFkeqh37PSCFlsqdz6Grw Date: Thu, 31 Oct 2019 00:41:17 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E53510B@SHSMSX104.ccr.corp.intel.com> References: <20191030135036.118952-1-pierre.gondois@arm.com> In-Reply-To: <20191030135036.118952-1-pierre.gondois@arm.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pierre: Can you give the whole solution for this usage model? Does it mean C sou= rce file depends on ASL file? This is related to the priority of source fil= e type. Now, there is no method to let user configure them. I suggest to in= troduce the generic way instead of the specific handle.=20 Thanks Liming >-----Original Message----- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >PierreGondois >Sent: Wednesday, October 30, 2019 9:51 PM >To: devel@edk2.groups.io >Cc: Pierre Gondois ; Feng, Bob C >; Gao, Liming ; >Sami.Mujawar@arm.com; nd@arm.com >Subject: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C = files > >From: Pierre Gondois > >The '-tc' option of the Intel iASL compiler facilitates >generation of AML code in a C array. This AML code is >output to a .hex file. The .hex file can be included >from a C source file, thereby allowing one to run a >fix-up code in C. > >For example, this technique can be used to patch the >resource data elements that describe the base address >or interrupt number for a device, before installing >the ACPI table. > >To implement this feature two conditions need to be >satisfied: > - The ASL and C files must be included in the sources > section of the same .inf file for the module. > - The ASL files are pre-processed and compiled before > the C files (so that the .hex file include dependency > is satisfied). > >This patch resolves the dependency by sorting the >CODA_TARGET list for the module being built and >placing the .aml files at the very beginning of >the list. > >Signed-off-by: Pierre Gondois >--- > >The changes can be seen at >https://github.com/PierreARM/edk2/commits/676_build_asl_first_v1 > >Notes: > v1: > - Sort .aml files first in the CODA_TARGET to build [Pierre] > them before other files. > > BaseTools/Source/Python/AutoGen/ModuleAutoGen.py | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >index >f0812b6887be6f9fbdb14003f2efff229633fb34..a59ed1d1952c23d0d3de83353a0 >566fb8a7dab77 100755 >--- a/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >+++ b/BaseTools/Source/Python/AutoGen/ModuleAutoGen.py >@@ -2,6 +2,7 @@ > # Create makefile for MS nmake and GNU make > # > # Copyright (c) 2019, Intel Corporation. All rights reserved.
>+# Copyright (c) 2019, ARM Limited. All rights reserved.
> # SPDX-License-Identifier: BSD-2-Clause-Patent > # > from __future__ import absolute_import >@@ -931,7 +932,14 @@ class ModuleAutoGen(AutoGen): > @cached_property > def CodaTargetList(self): > self.Targets >- return self._FinalBuildTargetList >+ >+ # To resolve dependencies on compiled ASL files (.aml files) in = modules, >+ # build them first by putting them as the first targets in the >+ # CodaTargetList. >+ OrderedList =3D list(self._FinalBuildTargetList) >+ OrderedList.sort(key=3Dlambda T: (T.Target.Ext.lower() !=3D '.am= l')) >+ >+ return OrderedList > > @cached_property > def FileTypes(self): >-- >'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)' > > > >