* 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>
This commit is contained in:
parent
21ed554bb0
commit
1782b135e5
6 changed files with 358 additions and 3 deletions
|
@ -53,6 +53,8 @@ struct grub_acpi_table_header
|
|||
grub_uint32_t creator_rev;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define GRUB_ACPI_FADT_SIGNATURE "FACP"
|
||||
|
||||
struct grub_acpi_fadt
|
||||
{
|
||||
struct grub_acpi_table_header hdr;
|
||||
|
@ -64,6 +66,77 @@ struct grub_acpi_fadt
|
|||
grub_uint8_t somefields2[96];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
#define GRUB_ACPI_MADT_SIGNATURE "APIC"
|
||||
|
||||
struct grub_acpi_madt_entry_header
|
||||
{
|
||||
grub_uint8_t type;
|
||||
grub_uint8_t len;
|
||||
};
|
||||
|
||||
struct grub_acpi_madt
|
||||
{
|
||||
struct grub_acpi_table_header hdr;
|
||||
grub_uint32_t lapic_addr;
|
||||
grub_uint32_t flags;
|
||||
struct grub_acpi_madt_entry_header entries[0];
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_ACPI_MADT_ENTRY_TYPE_INTERRUPT_OVERRIDE = 2,
|
||||
GRUB_ACPI_MADT_ENTRY_TYPE_SAPIC = 6,
|
||||
GRUB_ACPI_MADT_ENTRY_TYPE_LSAPIC = 7,
|
||||
GRUB_ACPI_MADT_ENTRY_TYPE_PLATFORM_INT_SOURCE = 8
|
||||
};
|
||||
|
||||
struct grub_acpi_madt_entry_interrupt_override
|
||||
{
|
||||
struct grub_acpi_madt_entry_header hdr;
|
||||
grub_uint8_t bus;
|
||||
grub_uint8_t source;
|
||||
grub_uint32_t global_sys_interrupt;
|
||||
grub_uint16_t flags;
|
||||
};
|
||||
|
||||
struct grub_acpi_madt_entry_sapic
|
||||
{
|
||||
struct grub_acpi_madt_entry_header hdr;
|
||||
grub_uint8_t id;
|
||||
grub_uint8_t pad;
|
||||
grub_uint32_t global_sys_interrupt_base;
|
||||
grub_uint64_t addr;
|
||||
};
|
||||
|
||||
struct grub_acpi_madt_entry_lsapic
|
||||
{
|
||||
struct grub_acpi_madt_entry_header hdr;
|
||||
grub_uint8_t cpu_id;
|
||||
grub_uint8_t id;
|
||||
grub_uint8_t eid;
|
||||
grub_uint8_t pad[3];
|
||||
grub_uint32_t flags;
|
||||
grub_uint32_t cpu_uid;
|
||||
grub_uint8_t cpu_uid_str[0];
|
||||
};
|
||||
|
||||
struct grub_acpi_madt_entry_platform_int_source
|
||||
{
|
||||
struct grub_acpi_madt_entry_header hdr;
|
||||
grub_uint16_t flags;
|
||||
grub_uint8_t inttype;
|
||||
grub_uint8_t cpu_id;
|
||||
grub_uint8_t cpu_eid;
|
||||
grub_uint8_t sapic_vector;
|
||||
grub_uint32_t global_sys_int;
|
||||
grub_uint32_t src_flags;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
GRUB_ACPI_MADT_ENTRY_SAPIC_FLAGS_ENABLED = 1
|
||||
};
|
||||
|
||||
struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void);
|
||||
struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void);
|
||||
struct grub_acpi_rsdp_v10 *grub_machine_acpi_get_rsdpv1 (void);
|
||||
|
|
|
@ -69,10 +69,14 @@ typedef long long grub_int64_t;
|
|||
typedef unsigned char grub_uint8_t;
|
||||
typedef unsigned short grub_uint16_t;
|
||||
typedef unsigned grub_uint32_t;
|
||||
# define PRIxGRUB_UINT32_T "x"
|
||||
# define PRIuGRUB_UINT32_T "u"
|
||||
#if GRUB_CPU_SIZEOF_LONG == 8
|
||||
typedef unsigned long grub_uint64_t;
|
||||
# define PRIxGRUB_UINT64_T "lx"
|
||||
#else
|
||||
typedef unsigned long long grub_uint64_t;
|
||||
# define PRIxGRUB_UINT64_T "llx"
|
||||
#endif
|
||||
|
||||
/* Misc types. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue