Bug 1082 - iASL/Tools need big-endian support
Summary: iASL/Tools need big-endian support
Status: ASSIGNED
Alias: None
Product: ACPICA
Classification: Unclassified
Component: iASL Compiler (show other bugs)
Version: unspecified
Hardware: IA64 Any-All
: P1 normal
Assignee: Bob Moore
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-20 11:52 PDT by Marcel Apfelbaum
Modified: 2014-07-02 23:13 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel Apfelbaum 2014-03-20 11:52:48 PDT
The ACPI tables should be always in LE format.

The following should work:
1. Dump an ACPI table from a LE machine (cp  /sys/firmware/acpi/tables/... /tmp/)
2. Decompile it on a BE machine (iasl -d ...)

Actual:
Error [...] TableHeader length [0xBB040000] greater than the input file size [0x4BB].
As you can see the length bytes are swapped.

Happens in acpica-tools-20130823-5.fc19.ppc64, didn't check on newer versions.

Thanks,
Marcel
Comment 1 Bob Moore 2014-03-20 11:54:24 PDT
This may or may not be a simple fix.

If there is a patch available, please post it. Thanks.
Comment 2 Bob Moore 2014-03-25 13:31:14 PDT
The global issue is of course that ACPI tables are generally little-endian. The ACPICA core uses macros to implement "endian independence", and these could conceivably be deployed in iASL/disassembler also.
Comment 3 Marcel Apfelbaum 2014-03-25 13:44:21 PDT
(In reply to comment #2)
> The global issue is of course that ACPI tables are generally little-endian.
> The ACPICA core uses macros to implement "endian independence", and these
> could conceivably be deployed in iASL/disassembler also.

Hi Bob,
Thanks for the analysis.

Excuse my (lack of) knowledge, is it possible today to compile the upstream iASL/disassembler on a big endian machine?

Thanks,
Marcel
Comment 4 Bob Moore 2014-03-25 13:52:49 PDT
You may be able to compile it, but we now disallow execution at runtime:


    /*
     * Big-endian machines are not currently supported. ACPI tables must
     * be little-endian, and support for big-endian machines needs to
     * be implemented.
     */
    if (AcpiIsBigEndianMachine ())
    {
        fprintf (stderr,
            "iASL is not currently supported on big-endian machines.\n");
        return (-1);
    }

Until such time that full BE support is implemented.
Comment 5 Lv Zheng 2014-07-02 23:13:35 PDT
Hi, Marcel

Can you try this branch and report back issues:
https://github.com/zetalog/acpica/tree/acpica-endian
Or could you offer a remote accessible BE machine for us to test?

Thanks in advance.