The AML parser implements only a small subset of possible AML
opcodes. On the Fujitsu Lifebook E744 this and another bug in
the parser (incorrect handling of TermArg data types) would lead
to the laptop not turning off (_S5 not found).
* grub-core/commands/acpihalt.c: Support OpAlias in the AML parser;
in skip_ext_op(), handle some Type2Opcodes more correctly (TermArgs
aren't always simply strings!); Add function to skip TermArgs
* include/grub/acpi.h: Add new opcodes
skipping Event, Device, Processor, PowerRes, ThermalZone, and
BankField extended opcodes.
(get_sleep_type): Add minimal scope handling (just enough to
handle setting the scope to the root path).
(grub_acpi_halt): Parse any SSDTs as well as the DSDT.
* include/grub/acpi.h: Add enumeration values for Event, Device,
Processor, PowerRes, ThermalZone, and BankField extended opcodes.
GRUB_ACPI_OPCODE_STRING_CONST, GRUB_ACPI_OPCODE_BUFFER,
GRUB_ACPI_OPCODE_CREATE_WORD_FIELD
and GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD.
* grub-core/commands/acpihalt.c [GRUB_DSDT_TEST]: Replace include of
i18n with gettext no-op.
(skip_data_ref_object): Support GRUB_ACPI_OPCODE_BUFFER and
GRUB_ACPI_OPCODE_STRING_CONST.
(get_sleep_type): Support GRUB_ACPI_OPCODE_CREATE_WORD_FIELD and
GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD. Add handling of unknown opcodes.
* grub-core/commands/acpihalt.c [GRUB_DSDT_TEST]: Include userspace
headers and add relevant defines. Don't include standard headers.
(main) [GRUB_DSDT_TEST]: New function.
* include/grub/acpi.h [GRUB_DSDT_TEST]: Don't include standard headers.
Don't declare functions.
* grub-core/Makefile.core.def (halt): Add commands/acpihalt.c on i386-pc.
* grub-core/commands/acpihalt.c: New file.
* grub-core/commands/i386/pc/halt.c (grub_cmd_halt): Call grub_acpi_halt.
* include/grub/acpi.h (grub_acpi_fadt): New member pm1a.
(grub_acpi_halt): New proto.
(GRUB_ACPI_SLP_EN): New const.
(GRUB_ACPI_SLP_TYP_OFFSET): Likewise.
(GRUB_ACPI_OPCODE_*): New enum.
(GRUB_ACPI_EXTOPCODE_*): Likewise.