More cleaning ...
[linux-2.6/linux-mips.git] / include / acpi / actbl.h
blobde509b9fd4ec68f88f2b2d08656c2febb0a9b299
1 /******************************************************************************
3 * Name: actbl.h - Table data structures defined in ACPI specification
5 *****************************************************************************/
7 /*
8 * Copyright (C) 2000 - 2003, R. Byron Moore
9 * All rights reserved.
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions, and the following disclaimer,
16 * without modification.
17 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 * substantially similar to the "NO WARRANTY" disclaimer below
19 * ("Disclaimer") and any redistribution must be conditioned upon
20 * including a substantially similar Disclaimer requirement for further
21 * binary redistribution.
22 * 3. Neither the names of the above-listed copyright holders nor the names
23 * of any contributors may be used to endorse or promote products derived
24 * from this software without specific prior written permission.
26 * Alternatively, this software may be distributed under the terms of the
27 * GNU General Public License ("GPL") version 2 as published by the Free
28 * Software Foundation.
30 * NO WARRANTY
31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 * POSSIBILITY OF SUCH DAMAGES.
44 #ifndef __ACTBL_H__
45 #define __ACTBL_H__
49 * Values for description table header signatures
51 #define RSDP_NAME "RSDP"
52 #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */
53 #define APIC_SIG "APIC" /* Multiple APIC Description Table */
54 #define DSDT_SIG "DSDT" /* Differentiated System Description Table */
55 #define FADT_SIG "FACP" /* Fixed ACPI Description Table */
56 #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */
57 #define PSDT_SIG "PSDT" /* Persistent System Description Table */
58 #define RSDT_SIG "RSDT" /* Root System Description Table */
59 #define XSDT_SIG "XSDT" /* Extended System Description Table */
60 #define SSDT_SIG "SSDT" /* Secondary System Description Table */
61 #define SBST_SIG "SBST" /* Smart Battery Specification Table */
62 #define SPIC_SIG "SPIC" /* IOSAPIC table */
63 #define BOOT_SIG "BOOT" /* Boot table */
66 #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
68 /* values of Mapic.Model */
70 #define DUAL_PIC 0
71 #define MULTIPLE_APIC 1
73 /* values of Type in struct apic_header */
75 #define APIC_PROC 0
76 #define APIC_IO 1
80 * Common table types. The base code can remain
81 * constant if the underlying tables are changed
83 #define RSDT_DESCRIPTOR struct rsdt_descriptor_rev2
84 #define XSDT_DESCRIPTOR struct xsdt_descriptor_rev2
85 #define FACS_DESCRIPTOR struct facs_descriptor_rev2
86 #define FADT_DESCRIPTOR struct fadt_descriptor_rev2
89 #pragma pack(1)
92 * Architecture-independent tables
93 * The architecture dependent tables are in separate files
95 struct rsdp_descriptor /* Root System Descriptor Pointer */
97 char signature [8]; /* ACPI signature, contains "RSD PTR " */
98 u8 checksum; /* To make sum of struct == 0 */
99 char oem_id [6]; /* OEM identification */
100 u8 revision; /* Must be 0 for 1.0, 2 for 2.0 */
101 u32 rsdt_physical_address; /* 32-bit physical address of RSDT */
102 u32 length; /* XSDT Length in bytes including hdr */
103 u64 xsdt_physical_address; /* 64-bit physical address of XSDT */
104 u8 extended_checksum; /* Checksum of entire table */
105 char reserved [3]; /* Reserved field must be 0 */
109 struct acpi_table_header /* ACPI common table header */
111 char signature [4]; /* ACPI signature (4 ASCII characters) */
112 u32 length; /* Length of table, in bytes, including header */
113 u8 revision; /* ACPI Specification minor version # */
114 u8 checksum; /* To make sum of entire table == 0 */
115 char oem_id [6]; /* OEM identification */
116 char oem_table_id [8]; /* OEM table identification */
117 u32 oem_revision; /* OEM revision number */
118 char asl_compiler_id [4]; /* ASL compiler vendor ID */
119 u32 asl_compiler_revision; /* ASL compiler revision number */
123 struct acpi_common_facs /* Common FACS for internal use */
125 u32 *global_lock;
126 u64 *firmware_waking_vector;
127 u8 vector_width;
131 struct apic_table
133 struct acpi_table_header header; /* ACPI table header */
134 u32 local_apic_address; /* Physical address for accessing local APICs */
135 u32 PCATcompat : 1; /* a one indicates system also has dual 8259s */
136 u32 reserved1 : 31;
140 struct apic_header
142 u8 type; /* APIC type. Either APIC_PROC or APIC_IO */
143 u8 length; /* Length of APIC structure */
147 struct processor_apic
149 struct apic_header header;
150 u8 processor_apic_id; /* ACPI processor id */
151 u8 local_apic_id; /* Processor's local APIC id */
152 u32 processor_enabled: 1; /* Processor is usable if set */
153 u32 reserved1 : 31;
157 struct io_apic
159 struct apic_header header;
160 u8 io_apic_id; /* I/O APIC ID */
161 u8 reserved; /* Reserved - must be zero */
162 u32 io_apic_address; /* APIC's physical address */
163 u32 vector; /* Interrupt vector index where INTI
164 * lines start */
169 * IA64 TBD: Add SAPIC Tables
173 * IA64 TBD: Modify Smart Battery Description to comply with ACPI IA64
174 * extensions.
176 struct smart_battery_description_table
178 struct acpi_table_header header;
179 u32 warning_level;
180 u32 low_level;
181 u32 critical_level;
184 struct hpet_description_table
186 struct acpi_table_header header;
187 u32 hardware_id;
188 u32 base_address[3];
189 u8 hpet_number;
190 u16 clock_tick;
191 u8 attributes;
193 #pragma pack()
197 * ACPI Table information. We save the table address, length,
198 * and type of memory allocation (mapped or allocated) for each
199 * table for 1) when we exit, and 2) if a new table is installed
201 #define ACPI_MEM_NOT_ALLOCATED 0
202 #define ACPI_MEM_ALLOCATED 1
203 #define ACPI_MEM_MAPPED 2
205 /* Definitions for the Flags bitfield member of struct acpi_table_support */
207 #define ACPI_TABLE_SINGLE 0x00
208 #define ACPI_TABLE_MULTIPLE 0x01
209 #define ACPI_TABLE_EXECUTABLE 0x02
211 #define ACPI_TABLE_ROOT 0x00
212 #define ACPI_TABLE_PRIMARY 0x10
213 #define ACPI_TABLE_SECONDARY 0x20
214 #define ACPI_TABLE_ALL 0x30
215 #define ACPI_TABLE_TYPE_MASK 0x30
217 /* Data about each known table type */
219 struct acpi_table_support
221 char *name;
222 char *signature;
223 void **global_ptr;
224 u8 sig_length;
225 u8 flags;
230 * Get the architecture-specific tables
232 #include "actbl1.h" /* Acpi 1.0 table definitions */
233 #include "actbl2.h" /* Acpi 2.0 table definitions */
235 #endif /* __ACTBL_H__ */