Commit graph

13 commits

Author SHA1 Message Date
Valentin Dornauer
0f1f95c7b7 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
2014-09-21 18:58:14 +02:00
Vladimir Serbinenko
7e47e27bd8 Add gcc_struct to all packed structures when compiling with mingw.
Just "packed" doesn't always pack the way we expect.
2013-12-15 14:14:30 +01:00
Vladimir 'phcoder' Serbinenko
ce7d92a9f2 Add new defines GRUB_RSDP_SIGNATURE_SIZE and GRUB_RSDP_SIGNATURE. 2013-04-05 10:56:43 +02:00
Colin Watson
33028f4c0b * grub-core/commands/acpihalt.c (skip_ext_op): Add support for
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.
2013-03-26 11:29:52 +01:00
Vladimir 'phcoder' Serbinenko
0d5b9c9031 Missing part of last commit 2013-02-01 21:48:01 +01:00
Vladimir 'phcoder' Serbinenko
463dcadca3 * include/grub/acpi.h (GRUB_ASCII_OPCODE): Add
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.
2012-02-22 16:02:03 +01:00
Vladimir 'phcoder' Serbinenko
e19b016b30 * grub-core/commands/acpihalt.c (skip_ext_op): Skip index field op.
* include/grub/acpi.h (GRUB_ACPI_EXTOPCODE_INDEX_FIELD_OP): New
	enum value.
2010-10-16 20:01:30 +02:00
Vladimir 'phcoder' Serbinenko
c32b51c9f9 Userspace ACPI parser debugging.
* 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.
2010-10-16 19:06:55 +02:00
Vladimir 'phcoder' Serbinenko
4df7996d87 Shutdown using ACPI.
* 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.
2010-09-11 17:59:14 +02:00
Tristan Gingold
1782b135e5 * commands/lsacpi.c: New file.
* grub-core/Makefile.core.def (lsacpi): New module.
	* include/grub/acpi.h (GRUB_ACPI_FADT_SIGNATURE): New definition.
	(GRUB_ACPI_MADT_SIGNATURE): Likewise.
	(grub_acpi_madt_entry_header): New struct.
	(grub_acpi_madt): Likewise.
	(grub_acpi_madt_entry_interrupt_override): Likewise.
	(grub_acpi_madt_entry_sapic): Likewise.
	(grub_acpi_madt_entry_lsapic): Likewise.
	(grub_acpi_madt_entry_platform_int_source): Likewise.
	* include/grub/types.h (PRIxGRUB_UINT32_T): New definition.
	(PRIuGRUB_UINT32_T): Likewise.
	(PRIxGRUB_UINT64_T): Likewise.

	Also-By: Robert Millan <rmh.grub@aybabtu.com>

	Also-By: Vladimir Serbinenko <phcoder@gmail.com>
2010-09-01 01:05:32 +02:00
Vladimir 'phcoder' Serbinenko
41cf1ca332 implement ACPI shutdown 2010-05-04 15:53:21 +02:00
fzielcke
b39f9d20a9 remove all trailing whitespace 2009-06-10 21:04:23 +00:00
phcoder
f8efe3ad2d 2009-05-02 Vladimir Serbinenko <phcoder@gmail.com>
ACPI spoofing

	* commands/acpi.c: new file
	* commands/i386/pc/acpi.c: likewise
	* commands/efi/acpi.c: likewise
	* include/grub/acpi.h: likewise
	* conf/i386-pc.rmk (pkglib_MODULES): added acpi.mod
	(acpi_mod_SOURCES): new variable
	(acpi_mod_CFLAGS): likewise
	(acpi_mod_LDFLAGS): likewise
	* conf/i386-efi.rmk: likewise
	* conf/x86_64-efi.rmk: likewise
2009-05-02 22:31:29 +00:00