2007-12-10 00:01:55 +03:00
|
|
|
/*
|
2008-07-21 11:13:51 +04:00
|
|
|
* Copyright 2008, Dustin Howett, dustin.howett@gmail.com. All rights reserved.
|
2007-12-10 00:01:55 +03:00
|
|
|
* Copyright 2007, Michael Lotz, mmlr@mlotz.ch. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2008-07-21 11:13:51 +04:00
|
|
|
#ifndef _KERNEL_ARCH_x86_ARCH_ACPI_H
|
|
|
|
#define _KERNEL_ARCH_x86_ARCH_ACPI_H
|
2007-12-10 00:01:55 +03:00
|
|
|
|
|
|
|
#define ACPI_RSDP_SIGNATURE "RSD PTR "
|
|
|
|
#define ACPI_RSDT_SIGNATURE "RSDT"
|
|
|
|
#define ACPI_MADT_SIGNATURE "APIC"
|
|
|
|
|
2007-12-12 21:39:41 +03:00
|
|
|
#define ACPI_LOCAL_APIC_ENABLED 0x01
|
|
|
|
|
2008-07-21 11:13:51 +04:00
|
|
|
typedef struct acpi_rsdp {
|
2007-12-10 00:01:55 +03:00
|
|
|
char signature[8]; /* "RSD PTR " including blank */
|
|
|
|
uint8 checksum; /* checksum of bytes 0-19 (per ACPI 1.0) */
|
|
|
|
char oem_id[6]; /* not null terminated */
|
|
|
|
uint8 revision; /* 0 = ACPI 1.0, 2 = ACPI 3.0 */
|
|
|
|
uint32 rsdt_address; /* physical memory address of RSDT */
|
|
|
|
uint32 rsdt_length; /* length in bytes including header */
|
|
|
|
uint64 xsdt_address; /* 64bit physical memory address of XSDT */
|
|
|
|
uint8 extended_checksum; /* including entire table */
|
|
|
|
uint8 reserved[3];
|
2008-07-21 11:13:51 +04:00
|
|
|
} _PACKED acpi_rsdp;
|
2007-12-10 00:01:55 +03:00
|
|
|
|
2008-07-21 11:13:51 +04:00
|
|
|
typedef struct acpi_descriptor_header {
|
2007-12-10 00:01:55 +03:00
|
|
|
char signature[4]; /* table identifier as ASCII string */
|
|
|
|
uint32 length; /* length in bytes of the entire table */
|
|
|
|
uint8 revision;
|
|
|
|
uint8 checksum; /* checksum of entire table */
|
|
|
|
char oem_id[6]; /* not null terminated */
|
|
|
|
char oem_table_id[8]; /* oem supplied table identifier */
|
|
|
|
uint32 oem_revision; /* oem supplied revision number */
|
|
|
|
char creator_id[4]; /* creator / asl compiler id */
|
|
|
|
uint32 creator_revision; /* compiler revision */
|
2008-07-21 11:13:51 +04:00
|
|
|
} _PACKED acpi_descriptor_header;
|
2007-12-10 00:01:55 +03:00
|
|
|
|
2008-07-21 11:13:51 +04:00
|
|
|
typedef struct acpi_madt {
|
|
|
|
acpi_descriptor_header header; /* "APIC" signature */
|
2007-12-10 00:01:55 +03:00
|
|
|
uint32 local_apic_address; /* physical address for local CPUs APICs */
|
|
|
|
uint32 flags;
|
2008-07-21 11:13:51 +04:00
|
|
|
} _PACKED acpi_madt;
|
2007-12-10 00:01:55 +03:00
|
|
|
|
|
|
|
enum {
|
|
|
|
ACPI_MADT_LOCAL_APIC = 0,
|
|
|
|
ACPI_MADT_IO_APIC = 1
|
|
|
|
};
|
|
|
|
|
2008-07-21 11:13:51 +04:00
|
|
|
typedef struct acpi_apic {
|
2007-12-10 00:01:55 +03:00
|
|
|
uint8 type;
|
|
|
|
uint8 length;
|
2008-07-21 11:13:51 +04:00
|
|
|
} _PACKED acpi_apic;
|
2007-12-10 00:01:55 +03:00
|
|
|
|
2008-07-21 11:13:51 +04:00
|
|
|
typedef struct acpi_local_apic {
|
2007-12-10 00:01:55 +03:00
|
|
|
uint8 type; /* 0 = processor local APIC */
|
|
|
|
uint8 length; /* 8 bytes */
|
|
|
|
uint8 acpi_processor_id;
|
|
|
|
uint8 apic_id; /* the id of this APIC */
|
|
|
|
uint32 flags; /* 1 = enabled */
|
2008-07-21 11:13:51 +04:00
|
|
|
} _PACKED acpi_local_apic;
|
2007-12-10 00:01:55 +03:00
|
|
|
|
2008-07-21 11:13:51 +04:00
|
|
|
typedef struct acpi_io_apic {
|
2007-12-10 00:01:55 +03:00
|
|
|
uint8 type; /* 1 = I/O APIC */
|
|
|
|
uint8 length; /* 12 bytes */
|
|
|
|
uint8 io_apic_id; /* the id of this APIC */
|
|
|
|
uint8 reserved;
|
|
|
|
uint32 io_apic_address; /* phyisical address of I/O APIC */
|
|
|
|
uint32 interrupt_base; /* global system interrupt base */
|
2008-07-21 11:13:51 +04:00
|
|
|
} _PACKED acpi_io_apic;
|
2007-12-10 00:01:55 +03:00
|
|
|
|
2008-07-21 11:13:51 +04:00
|
|
|
#endif /* _KERNEL_ARCH_x86_ARCH_ACPI_H */
|