ACPIhalt: Add more ACPI opcodes.

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
This commit is contained in:
Valentin Dornauer 2014-09-21 18:58:14 +02:00 committed by Vladimir Serbinenko
parent 41c6f91fce
commit 0f1f95c7b7
3 changed files with 87 additions and 3 deletions

View file

@ -191,7 +191,8 @@ void grub_acpi_halt (void);
enum
{
GRUB_ACPI_OPCODE_ZERO = 0, GRUB_ACPI_OPCODE_ONE = 1,
GRUB_ACPI_OPCODE_NAME = 8, GRUB_ACPI_OPCODE_BYTE_CONST = 0x0a,
GRUB_ACPI_OPCODE_NAME = 8, GRUB_ACPI_OPCODE_ALIAS = 0x06,
GRUB_ACPI_OPCODE_BYTE_CONST = 0x0a,
GRUB_ACPI_OPCODE_WORD_CONST = 0x0b,
GRUB_ACPI_OPCODE_DWORD_CONST = 0x0c,
GRUB_ACPI_OPCODE_STRING_CONST = 0x0d,
@ -199,6 +200,22 @@ enum
GRUB_ACPI_OPCODE_BUFFER = 0x11,
GRUB_ACPI_OPCODE_PACKAGE = 0x12,
GRUB_ACPI_OPCODE_METHOD = 0x14, GRUB_ACPI_OPCODE_EXTOP = 0x5b,
GRUB_ACPI_OPCODE_ADD = 0x72,
GRUB_ACPI_OPCODE_CONCAT = 0x73,
GRUB_ACPI_OPCODE_SUBTRACT = 0x74,
GRUB_ACPI_OPCODE_MULTIPLY = 0x77,
GRUB_ACPI_OPCODE_DIVIDE = 0x78,
GRUB_ACPI_OPCODE_LSHIFT = 0x79,
GRUB_ACPI_OPCODE_RSHIFT = 0x7a,
GRUB_ACPI_OPCODE_AND = 0x7b,
GRUB_ACPI_OPCODE_NAND = 0x7c,
GRUB_ACPI_OPCODE_OR = 0x7d,
GRUB_ACPI_OPCODE_NOR = 0x7e,
GRUB_ACPI_OPCODE_XOR = 0x7f,
GRUB_ACPI_OPCODE_CONCATRES = 0x84,
GRUB_ACPI_OPCODE_MOD = 0x85,
GRUB_ACPI_OPCODE_INDEX = 0x88,
GRUB_ACPI_OPCODE_TOSTRING = 0x9c,
GRUB_ACPI_OPCODE_CREATE_WORD_FIELD = 0x8b,
GRUB_ACPI_OPCODE_CREATE_BYTE_FIELD = 0x8c,
GRUB_ACPI_OPCODE_IF = 0xa0, GRUB_ACPI_OPCODE_ONES = 0xff