From nobody Mon Feb 9 19:30:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+61913+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61913+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1593612404; cv=none; d=zohomail.com; s=zohoarc; b=YOD3NDY0sl+ZVDnEkbmrIbYzxIH/sTEA92ZCTUhVhSTSW4VBf85IM0T0snYe2RhuqR2mCl8i4Hur9mkrT3zhIPgnCF+8PzliLzXblI8u+E4SDcHMguxgnk/uEJF57kqhZuDutej/WaOG8rzknvytFJ4dvHJO1YPo0V/lHdNmuyU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1593612404; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=eumCRckwvRQ+PGwgHKEiXZ/s7/Ejvj8PTwbD0PfayiM=; b=a3JV/XdimC3YEg8WyESvB0Vq2jUISSH93pMH1TF1PCb2OQWLevy50VQfayJ3hvJpUUdO5SCChgdu8SdTofNfZJIqxPLjGhyG5TPw8WxSkG4jEwWG9IKHhvV0C/7mYoFSyMlcTLkL7wuWNDjEveGyUFPWaCR7kamUwQ9R+IRm4kc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+61913+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1593612404423589.5266259912663; Wed, 1 Jul 2020 07:06:44 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iuFnYY1788612xLScNBwHLQr; Wed, 01 Jul 2020 07:06:43 -0700 X-Received: from cam-smtp0.cambridge.arm.com (cam-smtp0.cambridge.arm.com [217.140.106.54]) by mx.groups.io with SMTP id smtpd.web10.22631.1593612373210596368 for ; Wed, 01 Jul 2020 07:06:13 -0700 X-Received: from E119881.Arm.com (E119881.Arm.com [10.1.197.28]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id 061E69Zp029795; Wed, 1 Jul 2020 15:06:10 +0100 From: "PierreGondois" To: devel@edk2.groups.io Cc: Pierre Gondois , sami.mujawar@arm.com, tomas.pilar@arm.com, bob.c.feng@intel.com, liming.gao@intel.com, nd@arm.com Subject: [edk2-devel] [PATCH v5 3/5] BaseTools: Rename AmlToHex script to AmlToC Date: Wed, 1 Jul 2020 15:06:02 +0100 Message-Id: <20200701140604.5292-4-pierre.gondois@arm.com> In-Reply-To: <20200701140604.5292-1-pierre.gondois@arm.com> References: <20200701140604.5292-1-pierre.gondois@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pierre.gondois@arm.com X-Gm-Message-State: c0yCmeckx7xuKOyGXK0omXJEx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1593612403; bh=EKbPwf3f86DOcEtgD0PK9iXsellV5iMp0A9kPfKcfqU=; h=Cc:Date:From:Reply-To:Subject:To; b=f6qokH+GG5nXkwyYkwIRIPaED32Uk07r7ggk6kyM4Bd8G83WNKUNWMOZhQ0710OUvGU Kx8YpxrwcdUvkmUHAmJ/SkMy9IPAGn3DwbxmrOiTUwzhpKEi4GJHO3rotJ4YxaImsX727 cIonRoFRdYOP40XsErYVgZBccRds4iVUiaU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" From: Pierre Gondois The AmlToHex script and Posix/WindowsLike wrappers convert an AML file to a .hex file, containing a C array storing AML bytecode. This ".hex" file can then be included in a C file, allowing to access the AML bytecode from this C file. The EDK2 build system doesn't allow to a depict dependency orders between files of different languages. For instance, in a module containing a ".c" file and a ".asl", the ".c" file may or may not be built prior to the ".asl" file. This prevents any inclusion of a generated ".hex" in a ".c" file since this later ".hex" file may or may not have been created yet. This patch renames the script as AmlToC. It is posted as a separate patch to prevent git from seeing the renaming as a deletion plus addition of a new file. The ending line of the posix-like bin-wrapper script has also been corrected. This is a first step toward generating a C file containing the AML bytecode from an ASL file. This C file will then be handled by the EDK2 build system to generate an object file. Thus, no file inclusion will be required anymore. The C file requiring the AML bytecode as a C array, and the ASL file, will be compiled independently. The C array must be defined as an external symbol. The linker is resolving the reference to the C array symbol. To summarize, the flow goes as: -1. ASL file is compiled to AML; -2. AML file is copied to a ".amli" intermediate file; -3. EDK2 build system applies the rule relevant to ".amli" files. This is, calling the "AmlToC" script, generating a C file from the ".amli" file; -4. EDK2 build system applies the rule relevant to C files. This is creating an object file. -5. EDK2 build system links the object file containing the AML bytecode with the object file requiring it. Signed-off-by: Pierre Gondois Suggested-by: Tomas Pilar --- The changes can be seen at: https://github.com/PierreARM/edk2/commits/803_C= ompile_AML_bytecode_array_into_OBJ_file_v5 Notes: v1: - Rename AmlToHex scripts to AmlToC, and change line endings of the PosixLike bin-wrapper. [Pierre] v2: - No modification. [Pierre] v3: - Changed "Signed-off-by" to "Suggested-by". [Bob] v4: - No modification. Re-sending the patch with base64 encoding to conserve the right line endings. [Bob] v5: - No modification. [Pierre] BaseTools/BinWrappers/PosixLike/{AmlToHex =3D> AmlToC} | 28 = ++++++++++---------- BaseTools/BinWrappers/WindowsLike/{AmlToHex.bat =3D> AmlToC.bat} | 0 BaseTools/Source/Python/{AmlToHex/AmlToHex.py =3D> AmlToC/AmlToC.py} | 0 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/BaseTools/BinWrappers/PosixLike/AmlToHex b/BaseTools/BinWrappe= rs/PosixLike/AmlToC similarity index 97% rename from BaseTools/BinWrappers/PosixLike/AmlToHex rename to BaseTools/BinWrappers/PosixLike/AmlToC index 9fb68299e4c67d1f332cd883fd348a896f1bdc50..1dd28e966288f6ea4fc52d42e2d= c7b1f74226c23 100755 --- a/BaseTools/BinWrappers/PosixLike/AmlToHex +++ b/BaseTools/BinWrappers/PosixLike/AmlToC @@ -1,14 +1,14 @@ -#!/usr/bin/env bash -#python `dirname $0`/RunToolFromSource.py `basename $0` $* - -# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon -if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then - python_exe=3D${PYTHON_COMMAND} -fi - -full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here -dir=3D$(dirname "$full_cmd") -exe=3D$(basename "$full_cmd") - -export PYTHONPATH=3D"$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" -exec "${python_exe:-python}" "$dir/../../Source/Python/$exe/$exe.py" "$@" +#!/usr/bin/env bash +#python `dirname $0`/RunToolFromSource.py `basename $0` $* + +# If a ${PYTHON_COMMAND} command is available, use it in preference to pyt= hon +if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then + python_exe=3D${PYTHON_COMMAND} +fi + +full_cmd=3D${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028= for a discussion of why $0 is not a good choice here +dir=3D$(dirname "$full_cmd") +exe=3D$(basename "$full_cmd") + +export PYTHONPATH=3D"$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" +exec "${python_exe:-python}" "$dir/../../Source/Python/$exe/$exe.py" "$@" diff --git a/BaseTools/BinWrappers/WindowsLike/AmlToHex.bat b/BaseTools/Bin= Wrappers/WindowsLike/AmlToC.bat similarity index 100% rename from BaseTools/BinWrappers/WindowsLike/AmlToHex.bat rename to BaseTools/BinWrappers/WindowsLike/AmlToC.bat diff --git a/BaseTools/Source/Python/AmlToHex/AmlToHex.py b/BaseTools/Sourc= e/Python/AmlToC/AmlToC.py similarity index 100% rename from BaseTools/Source/Python/AmlToHex/AmlToHex.py rename to BaseTools/Source/Python/AmlToC/AmlToC.py --=20 'Guid(CE165669-3EF3-493F-B85D-6190EE5B9759)'