public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Liming Gao" <liming.gao@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
	"pierre.gondois@arm.com" <pierre.gondois@arm.com>,
	"Feng, Bob C" <bob.c.feng@intel.com>, nd <nd@arm.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>,
	"Gao, Liming" <liming.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C files
Date: Wed, 13 Nov 2019 01:15:31 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E53EAD7@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <DB7PR08MB3113923009DEA896F68424CB8B770@DB7PR08MB3113.eurprd08.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 5143 bytes --]

Pierre:
  Order may not resolve the problem. Build tool needs to know their relationship, and generate the correct dependency between ASL and C source file.
  If there is no dependency between them in Makefile, Makefile multiple thread build (make -jn) may break it.

Thanks
Liming
From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of PierreGondois
Sent: Tuesday, November 12, 2019 9:34 PM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>; Gao, Liming <liming.gao@intel.com>; nd <nd@arm.com>
Cc: Sami Mujawar <Sami.Mujawar@arm.com>
Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C files

Hello Bob and Liming,
Do you think the solution suggested earlier could be acceptable? I refer to the solution below, i.e. having a new section in the ‘.inf’ files describing an extension build order.
E.g.:
  [SourceOrder]
    asl
    c
In this example, ‘.asl’ files would be built first, then ‘.c’ files, then any other files present in the modules. Among ‘.asl’ files, the order would be preserved. Same among ‘.c’ files.

If this solution suits you, we can begin to do a first implementation.

Regards,
Pierre

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> On Behalf Of Bob Feng via Groups.Io
Sent: 04 November 2019 07:50
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Pierre Gondois <Pierre.Gondois@arm.com<mailto:Pierre.Gondois@arm.com>>; Gao, Liming <liming.gao@intel.com<mailto:liming.gao@intel.com>>
Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C files

Hi Pierre,

How do you compile 'SsdtSerialPortTemplate.asl' with the '-tc' to the .HEX file? , based on the build_rule.txt, I think the .asl output file is a .aml file.

[Acpi-Source-Language-File]
    <InputFile>
        ?.asl, ?.Asl, ?.ASL

    <OutputFile>
        $(OUTPUT_DIR)(+)${s_dir}(+)${s_base}.aml

Thanks,
Bob

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> [mailto:devel@edk2.groups.io] On Behalf Of PierreGondois
Sent: Thursday, October 31, 2019 7:12 PM
To: Gao; Gao, Liming <liming.gao@intel.com<mailto:liming.gao@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: Re: [edk2-devel] [PATCH v1 1/1] BaseTools: Build ASL files before C files

Hello Liming,
Please find my answers marked [PIERRE] inline.

>> Can you give the whole solution for this usage model?
[Pierre]
We are planning to modify specific values in pre-compiled AML definition blocks at run-time, and then install these AML definition blocks as SSDT tables.
Instead of having multiple ASL describing the same kind of device (e.g.: a serial port), we would have one template describing this kind of device (e.g.: an ASL description of a serial port).
This template would be generic for the type of device it is describing, and compiled as one standalone AML definition block.
Platform specific values of this template would then be modified at run-time.

>> Does it mean C source file depends on ASL file?
[Pierre]
Yes. To do this, we need to embed these pre-compiled AML definition blocks. The .c file doing the fix-up needs to include this template. Thus this template needs to be compiled first.

The '.inf' file responsible of the fix-up looks like:
[SOURCES]
  SsdtSerialPortTemplate.asl
  SerialPortFixup.c

Compilation of 'SsdtSerialPortTemplate.asl' with the '-tc' option outputs a 'SsdtSerialPortTemplate.hex' file. '.hex' file's content looks like:
unsigned char ssdtserialtemplate_aml_code[] =
{
    0x53,0x53,0x44,0x54,0xC8,0x00,0x00,0x00,  /* 00000000    "SSDT...." */
    ...
}

The 'SerialPortFixup.c' includes the '.hex' file as shown below:
#include "SsdtSerialPortTemplate.hex"

>> This is related to the priority of source file type.
[Pierre]
Yes, the 'SsdtSerialPortTemplate.asl' needs to be compiled (so that the 'SsdtSerialPortTemplate.hex' is generated) prior to the compilation of 'SerialPortFixup.c'.

>> Now, there is no method to let user configure them. I suggest to introduce the generic way instead of the specific handle.
[Pierre]
I agree that we should have a generic way to configure the order in which the files should be compiled.
A new "SourceOrder" section could be introduced. This section would describe file extensions to compile first, and their order. Unreferenced file extensions would be compiled at the end, unordered.
e.g.:
  [SourceOrder]
    asl
    c

Here, '.asl' files would be compiled first, then '.c' files. '.asl' files would remain unordered in among all '.asl' files. '.c' files would remain unordered in among all '.c' files. Any remaining files in the "Sources" section would be compiled at the end, unordered.

Regards,
Pierre
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


[-- Attachment #2: Type: text/html, Size: 13546 bytes --]

  reply	other threads:[~2019-11-13  1:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 13:50 [PATCH v1 1/1] BaseTools: Build ASL files before C files PierreGondois
2019-10-30 13:52 ` [edk2-devel] " PierreGondois
2019-10-31  0:41 ` Liming Gao
2019-10-31 11:12   ` PierreGondois
2019-11-04  7:49     ` Bob Feng
2019-11-04 10:32       ` PierreGondois
2019-11-12 13:33       ` PierreGondois
2019-11-13  1:15         ` Liming Gao [this message]
2019-11-13  1:40         ` Bob Feng
2019-11-15 16:27           ` PierreGondois
2019-12-04 17:32             ` PierreGondois
2019-12-11 11:23               ` PierreGondois
2019-12-12  9:14                 ` Bob Feng
2019-12-16  0:33                   ` PierreGondois
2019-12-17 11:41                     ` Bob Feng
2019-12-18 10:43                       ` PierreGondois
2019-12-18 17:50 ` Ard Biesheuvel
2019-12-19 11:18   ` PierreGondois
2019-12-19 16:58     ` Ard Biesheuvel
2019-12-19 18:15       ` Sami Mujawar
2019-12-23 16:09         ` Ard Biesheuvel
2019-12-24 16:47           ` PierreGondois

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A89E2EF3DFEDB4C8BFDE51014F606A14E53EAD7@SHSMSX104.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox