checkdirs() was being passed the wrong mount point, resulting in a panic
[dragonfly.git] / sys / contrib / dev / acpica-unix-20050309 / include / actbl.h
blobc480ccdc2d31d7fe49cb7818b804a621a2d44ca9
1 /******************************************************************************
3 * Name: actbl.h - Table data structures defined in ACPI specification
4 * $Revision: 68 $
6 *****************************************************************************/
8 /******************************************************************************
10 * 1. Copyright Notice
12 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
13 * All rights reserved.
15 * 2. License
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.
22 * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
23 * copy of the source code appearing in this file ("Covered Code") an
24 * irrevocable, perpetual, worldwide license under Intel's copyrights in the
25 * base code distributed originally by Intel ("Original Intel Code") to copy,
26 * make derivatives, distribute, use and display any portion of the Covered
27 * Code in any form, with the right to sublicense such rights; and
29 * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
30 * license (with the right to sublicense), under only those claims of Intel
31 * patents that are infringed by the Original Intel Code, to make, use, sell,
32 * offer to sell, and import the Covered Code and derivative works thereof
33 * solely to the minimum extent necessary to exercise the above copyright
34 * license, and in no event shall the patent license extend to any additions
35 * to or modifications of the Original Intel Code. No other license or right
36 * is granted directly or by implication, estoppel or otherwise;
38 * The above copyright and patent license is granted only if the following
39 * conditions are met:
41 * 3. Conditions
43 * 3.1. Redistribution of Source with Rights to Further Distribute Source.
44 * Redistribution of source code of any substantial portion of the Covered
45 * Code or modification with rights to further distribute source must include
46 * the above Copyright Notice, the above License, this list of Conditions,
47 * and the following Disclaimer and Export Compliance provision. In addition,
48 * Licensee must cause all Covered Code to which Licensee contributes to
49 * contain a file documenting the changes Licensee made to create that Covered
50 * Code and the date of any change. Licensee must include in that file the
51 * documentation of any changes made by any predecessor Licensee. Licensee
52 * must include a prominent statement that the modification is derived,
53 * directly or indirectly, from Original Intel Code.
55 * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
56 * Redistribution of source code of any substantial portion of the Covered
57 * Code or modification without rights to further distribute source must
58 * include the following Disclaimer and Export Compliance provision in the
59 * documentation and/or other materials provided with distribution. In
60 * addition, Licensee may not authorize further sublicense of source of any
61 * portion of the Covered Code, and must include terms to the effect that the
62 * license from Licensee to its licensee is limited to the intellectual
63 * property embodied in the software Licensee provides to its licensee, and
64 * not to intellectual property embodied in modifications its licensee may
65 * make.
67 * 3.3. Redistribution of Executable. Redistribution in executable form of any
68 * substantial portion of the Covered Code or modification must reproduce the
69 * above Copyright Notice, and the following Disclaimer and Export Compliance
70 * provision in the documentation and/or other materials provided with the
71 * distribution.
73 * 3.4. Intel retains all right, title, and interest in and to the Original
74 * Intel Code.
76 * 3.5. Neither the name Intel nor any other trademark owned or controlled by
77 * Intel shall be used in advertising or otherwise to promote the sale, use or
78 * other dealings in products derived from or relating to the Covered Code
79 * without prior written authorization from Intel.
81 * 4. Disclaimer and Export Compliance
83 * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
84 * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
85 * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
86 * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
87 * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
88 * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
89 * PARTICULAR PURPOSE.
91 * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
92 * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
93 * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
94 * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
95 * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
96 * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
97 * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
98 * LIMITED REMEDY.
100 * 4.3. Licensee shall not export, either directly or indirectly, any of this
101 * software or system incorporating such software without first obtaining any
102 * required license or other approval from the U. S. Department of Commerce or
103 * any other agency or department of the United States Government. In the
104 * event Licensee exports any such software from the United States or
105 * re-exports any such software from a foreign destination, Licensee shall
106 * ensure that the distribution and export/re-export of the software is in
107 * compliance with all laws, regulations, orders, or other restrictions of the
108 * U.S. Export Administration Regulations. Licensee agrees that neither it nor
109 * any of its subsidiaries will export/re-export any technical data, process,
110 * software, or service, directly or indirectly, to any country for which the
111 * United States government or any agency thereof requires an export license,
112 * other governmental approval, or letter of assurance, without first obtaining
113 * such license, approval or letter.
115 *****************************************************************************/
117 #ifndef __ACTBL_H__
118 #define __ACTBL_H__
122 * Values for description table header signatures
124 #define RSDP_NAME "RSDP"
125 #define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */
126 #define APIC_SIG "APIC" /* Multiple APIC Description Table */
127 #define DSDT_SIG "DSDT" /* Differentiated System Description Table */
128 #define FADT_SIG "FACP" /* Fixed ACPI Description Table */
129 #define FACS_SIG "FACS" /* Firmware ACPI Control Structure */
130 #define PSDT_SIG "PSDT" /* Persistent System Description Table */
131 #define RSDT_SIG "RSDT" /* Root System Description Table */
132 #define XSDT_SIG "XSDT" /* Extended System Description Table */
133 #define SSDT_SIG "SSDT" /* Secondary System Description Table */
134 #define SBST_SIG "SBST" /* Smart Battery Specification Table */
135 #define SPIC_SIG "SPIC" /* IOSAPIC table */
136 #define BOOT_SIG "BOOT" /* Boot table */
139 #define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
143 * Common table types. The base code can remain
144 * constant if the underlying tables are changed
146 #define RSDT_DESCRIPTOR RSDT_DESCRIPTOR_REV2
147 #define XSDT_DESCRIPTOR XSDT_DESCRIPTOR_REV2
148 #define FACS_DESCRIPTOR FACS_DESCRIPTOR_REV2
149 #define FADT_DESCRIPTOR FADT_DESCRIPTOR_REV2
152 #pragma pack(1)
155 * ACPI Version-independent tables
157 * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.)
158 * are in separate files.
160 typedef struct rsdp_descriptor /* Root System Descriptor Pointer */
162 char Signature [8]; /* ACPI signature, contains "RSD PTR " */
163 UINT8 Checksum; /* To make sum of struct == 0 */
164 char OemId [6]; /* OEM identification */
165 UINT8 Revision; /* Must be 0 for 1.0, 2 for 2.0 */
166 UINT32 RsdtPhysicalAddress; /* 32-bit physical address of RSDT */
167 UINT32 Length; /* XSDT Length in bytes including hdr */
168 UINT64 XsdtPhysicalAddress; /* 64-bit physical address of XSDT */
169 UINT8 ExtendedChecksum; /* Checksum of entire table */
170 char Reserved [3]; /* Reserved field must be 0 */
172 } RSDP_DESCRIPTOR;
175 typedef struct acpi_common_facs /* Common FACS for internal use */
177 UINT32 *GlobalLock;
178 UINT64 *FirmwareWakingVector;
179 UINT8 VectorWidth;
181 } ACPI_COMMON_FACS;
184 #define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \
185 char Signature [4]; /* ACPI signature (4 ASCII characters) */\
186 UINT32 Length; /* Length of table, in bytes, including header */\
187 UINT8 Revision; /* ACPI Specification minor version # */\
188 UINT8 Checksum; /* To make sum of entire table == 0 */\
189 char OemId [6]; /* OEM identification */\
190 char OemTableId [8]; /* OEM table identification */\
191 UINT32 OemRevision; /* OEM revision number */\
192 char AslCompilerId [4]; /* ASL compiler vendor ID */\
193 UINT32 AslCompilerRevision; /* ASL compiler revision number */
196 typedef struct acpi_table_header /* ACPI common table header */
198 ACPI_TABLE_HEADER_DEF
200 } ACPI_TABLE_HEADER;
204 * MADT values and structures
207 /* Values for MADT PCATCompat */
209 #define DUAL_PIC 0
210 #define MULTIPLE_APIC 1
213 /* Master MADT */
215 typedef struct multiple_apic_table
217 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
218 UINT32 LocalApicAddress; /* Physical address of local APIC */
219 UINT32_BIT PCATCompat : 1; /* A one indicates system also has dual 8259s */
220 UINT32_BIT Reserved1 : 31;
222 } MULTIPLE_APIC_TABLE;
225 /* Values for Type in APIC_HEADER_DEF */
227 #define APIC_PROCESSOR 0
228 #define APIC_IO 1
229 #define APIC_XRUPT_OVERRIDE 2
230 #define APIC_NMI 3
231 #define APIC_LOCAL_NMI 4
232 #define APIC_ADDRESS_OVERRIDE 5
233 #define APIC_IO_SAPIC 6
234 #define APIC_LOCAL_SAPIC 7
235 #define APIC_XRUPT_SOURCE 8
236 #define APIC_RESERVED 9 /* 9 and greater are reserved */
239 * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE)
241 #define APIC_HEADER_DEF /* Common APIC sub-structure header */\
242 UINT8 Type; \
243 UINT8 Length;
245 typedef struct apic_header
247 APIC_HEADER_DEF
249 } APIC_HEADER;
251 /* Values for MPS INTI flags */
253 #define POLARITY_CONFORMS 0
254 #define POLARITY_ACTIVE_HIGH 1
255 #define POLARITY_RESERVED 2
256 #define POLARITY_ACTIVE_LOW 3
258 #define TRIGGER_CONFORMS 0
259 #define TRIGGER_EDGE 1
260 #define TRIGGER_RESERVED 2
261 #define TRIGGER_LEVEL 3
263 /* Common flag definitions */
265 #define MPS_INTI_FLAGS \
266 UINT16_BIT Polarity : 2; /* Polarity of APIC I/O input signals */\
267 UINT16_BIT TriggerMode : 2; /* Trigger mode of APIC input signals */\
268 UINT16_BIT Reserved1 : 12; /* Reserved, must be zero */
270 #define LOCAL_APIC_FLAGS \
271 UINT32_BIT ProcessorEnabled: 1; /* Processor is usable if set */\
272 UINT32_BIT Reserved2 : 31; /* Reserved, must be zero */
274 /* Sub-structures for MADT */
276 typedef struct madt_processor_apic
278 APIC_HEADER_DEF
279 UINT8 ProcessorId; /* ACPI processor id */
280 UINT8 LocalApicId; /* Processor's local APIC id */
281 LOCAL_APIC_FLAGS
283 } MADT_PROCESSOR_APIC;
285 typedef struct madt_io_apic
287 APIC_HEADER_DEF
288 UINT8 IoApicId; /* I/O APIC ID */
289 UINT8 Reserved; /* Reserved - must be zero */
290 UINT32 Address; /* APIC physical address */
291 UINT32 Interrupt; /* Global system interrupt where INTI
292 * lines start */
293 } MADT_IO_APIC;
295 typedef struct madt_interrupt_override
297 APIC_HEADER_DEF
298 UINT8 Bus; /* 0 - ISA */
299 UINT8 Source; /* Interrupt source (IRQ) */
300 UINT32 Interrupt; /* Global system interrupt */
301 MPS_INTI_FLAGS
303 } MADT_INTERRUPT_OVERRIDE;
305 typedef struct madt_nmi_source
307 APIC_HEADER_DEF
308 MPS_INTI_FLAGS
309 UINT32 Interrupt; /* Global system interrupt */
311 } MADT_NMI_SOURCE;
313 typedef struct madt_local_apic_nmi
315 APIC_HEADER_DEF
316 UINT8 ProcessorId; /* ACPI processor id */
317 MPS_INTI_FLAGS
318 UINT8 Lint; /* LINTn to which NMI is connected */
320 } MADT_LOCAL_APIC_NMI;
322 typedef struct madt_address_override
324 APIC_HEADER_DEF
325 UINT16 Reserved; /* Reserved - must be zero */
326 UINT64 Address; /* APIC physical address */
328 } MADT_ADDRESS_OVERRIDE;
330 typedef struct madt_io_sapic
332 APIC_HEADER_DEF
333 UINT8 IoSapicId; /* I/O SAPIC ID */
334 UINT8 Reserved; /* Reserved - must be zero */
335 UINT32 InterruptBase; /* Glocal interrupt for SAPIC start */
336 UINT64 Address; /* SAPIC physical address */
338 } MADT_IO_SAPIC;
340 typedef struct madt_local_sapic
342 APIC_HEADER_DEF
343 UINT8 ProcessorId; /* ACPI processor id */
344 UINT8 LocalSapicId; /* SAPIC ID */
345 UINT8 LocalSapicEid; /* SAPIC EID */
346 UINT8 Reserved [3]; /* Reserved - must be zero */
347 LOCAL_APIC_FLAGS
348 UINT32 ProcessorUID; /* Numeric UID - ACPI 3.0 */
349 char ProcessorUIDString[1]; /* String UID - ACPI 3.0 */
351 } MADT_LOCAL_SAPIC;
353 typedef struct madt_interrupt_source
355 APIC_HEADER_DEF
356 MPS_INTI_FLAGS
357 UINT8 InterruptType; /* 1=PMI, 2=INIT, 3=corrected */
358 UINT8 ProcessorId; /* Processor ID */
359 UINT8 ProcessorEid; /* Processor EID */
360 UINT8 IoSapicVector; /* Vector value for PMI interrupts */
361 UINT32 Interrupt; /* Global system interrupt */
362 UINT32 Flags; /* Interrupt Source Flags */
364 } MADT_INTERRUPT_SOURCE;
368 * Smart Battery
370 typedef struct smart_battery_table
372 ACPI_TABLE_HEADER_DEF
373 UINT32 WarningLevel;
374 UINT32 LowLevel;
375 UINT32 CriticalLevel;
377 } SMART_BATTERY_TABLE;
380 #pragma pack()
384 * ACPI Table information. We save the table address, length,
385 * and type of memory allocation (mapped or allocated) for each
386 * table for 1) when we exit, and 2) if a new table is installed
388 #define ACPI_MEM_NOT_ALLOCATED 0
389 #define ACPI_MEM_ALLOCATED 1
390 #define ACPI_MEM_MAPPED 2
392 /* Definitions for the Flags bitfield member of ACPI_TABLE_SUPPORT */
394 #define ACPI_TABLE_SINGLE 0x00
395 #define ACPI_TABLE_MULTIPLE 0x01
396 #define ACPI_TABLE_EXECUTABLE 0x02
398 #define ACPI_TABLE_ROOT 0x00
399 #define ACPI_TABLE_PRIMARY 0x10
400 #define ACPI_TABLE_SECONDARY 0x20
401 #define ACPI_TABLE_ALL 0x30
402 #define ACPI_TABLE_TYPE_MASK 0x30
404 /* Data about each known table type */
406 typedef struct acpi_table_support
408 char *Name;
409 char *Signature;
410 void **GlobalPtr;
411 UINT8 SigLength;
412 UINT8 Flags;
414 } ACPI_TABLE_SUPPORT;
418 * Get the ACPI version-specific tables
420 #include "actbl1.h" /* Acpi 1.0 table definitions */
421 #include "actbl2.h" /* Acpi 2.0 table definitions */
424 #pragma pack(1)
426 * High performance timer
428 typedef struct hpet_table
430 ACPI_TABLE_HEADER_DEF
431 UINT32 HardwareId;
432 ACPI_GENERIC_ADDRESS BaseAddress;
433 UINT8 HpetNumber;
434 UINT16 ClockTick;
435 UINT8 Attributes;
437 } HPET_TABLE;
439 #pragma pack()
441 #endif /* __ACTBL_H__ */