diff options
author | Stefan Reinauer <stepan@openbios.org> | 2004-01-28 16:56:14 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2004-01-28 16:56:14 +0000 |
commit | 688b385aec24157e2112d0efa06868b4f8dfb97c (patch) | |
tree | e14205a31ab7c68432735d01e6f722a31623c041 /src/arch/i386/include | |
parent | 22489894e189616bb5694cfed8bd951951e68fae (diff) |
please forgive me... ;)
* initial acpi support code
* fix header
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1358 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/arch/i386/include')
-rw-r--r-- | src/arch/i386/include/arch/acpi.h | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/src/arch/i386/include/arch/acpi.h b/src/arch/i386/include/arch/acpi.h new file mode 100644 index 0000000000..6b6965684c --- /dev/null +++ b/src/arch/i386/include/arch/acpi.h @@ -0,0 +1,92 @@ +/* + * Initial LinuxBIOS ACPI Support - headers and defines. + * + * written by Stefan Reinauer <stepan@openbios.org> + * (C) 2004 SUSE LINUX AG + * + * The ACPI table structs are based on the Linux kernel sources. + * + */ + + +#ifndef __ASM_ACPI_H +#define __ASM_ACPI_H + +#if HAVE_ACPI_TABLES==1 + +typedef unsigned char u8; +typedef unsigned short u16; +typedef unsigned int u32; +typedef unsigned long long u64; + +#define RSDP_NAME "RSDP" +#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */ + +/* ACPI 2.0 table RSDP */ + +typedef struct acpi_rsdp { + char signature[8]; + u8 checksum; + char oem_id[6]; + u8 revision; + u32 rsdt_address; + u32 length; + u64 xsdt_address; + u8 ext_checksum; + u8 reserved[3]; +} __attribute__((packed)) acpi_rsdp_t; + +/* Generic Address Container */ + +typedef struct acpi_gen_regaddr { + u8 space_id; + u8 bit_width; + u8 bit_offset; + u8 resv; + u32 addrl; + u32 addrh; +} __attribute__ ((packed)) acpi_addr_t; + +/* Generic ACPI Header, provided by (almost) all tables */ + +typedef struct acpi_table_header /* ACPI common table header */ +{ + char signature [4]; /* ACPI signature (4 ASCII characters) */\ + u32 length; /* Length of table, in bytes, including header */\ + u8 revision; /* ACPI Specification minor version # */\ + u8 checksum; /* To make sum of entire table == 0 */\ + char oem_id [6]; /* OEM identification */\ + char oem_table_id [8]; /* OEM table identification */\ + u32 oem_revision; /* OEM revision number */\ + char asl_compiler_id [4]; /* ASL compiler vendor ID */\ + u32 asl_compiler_revision; /* ASL compiler revision number */ +} __attribute__ ((packed)) acpi_header_t; + +/* RSDT */ + +typedef struct acpi_rsdt { + struct acpi_table_header header; + u32 entry[8]; +} __attribute__ ((packed)) acpi_rsdt_t; + +/* HPET TIMERS */ + +typedef struct acpi_hpet { + struct acpi_table_header header; + u32 id; + struct acpi_gen_regaddr addr; + u8 number; + u16 min_tick; + u8 attributes; +} __attribute__ ((packed)) acpi_hpet_t; + + +unsigned long write_acpi_tables(unsigned long addr); + +#else // HAVE_ACPI_TABLES + +#define write_acpi_tables(start) (start) + +#endif + +#endif |