audk/BaseTools/Source/Python
Pierre Gondois 0a4aa20e8d BaseTools: Compile AML bytecode arrays into .obj file
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 modifies the AmlToC script to generate a C file
instead of a ".hex" file.
It also adds the generation of an intermediate ".amli" file
when compiling an ASL file, and adds a rule to convert this
".amli" to a C file.

This allows to generate 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 <Pierre.Gondois@arm.com>
Suggested-by: Tomas Pilar <Tomas.Pilar@arm.com>

Reviewed-by: Bob Feng <bob.c.feng@intel.com>
2020-07-02 10:09:17 +00:00
..
AmlToC BaseTools: Compile AML bytecode arrays into .obj file 2020-07-02 10:09:17 +00:00
AutoGen BaseTools: Generate multiple rules when multiple output files 2020-07-02 10:09:17 +00:00
BPDG BaseTools: Fix various typos 2019-07-08 08:59:29 +08:00
Capsule BaseTools/Capsule: Add capsule dependency support 2020-01-15 03:16:46 +00:00
Common BaseTools: Fix parse PCD GUID expression issue 2020-05-13 06:37:18 +00:00
CommonDataClass BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Ecc BaseTools/Ecc: Replace deprecated function time.clock() 2020-05-13 05:52:03 +00:00
Eot BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
GenFds BaseTools:Fix GenFds issue for BuildOption replace GenFdsOption 2020-01-13 02:08:46 +00:00
GenPatchPcdTable BaseTools: Add map file parsing support for CLANG9 2019-11-08 08:29:36 +08:00
PatchPcdValue BaseTools: Decouple AutoGen Objects 2019-08-09 23:15:52 +08:00
Pkcs7Sign BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
Rsa2048Sha256Sign BaseTools:Updata the output encoding of the Popen function 2019-08-01 15:36:48 +08:00
Table BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
TargetTool BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Trim BaseTools: Warn user the file not found issue instead of break build. 2020-06-07 13:36:33 +00:00
UPT BaseTools: Fix various typos 2019-07-08 08:59:29 +08:00
Workspace BaseTools:fix issue for decode the stdout/stderr byte arrays 2020-03-24 02:27:27 +00:00
build BaseTools/build.py: Exit with 1 when AutoGen error occurred 2020-06-07 12:51:25 +00:00
GNUmakefile BaseTools: Replace BSD License with BSD+Patent License 2019-04-09 09:10:20 -07:00
Makefile BaseTools: strip trailing whitespace 2019-10-04 11:18:22 +01:00
basetool_tiano_python_path_env.yaml BaseTools: Add YAML files with path env and tool extdeps 2019-11-11 13:01:53 -08:00
sitecustomize.py BaseTools: Do not call sys.setdefaultencoding with python 3 2019-10-23 14:25:23 +08:00