00001 /* 00002 * Copyright (C) 2005 Jakub Jermar 00003 * All rights reserved. 00004 * 00005 * Redistribution and use in source and binary forms, with or without 00006 * modification, are permitted provided that the following conditions 00007 * are met: 00008 * 00009 * - Redistributions of source code must retain the above copyright 00010 * notice, this list of conditions and the following disclaimer. 00011 * - Redistributions in binary form must reproduce the above copyright 00012 * notice, this list of conditions and the following disclaimer in the 00013 * documentation and/or other materials provided with the distribution. 00014 * - The name of the author may not be used to endorse or promote products 00015 * derived from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 00018 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 00019 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 00020 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 00021 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 00022 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 00023 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 00024 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00025 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00026 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00027 */ 00028 00035 #ifndef __ACPI_H__ 00036 #define __ACPI_H__ 00037 00038 #include <arch/types.h> 00039 00040 /* Root System Description Pointer */ 00041 struct acpi_rsdp { 00042 __u8 signature[8]; 00043 __u8 checksum; 00044 __u8 oemid[6]; 00045 __u8 revision; 00046 __u32 rsdt_address; 00047 __u32 length; 00048 __u64 xsdt_address; 00049 __u32 ext_checksum; 00050 __u8 reserved[3]; 00051 } __attribute__ ((packed)); 00052 00053 /* System Description Table Header */ 00054 struct acpi_sdt_header { 00055 __u8 signature[4]; 00056 __u32 length; 00057 __u8 revision; 00058 __u8 checksum; 00059 __u8 oemid[6]; 00060 __u8 oem_table_id[8]; 00061 __u32 oem_revision; 00062 __u32 creator_id; 00063 __u32 creator_revision; 00064 } __attribute__ ((packed));; 00065 00066 struct acpi_signature_map { 00067 __u8 *signature; 00068 struct acpi_sdt_header **sdt_ptr; 00069 char *description; 00070 }; 00071 00072 /* Root System Description Table */ 00073 struct acpi_rsdt { 00074 struct acpi_sdt_header header; 00075 __u32 entry[]; 00076 } __attribute__ ((packed));; 00077 00078 /* Extended System Description Table */ 00079 struct acpi_xsdt { 00080 struct acpi_sdt_header header; 00081 __u64 entry[]; 00082 } __attribute__ ((packed));; 00083 00084 extern struct acpi_rsdp *acpi_rsdp; 00085 extern struct acpi_rsdt *acpi_rsdt; 00086 extern struct acpi_xsdt *acpi_xsdt; 00087 00088 extern void acpi_init(void); 00089 extern int acpi_sdt_check(__u8 *sdt); 00090 00091 #endif /* __ACPI_H__ */ 00092