aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-12-30 14:01:23 -0500
committerLen Brown <len.brown@intel.com>2008-12-31 01:15:40 -0500
commit50df4d8b0f6e1971b930f3158c9ee0e4263e636d (patch)
treebb2dbcf70009cab8af7011ec6f3cdfc1b9b7d14d /include
parentea7e96e0f2277107d9ea14c3f16c86ba82b2e560 (diff)
ACPICA: Restructure includes into public/private
acpi.h now includes only the "public" acpica headers. All other acpica headers are "private" and should not be included by acpica users. One new file, accommon.h is used to include the commonly used private headers for acpica code generation. Future plans are to move all private headers to a new subdirectory. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/acpi/accommon.h63
-rw-r--r--include/acpi/acconfig.h4
-rw-r--r--include/acpi/acexcep.h2
-rw-r--r--include/acpi/achware.h8
-rw-r--r--include/acpi/aclocal.h72
-rw-r--r--include/acpi/acmacros.h122
-rw-r--r--include/acpi/acoutput.h103
-rw-r--r--include/acpi/acpi.h31
-rw-r--r--include/acpi/acpixf.h58
-rw-r--r--include/acpi/acrestyp.h405
-rw-r--r--include/acpi/actbl.h25
-rw-r--r--include/acpi/actypes.h489
-rw-r--r--include/acpi/acutils.h36
-rw-r--r--include/acpi/platform/acenv.h12
14 files changed, 815 insertions, 615 deletions
diff --git a/include/acpi/accommon.h b/include/acpi/accommon.h
new file mode 100644
index 000000000000..3b20786cbb0d
--- /dev/null
+++ b/include/acpi/accommon.h
@@ -0,0 +1,63 @@
1/******************************************************************************
2 *
3 * Name: accommon.h - Common include files for generation of ACPICA source
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved.
10 *
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.
25 *
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.
29 *
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.
42 */
43
44#ifndef __ACCOMMON_H__
45#define __ACCOMMON_H__
46
47/*
48 * Common set of includes for all ACPICA source files.
49 * We put them here because we don't want to duplicate them
50 * in the the source code again and again.
51 *
52 * Note: The order of these include files is important.
53 */
54#include "acconfig.h" /* Global configuration constants */
55#include "acmacros.h" /* C macros */
56#include "aclocal.h" /* Internal data types */
57#include "acobject.h" /* ACPI internal object */
58#include "acstruct.h" /* Common structures */
59#include "acglobal.h" /* All global variables */
60#include "achware.h" /* Hardware defines and interfaces */
61#include "acutils.h" /* Utility interfaces */
62
63#endif /* __ACCOMMON_H__ */
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index c9a573eb2142..e6777fb883d2 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -61,10 +61,6 @@
61 * 61 *
62 */ 62 */
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */
65
66#define ACPI_CA_VERSION 0x20081031
67
68/* 64/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 65 * OS name, used for the _OS object. The _OS object is essentially obsolete,
70 * but there is a large base of ASL/AML code in existing machines that check 66 * but there is a large base of ASL/AML code in existing machines that check
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index a1ae1057d2ef..eda04546cdf6 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -176,6 +176,8 @@
176 176
177#define AE_CODE_CTRL_MAX 0x000D 177#define AE_CODE_CTRL_MAX 0x000D
178 178
179/* Exception strings for acpi_format_exception */
180
179#ifdef DEFINE_ACPI_GLOBALS 181#ifdef DEFINE_ACPI_GLOBALS
180 182
181/* 183/*
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index cd408103d268..58c69dc49ab4 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -44,11 +44,7 @@
44#ifndef __ACHWARE_H__ 44#ifndef __ACHWARE_H__
45#define __ACHWARE_H__ 45#define __ACHWARE_H__
46 46
47/* PM Timer ticks per second (HZ) */ 47/* Values for the _SST predefined method */
48
49#define PM_TIMER_FREQUENCY 3579545
50
51/* Values for the _SST reserved method */
52 48
53#define ACPI_SST_INDICATOR_OFF 0 49#define ACPI_SST_INDICATOR_OFF 0
54#define ACPI_SST_WORKING 1 50#define ACPI_SST_WORKING 1
@@ -56,8 +52,6 @@
56#define ACPI_SST_SLEEPING 3 52#define ACPI_SST_SLEEPING 3
57#define ACPI_SST_SLEEP_CONTEXT 4 53#define ACPI_SST_SLEEP_CONTEXT 4
58 54
59/* Prototypes */
60
61/* 55/*
62 * hwacpi - high level functions 56 * hwacpi - high level functions
63 */ 57 */
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index b43496080fdf..492d02761bb7 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -46,8 +46,6 @@
46 46
47/* acpisrc:struct_defs -- for acpisrc conversion */ 47/* acpisrc:struct_defs -- for acpisrc conversion */
48 48
49#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
50#define ACPI_DO_NOT_WAIT 0
51#define ACPI_SERIALIZED 0xFF 49#define ACPI_SERIALIZED 0xFF
52 50
53typedef u32 acpi_mutex_handle; 51typedef u32 acpi_mutex_handle;
@@ -120,11 +118,6 @@ static char *acpi_gbl_mutex_names[ACPI_NUM_MUTEX] = {
120#define ACPI_MAX_LOCK 1 118#define ACPI_MAX_LOCK 1
121#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1 119#define ACPI_NUM_LOCK ACPI_MAX_LOCK+1
122 120
123/* Owner IDs are used to track namespace nodes for selective deletion */
124
125typedef u8 acpi_owner_id;
126#define ACPI_OWNER_ID_MAX 0xFF
127
128/* This Thread ID means that the mutex is not in use (unlocked) */ 121/* This Thread ID means that the mutex is not in use (unlocked) */
129 122
130#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0 123#define ACPI_MUTEX_NOT_ACQUIRED (acpi_thread_id) 0
@@ -165,11 +158,6 @@ typedef enum {
165 ACPI_IMODE_EXECUTE = 0x03 158 ACPI_IMODE_EXECUTE = 0x03
166} acpi_interpreter_mode; 159} acpi_interpreter_mode;
167 160
168union acpi_name_union {
169 u32 integer;
170 char ascii[4];
171};
172
173/* 161/*
174 * The Namespace Node describes a named object that appears in the AML. 162 * The Namespace Node describes a named object that appears in the AML.
175 * descriptor_type is used to differentiate between internal descriptors. 163 * descriptor_type is used to differentiate between internal descriptors.
@@ -216,26 +204,6 @@ struct acpi_namespace_node {
216#define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */ 204#define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */
217#define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */ 205#define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */
218 206
219/*
220 * ACPI Table Descriptor. One per ACPI table
221 */
222struct acpi_table_desc {
223 acpi_physical_address address;
224 struct acpi_table_header *pointer;
225 u32 length; /* Length fixed at 32 bits */
226 union acpi_name_union signature;
227 acpi_owner_id owner_id;
228 u8 flags;
229};
230
231/* Flags for above */
232
233#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
234#define ACPI_TABLE_ORIGIN_MAPPED (1)
235#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
236#define ACPI_TABLE_ORIGIN_MASK (3)
237#define ACPI_TABLE_IS_LOADED (4)
238
239/* One internal RSDT for table management */ 207/* One internal RSDT for table management */
240 208
241struct acpi_internal_rsdt { 209struct acpi_internal_rsdt {
@@ -266,15 +234,6 @@ struct acpi_ns_search_data {
266 struct acpi_namespace_node *node; 234 struct acpi_namespace_node *node;
267}; 235};
268 236
269/*
270 * Predefined Namespace items
271 */
272struct acpi_predefined_names {
273 char *name;
274 u8 type;
275 char *val;
276};
277
278/* Object types used during package copies */ 237/* Object types used during package copies */
279 238
280#define ACPI_COPY_TYPE_SIMPLE 0 239#define ACPI_COPY_TYPE_SIMPLE 0
@@ -677,6 +636,12 @@ union acpi_parse_value {
677 union acpi_parse_object *arg; /* arguments and contained ops */ 636 union acpi_parse_object *arg; /* arguments and contained ops */
678}; 637};
679 638
639#ifdef ACPI_DISASSEMBLER
640#define ACPI_DISASM_ONLY_MEMBERS(a) a;
641#else
642#define ACPI_DISASM_ONLY_MEMBERS(a)
643#endif
644
680#define ACPI_PARSE_COMMON \ 645#define ACPI_PARSE_COMMON \
681 union acpi_parse_object *parent; /* Parent op */\ 646 union acpi_parse_object *parent; /* Parent op */\
682 u8 descriptor_type; /* To differentiate various internal objs */\ 647 u8 descriptor_type; /* To differentiate various internal objs */\
@@ -796,9 +761,6 @@ struct acpi_parse_state {
796 * 761 *
797 ****************************************************************************/ 762 ****************************************************************************/
798 763
799#define PCI_ROOT_HID_STRING "PNP0A03"
800#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
801
802struct acpi_bit_register_info { 764struct acpi_bit_register_info {
803 u8 parent_register; 765 u8 parent_register;
804 u8 bit_position; 766 u8 bit_position;
@@ -1025,26 +987,4 @@ struct acpi_debug_mem_block {
1025#define ACPI_MEM_LIST_MAX 1 987#define ACPI_MEM_LIST_MAX 1
1026#define ACPI_NUM_MEM_LISTS 2 988#define ACPI_NUM_MEM_LISTS 2
1027 989
1028struct acpi_memory_list {
1029 char *list_name;
1030 void *list_head;
1031 u16 object_size;
1032 u16 max_depth;
1033 u16 current_depth;
1034 u16 link_offset;
1035
1036#ifdef ACPI_DBG_TRACK_ALLOCATIONS
1037
1038 /* Statistics for debug memory tracking only */
1039
1040 u32 total_allocated;
1041 u32 total_freed;
1042 u32 max_occupied;
1043 u32 total_size;
1044 u32 current_total_size;
1045 u32 requests;
1046 u32 hits;
1047#endif
1048};
1049
1050#endif /* __ACLOCAL_H__ */ 990#endif /* __ACLOCAL_H__ */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index a597207e2835..c57286a3aceb 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -45,23 +45,6 @@
45#define __ACMACROS_H__ 45#define __ACMACROS_H__
46 46
47/* 47/*
48 * Data manipulation macros
49 */
50#define ACPI_LOWORD(l) ((u16)(u32)(l))
51#define ACPI_HIWORD(l) ((u16)((((u32)(l)) >> 16) & 0xFFFF))
52#define ACPI_LOBYTE(l) ((u8)(u16)(l))
53#define ACPI_HIBYTE(l) ((u8)((((u16)(l)) >> 8) & 0xFF))
54
55#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
56#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
57#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
58#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
59
60/* Size calculation */
61
62#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
63
64/*
65 * Extract data using a pointer. Any more than a byte and we 48 * Extract data using a pointer. Any more than a byte and we
66 * get into potential aligment issues -- see the STORE macros below. 49 * get into potential aligment issues -- see the STORE macros below.
67 * Use with care. 50 * Use with care.
@@ -76,39 +59,6 @@
76#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr) 59#define ACPI_SET64(ptr) *ACPI_CAST_PTR (u64, ptr)
77 60
78/* 61/*
79 * Pointer manipulation
80 */
81#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
82#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
83#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_size)(b)))
84#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8, (a)) - ACPI_CAST_PTR (u8, (b)))
85
86/* Pointer/Integer type conversions */
87
88#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL, (acpi_size) i)
89#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
90#define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
91#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
92#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
93
94#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
95#define ACPI_COMPARE_NAME(a, b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))
96#else
97#define ACPI_COMPARE_NAME(a, b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
98#endif
99
100/*
101 * Full 64-bit integer must be available on both 32-bit and 64-bit platforms
102 */
103struct acpi_integer_overlay {
104 u32 lo_dword;
105 u32 hi_dword;
106};
107
108#define ACPI_LODWORD(integer) (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->lo_dword)
109#define ACPI_HIDWORD(integer) (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->hi_dword)
110
111/*
112 * printf() format helpers 62 * printf() format helpers
113 */ 63 */
114 64
@@ -209,7 +159,7 @@ struct acpi_integer_overlay {
209/* 159/*
210 * The hardware does not support unaligned transfers. We must move the 160 * The hardware does not support unaligned transfers. We must move the
211 * data one byte at a time. These macros work whether the source or 161 * data one byte at a time. These macros work whether the source or
212 * the destination (or both) is/are unaligned. (Little-endian move) 162 * the destination (or both) is/are unaligned. (Little-endian move)
213 */ 163 */
214 164
215/* 16-bit source, 16/32/64 destination */ 165/* 16-bit source, 16/32/64 destination */
@@ -357,12 +307,6 @@ struct acpi_integer_overlay {
357 {(u32)(Pargs), (u32)(Iargs), (u32)(flags), obj_type, class, type} 307 {(u32)(Pargs), (u32)(Iargs), (u32)(flags), obj_type, class, type}
358#endif 308#endif
359 309
360#ifdef ACPI_DISASSEMBLER
361#define ACPI_DISASM_ONLY_MEMBERS(a) a;
362#else
363#define ACPI_DISASM_ONLY_MEMBERS(a)
364#endif
365
366#define ARG_TYPE_WIDTH 5 310#define ARG_TYPE_WIDTH 5
367#define ARG_1(x) ((u32)(x)) 311#define ARG_1(x) ((u32)(x))
368#define ARG_2(x) ((u32)(x) << (1 * ARG_TYPE_WIDTH)) 312#define ARG_2(x) ((u32)(x) << (1 * ARG_TYPE_WIDTH))
@@ -388,32 +332,16 @@ struct acpi_integer_overlay {
388#define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F)) 332#define GET_CURRENT_ARG_TYPE(list) (list & ((u32) 0x1F))
389#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH)) 333#define INCREMENT_ARG_LIST(list) (list >>= ((u32) ARG_TYPE_WIDTH))
390 334
391#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
392/*
393 * Module name is include in both debug and non-debug versions primarily for
394 * error messages. The __FILE__ macro is not very useful for this, because it
395 * often includes the entire pathname to the module
396 */
397#define ACPI_MODULE_NAME(name) static const char ACPI_UNUSED_VAR _acpi_module_name[] = name;
398#else
399#define ACPI_MODULE_NAME(name)
400#endif
401
402/* 335/*
403 * Ascii error messages can be configured out 336 * Ascii error messages can be configured out
404 */ 337 */
405#ifndef ACPI_NO_ERROR_MESSAGES 338#ifndef ACPI_NO_ERROR_MESSAGES
406#define AE_INFO _acpi_module_name, __LINE__
407 339
408/* 340/*
409 * Error reporting. Callers module and line number are inserted by AE_INFO, 341 * Error reporting. Callers module and line number are inserted by AE_INFO,
410 * the plist contains a set of parens to allow variable-length lists. 342 * the plist contains a set of parens to allow variable-length lists.
411 * These macros are used for both the debug and non-debug versions of the code. 343 * These macros are used for both the debug and non-debug versions of the code.
412 */ 344 */
413#define ACPI_INFO(plist) acpi_ut_info plist
414#define ACPI_WARNING(plist) acpi_ut_warning plist
415#define ACPI_EXCEPTION(plist) acpi_ut_exception plist
416#define ACPI_ERROR(plist) acpi_ut_error plist
417#define ACPI_ERROR_NAMESPACE(s, e) acpi_ns_report_error (AE_INFO, s, e); 345#define ACPI_ERROR_NAMESPACE(s, e) acpi_ns_report_error (AE_INFO, s, e);
418#define ACPI_ERROR_METHOD(s, n, p, e) acpi_ns_report_method_error (AE_INFO, s, n, p, e); 346#define ACPI_ERROR_METHOD(s, n, p, e) acpi_ns_report_method_error (AE_INFO, s, n, p, e);
419 347
@@ -421,13 +349,9 @@ struct acpi_integer_overlay {
421 349
422/* No error messages */ 350/* No error messages */
423 351
424#define ACPI_INFO(plist)
425#define ACPI_WARNING(plist)
426#define ACPI_EXCEPTION(plist)
427#define ACPI_ERROR(plist)
428#define ACPI_ERROR_NAMESPACE(s, e) 352#define ACPI_ERROR_NAMESPACE(s, e)
429#define ACPI_ERROR_METHOD(s, n, p, e) 353#define ACPI_ERROR_METHOD(s, n, p, e)
430#endif 354#endif /* ACPI_NO_ERROR_MESSAGES */
431 355
432/* 356/*
433 * Debug macros that are conditionally compiled 357 * Debug macros that are conditionally compiled
@@ -435,36 +359,8 @@ struct acpi_integer_overlay {
435#ifdef ACPI_DEBUG_OUTPUT 359#ifdef ACPI_DEBUG_OUTPUT
436 360
437/* 361/*
438 * Common parameters used for debug output functions:
439 * line number, function name, module(file) name, component ID
440 */
441#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
442
443/*
444 * Function entry tracing 362 * Function entry tracing
445 */ 363 */
446
447/*
448 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
449 * define it now. This is the case where there the compiler does not support
450 * a __func__ macro or equivalent.
451 */
452#ifndef ACPI_GET_FUNCTION_NAME
453#define ACPI_GET_FUNCTION_NAME _acpi_function_name
454/*
455 * The Name parameter should be the procedure name as a quoted string.
456 * The function name is also used by the function exit macros below.
457 * Note: (const char) is used to be compatible with the debug interfaces
458 * and macros such as __func__.
459 */
460#define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name;
461
462#else
463/* Compiler supports __func__ (or equivalent) -- Ignore this macro */
464
465#define ACPI_FUNCTION_NAME(name)
466#endif
467
468#ifdef CONFIG_ACPI_DEBUG_FUNC_TRACE 364#ifdef CONFIG_ACPI_DEBUG_FUNC_TRACE
469 365
470#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \ 366#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
@@ -584,15 +480,6 @@ struct acpi_integer_overlay {
584#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a) 480#define ACPI_DUMP_RESOURCE_LIST(a) acpi_rs_dump_resource_list(a)
585#define ACPI_DUMP_BUFFER(a, b) acpi_ut_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) 481#define ACPI_DUMP_BUFFER(a, b) acpi_ut_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
586 482
587/*
588 * Master debug print macros
589 * Print iff:
590 * 1) Debug print for the current component is enabled
591 * 2) Debug error level or trace level for the print statement is enabled
592 */
593#define ACPI_DEBUG_PRINT(plist) acpi_ut_debug_print plist
594#define ACPI_DEBUG_PRINT_RAW(plist) acpi_ut_debug_print_raw plist
595
596#else 483#else
597/* 484/*
598 * This is the non-debug case -- make everything go away, 485 * This is the non-debug case -- make everything go away,
@@ -603,7 +490,6 @@ struct acpi_integer_overlay {
603 490
604#define ACPI_DEBUG_DEFINE(a) do { } while(0) 491#define ACPI_DEBUG_DEFINE(a) do { } while(0)
605#define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while(0) 492#define ACPI_DEBUG_ONLY_MEMBERS(a) do { } while(0)
606#define ACPI_FUNCTION_NAME(a) do { } while(0)
607#define ACPI_FUNCTION_TRACE(a) do { } while(0) 493#define ACPI_FUNCTION_TRACE(a) do { } while(0)
608#define ACPI_FUNCTION_TRACE_PTR(a, b) do { } while(0) 494#define ACPI_FUNCTION_TRACE_PTR(a, b) do { } while(0)
609#define ACPI_FUNCTION_TRACE_U32(a, b) do { } while(0) 495#define ACPI_FUNCTION_TRACE_U32(a, b) do { } while(0)
@@ -619,8 +505,6 @@ struct acpi_integer_overlay {
619#define ACPI_DUMP_PATHNAME(a, b, c, d) do { } while(0) 505#define ACPI_DUMP_PATHNAME(a, b, c, d) do { } while(0)
620#define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0) 506#define ACPI_DUMP_RESOURCE_LIST(a) do { } while(0)
621#define ACPI_DUMP_BUFFER(a, b) do { } while(0) 507#define ACPI_DUMP_BUFFER(a, b) do { } while(0)
622#define ACPI_DEBUG_PRINT(pl) do { } while(0)
623#define ACPI_DEBUG_PRINT_RAW(pl) do { } while(0)
624 508
625#define return_VOID return 509#define return_VOID return
626#define return_ACPI_STATUS(s) return(s) 510#define return_ACPI_STATUS(s) return(s)
@@ -629,7 +513,7 @@ struct acpi_integer_overlay {
629#define return_UINT32(s) return(s) 513#define return_UINT32(s) return(s)
630#define return_PTR(s) return(s) 514#define return_PTR(s) return(s)
631 515
632#endif 516#endif /* ACPI_DEBUG_OUTPUT */
633 517
634/* 518/*
635 * Some code only gets executed when the debugger is built in. 519 * Some code only gets executed when the debugger is built in.
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index db8852d8bcf7..5c823d5ab783 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -45,9 +45,9 @@
45#define __ACOUTPUT_H__ 45#define __ACOUTPUT_H__
46 46
47/* 47/*
48 * Debug levels and component IDs. These are used to control the 48 * Debug levels and component IDs. These are used to control the
49 * granularity of the output of the DEBUG_PRINT macro -- on a per- 49 * granularity of the output of the ACPI_DEBUG_PRINT macro -- on a
50 * component basis and a per-exception-type basis. 50 * per-component basis and a per-exception-type basis.
51 */ 51 */
52 52
53/* Component IDs are used in the global "DebugLayer" */ 53/* Component IDs are used in the global "DebugLayer" */
@@ -69,8 +69,10 @@
69 69
70#define ACPI_COMPILER 0x00001000 70#define ACPI_COMPILER 0x00001000
71#define ACPI_TOOLS 0x00002000 71#define ACPI_TOOLS 0x00002000
72#define ACPI_EXAMPLE 0x00004000
73#define ACPI_DRIVER 0x00008000
72 74
73#define ACPI_ALL_COMPONENTS 0x00003FFF 75#define ACPI_ALL_COMPONENTS 0x0000FFFF
74#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) 76#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
75 77
76/* Component IDs reserved for ACPI drivers */ 78/* Component IDs reserved for ACPI drivers */
@@ -78,7 +80,7 @@
78#define ACPI_ALL_DRIVERS 0xFFFF0000 80#define ACPI_ALL_DRIVERS 0xFFFF0000
79 81
80/* 82/*
81 * Raw debug output levels, do not use these in the DEBUG_PRINT macros 83 * Raw debug output levels, do not use these in the ACPI_DEBUG_PRINT macros
82 */ 84 */
83#define ACPI_LV_INIT 0x00000001 85#define ACPI_LV_INIT 0x00000001
84#define ACPI_LV_DEBUG_OBJECT 0x00000002 86#define ACPI_LV_DEBUG_OBJECT 0x00000002
@@ -176,4 +178,95 @@
176#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT) 178#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT)
177#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL) 179#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
178 180
181#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
182/*
183 * Module name is included in both debug and non-debug versions primarily for
184 * error messages. The __FILE__ macro is not very useful for this, because it
185 * often includes the entire pathname to the module
186 */
187#define ACPI_MODULE_NAME(name) static const char ACPI_UNUSED_VAR _acpi_module_name[] = name;
188#else
189#define ACPI_MODULE_NAME(name)
190#endif
191
192/*
193 * Ascii error messages can be configured out
194 */
195#ifndef ACPI_NO_ERROR_MESSAGES
196#define AE_INFO _acpi_module_name, __LINE__
197
198/*
199 * Error reporting. Callers module and line number are inserted by AE_INFO,
200 * the plist contains a set of parens to allow variable-length lists.
201 * These macros are used for both the debug and non-debug versions of the code.
202 */
203#define ACPI_INFO(plist) acpi_info plist
204#define ACPI_WARNING(plist) acpi_warning plist
205#define ACPI_EXCEPTION(plist) acpi_exception plist
206#define ACPI_ERROR(plist) acpi_error plist
207
208#else
209
210/* No error messages */
211
212#define ACPI_INFO(plist)
213#define ACPI_WARNING(plist)
214#define ACPI_EXCEPTION(plist)
215#define ACPI_ERROR(plist)
216
217#endif /* ACPI_NO_ERROR_MESSAGES */
218
219/*
220 * Debug macros that are conditionally compiled
221 */
222#ifdef ACPI_DEBUG_OUTPUT
223
224/*
225 * If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
226 * define it now. This is the case where there the compiler does not support
227 * a __FUNCTION__ macro or equivalent.
228 */
229#ifndef ACPI_GET_FUNCTION_NAME
230#define ACPI_GET_FUNCTION_NAME _acpi_function_name
231
232/*
233 * The Name parameter should be the procedure name as a quoted string.
234 * The function name is also used by the function exit macros below.
235 * Note: (const char) is used to be compatible with the debug interfaces
236 * and macros such as __FUNCTION__.
237 */
238#define ACPI_FUNCTION_NAME(name) static const char _acpi_function_name[] = #name;
239
240#else
241/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
242
243#define ACPI_FUNCTION_NAME(name)
244#endif /* ACPI_GET_FUNCTION_NAME */
245
246/*
247 * Common parameters used for debug output functions:
248 * line number, function name, module(file) name, component ID
249 */
250#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT
251
252/*
253 * Master debug print macros
254 * Print message if and only if:
255 * 1) Debug print for the current component is enabled
256 * 2) Debug error level or trace level for the print statement is enabled
257 */
258#define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist
259#define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist
260
261#else
262/*
263 * This is the non-debug case -- make everything go away,
264 * leaving no executable debug code!
265 */
266#define ACPI_FUNCTION_NAME(a)
267#define ACPI_DEBUG_PRINT(pl)
268#define ACPI_DEBUG_PRINT_RAW(pl)
269
270#endif /* ACPI_DEBUG_OUTPUT */
271
179#endif /* __ACOUTPUT_H__ */ 272#endif /* __ACOUTPUT_H__ */
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index c515ef6cc89e..472b7bf0c5d4 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Name: acpi.h - Master include file, Publics and external data. 3 * Name: acpi.h - Master public include file used to interface to ACPICA
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -45,25 +45,22 @@
45#define __ACPI_H__ 45#define __ACPI_H__
46 46
47/* 47/*
48 * Common includes for all ACPI driver files 48 * Public include files for use by code that will interface to ACPICA.
49 * We put them here because we don't want to duplicate them 49 *
50 * in the rest of the source code again and again. 50 * Information includes the ACPICA data types, names, exceptions, and
51 * external interface prototypes. Also included are the definitions for
52 * all ACPI tables (FADT, MADT, etc.)
53 *
54 * Note: The order of these include files is important.
51 */ 55 */
52#include "acnames.h" /* Global ACPI names and strings */ 56#include "platform/acenv.h" /* Environment-specific items */
53#include "acconfig.h" /* Configuration constants */ 57#include "acnames.h" /* Common ACPI names and strings */
54#include "platform/acenv.h" /* Target environment specific items */ 58#include "actypes.h" /* ACPICA data types and structures */
55#include "actypes.h" /* Fundamental common data types */ 59#include "acexcep.h" /* ACPICA exceptions */
56#include "acexcep.h" /* ACPI exception codes */
57#include "acmacros.h" /* C macros */
58#include "actbl.h" /* ACPI table definitions */ 60#include "actbl.h" /* ACPI table definitions */
59#include "aclocal.h" /* Internal data types */
60#include "acoutput.h" /* Error output and Debug macros */ 61#include "acoutput.h" /* Error output and Debug macros */
61#include "acpiosxf.h" /* Interfaces to the ACPI-to-OS layer */ 62#include "acrestyp.h" /* Resource Descriptor structs */
63#include "acpiosxf.h" /* OSL interfaces (ACPICA-to-OS) */
62#include "acpixf.h" /* ACPI core subsystem external interfaces */ 64#include "acpixf.h" /* ACPI core subsystem external interfaces */
63#include "acobject.h" /* ACPI internal object */
64#include "acstruct.h" /* Common structures */
65#include "acglobal.h" /* All global variables */
66#include "achware.h" /* Hardware defines and interfaces */
67#include "acutils.h" /* Utility interfaces */
68 65
69#endif /* __ACPI_H__ */ 66#endif /* __ACPI_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index b3bceadf6f75..c751b514a834 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -45,12 +45,32 @@
45#ifndef __ACXFACE_H__ 45#ifndef __ACXFACE_H__
46#define __ACXFACE_H__ 46#define __ACXFACE_H__
47 47
48/* Current ACPICA subsystem version in YYYYMMDD format */
49
50#define ACPI_CA_VERSION 0x20081031
51
48#include "actypes.h" 52#include "actypes.h"
49#include "actbl.h" 53#include "actbl.h"
50 54
51extern u8 acpi_gbl_permanent_mmap; 55extern u8 acpi_gbl_permanent_mmap;
52 56
53/* 57/*
58 * Globals that are publically available, allowing for
59 * run time configuration
60 */
61extern u32 acpi_dbg_level;
62extern u32 acpi_dbg_layer;
63extern u8 acpi_gbl_enable_interpreter_slack;
64extern u8 acpi_gbl_all_methods_serialized;
65extern u8 acpi_gbl_create_osi_method;
66extern u8 acpi_gbl_leave_wake_gpes_disabled;
67extern acpi_name acpi_gbl_trace_method_name;
68extern u32 acpi_gbl_trace_flags;
69
70extern u32 acpi_current_gpe_count;
71extern struct acpi_table_fadt acpi_gbl_FADT;
72
73/*
54 * Global interfaces 74 * Global interfaces
55 */ 75 */
56acpi_status 76acpi_status
@@ -353,4 +373,42 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
353 373
354acpi_status acpi_leave_sleep_state(u8 sleep_state); 374acpi_status acpi_leave_sleep_state(u8 sleep_state);
355 375
376/*
377 * Debug output
378 */
379void ACPI_INTERNAL_VAR_XFACE
380acpi_error(const char *module_name,
381 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
382
383void ACPI_INTERNAL_VAR_XFACE
384acpi_exception(const char *module_name,
385 u32 line_number,
386 acpi_status status, const char *format, ...) ACPI_PRINTF_LIKE(4);
387
388void ACPI_INTERNAL_VAR_XFACE
389acpi_warning(const char *module_name,
390 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
391
392void ACPI_INTERNAL_VAR_XFACE
393acpi_info(const char *module_name,
394 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
395
396#ifdef ACPI_DEBUG_OUTPUT
397
398void ACPI_INTERNAL_VAR_XFACE
399acpi_debug_print(u32 requested_debug_level,
400 u32 line_number,
401 const char *function_name,
402 const char *module_name,
403 u32 component_id, const char *format, ...) ACPI_PRINTF_LIKE(6);
404
405void ACPI_INTERNAL_VAR_XFACE
406acpi_debug_print_raw(u32 requested_debug_level,
407 u32 line_number,
408 const char *function_name,
409 const char *module_name,
410 u32 component_id,
411 const char *format, ...) ACPI_PRINTF_LIKE(6);
412#endif
413
356#endif /* __ACXFACE_H__ */ 414#endif /* __ACXFACE_H__ */
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h
new file mode 100644
index 000000000000..9ffe00feada6
--- /dev/null
+++ b/include/acpi/acrestyp.h
@@ -0,0 +1,405 @@
1/******************************************************************************
2 *
3 * Name: acrestyp.h - Defines, types, and structures for resource descriptors
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved.
10 *
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.
25 *
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.
29 *
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.
42 */
43
44#ifndef __ACRESTYP_H__
45#define __ACRESTYP_H__
46
47/*
48 * Definitions for Resource Attributes
49 */
50typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */
51typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */
52
53/*
54 * Memory Attributes
55 */
56#define ACPI_READ_ONLY_MEMORY (u8) 0x00
57#define ACPI_READ_WRITE_MEMORY (u8) 0x01
58
59#define ACPI_NON_CACHEABLE_MEMORY (u8) 0x00
60#define ACPI_CACHABLE_MEMORY (u8) 0x01
61#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02
62#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03
63
64/*
65 * IO Attributes
66 * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh.
67 * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh.
68 */
69#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01
70#define ACPI_ISA_ONLY_RANGES (u8) 0x02
71#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
72
73/* Type of translation - 1=Sparse, 0=Dense */
74
75#define ACPI_SPARSE_TRANSLATION (u8) 0x01
76
77/*
78 * IO Port Descriptor Decode
79 */
80#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */
81#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */
82
83/*
84 * IRQ Attributes
85 */
86#define ACPI_LEVEL_SENSITIVE (u8) 0x00
87#define ACPI_EDGE_SENSITIVE (u8) 0x01
88
89#define ACPI_ACTIVE_HIGH (u8) 0x00
90#define ACPI_ACTIVE_LOW (u8) 0x01
91
92#define ACPI_EXCLUSIVE (u8) 0x00
93#define ACPI_SHARED (u8) 0x01
94
95/*
96 * DMA Attributes
97 */
98#define ACPI_COMPATIBILITY (u8) 0x00
99#define ACPI_TYPE_A (u8) 0x01
100#define ACPI_TYPE_B (u8) 0x02
101#define ACPI_TYPE_F (u8) 0x03
102
103#define ACPI_NOT_BUS_MASTER (u8) 0x00
104#define ACPI_BUS_MASTER (u8) 0x01
105
106#define ACPI_TRANSFER_8 (u8) 0x00
107#define ACPI_TRANSFER_8_16 (u8) 0x01
108#define ACPI_TRANSFER_16 (u8) 0x02
109
110/*
111 * Start Dependent Functions Priority definitions
112 */
113#define ACPI_GOOD_CONFIGURATION (u8) 0x00
114#define ACPI_ACCEPTABLE_CONFIGURATION (u8) 0x01
115#define ACPI_SUB_OPTIMAL_CONFIGURATION (u8) 0x02
116
117/*
118 * 16, 32 and 64-bit Address Descriptor resource types
119 */
120#define ACPI_MEMORY_RANGE (u8) 0x00
121#define ACPI_IO_RANGE (u8) 0x01
122#define ACPI_BUS_NUMBER_RANGE (u8) 0x02
123
124#define ACPI_ADDRESS_NOT_FIXED (u8) 0x00
125#define ACPI_ADDRESS_FIXED (u8) 0x01
126
127#define ACPI_POS_DECODE (u8) 0x00
128#define ACPI_SUB_DECODE (u8) 0x01
129
130#define ACPI_PRODUCER (u8) 0x00
131#define ACPI_CONSUMER (u8) 0x01
132
133/*
134 * If possible, pack the following structures to byte alignment
135 */
136#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
137#pragma pack(1)
138#endif
139
140/* UUID data structures for use in vendor-defined resource descriptors */
141
142struct acpi_uuid {
143 u8 data[ACPI_UUID_LENGTH];
144};
145
146struct acpi_vendor_uuid {
147 u8 subtype;
148 u8 data[ACPI_UUID_LENGTH];
149};
150
151/*
152 * Structures used to describe device resources
153 */
154struct acpi_resource_irq {
155 u8 descriptor_length;
156 u8 triggering;
157 u8 polarity;
158 u8 sharable;
159 u8 interrupt_count;
160 u8 interrupts[1];
161};
162
163struct acpi_resource_dma {
164 u8 type;
165 u8 bus_master;
166 u8 transfer;
167 u8 channel_count;
168 u8 channels[1];
169};
170
171struct acpi_resource_start_dependent {
172 u8 descriptor_length;
173 u8 compatibility_priority;
174 u8 performance_robustness;
175};
176
177/*
178 * The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
179 * needed because it has no fields
180 */
181
182struct acpi_resource_io {
183 u8 io_decode;
184 u8 alignment;
185 u8 address_length;
186 u16 minimum;
187 u16 maximum;
188};
189
190struct acpi_resource_fixed_io {
191 u16 address;
192 u8 address_length;
193};
194
195struct acpi_resource_vendor {
196 u16 byte_length;
197 u8 byte_data[1];
198};
199
200/* Vendor resource with UUID info (introduced in ACPI 3.0) */
201
202struct acpi_resource_vendor_typed {
203 u16 byte_length;
204 u8 uuid_subtype;
205 u8 uuid[ACPI_UUID_LENGTH];
206 u8 byte_data[1];
207};
208
209struct acpi_resource_end_tag {
210 u8 checksum;
211};
212
213struct acpi_resource_memory24 {
214 u8 write_protect;
215 u16 minimum;
216 u16 maximum;
217 u16 alignment;
218 u16 address_length;
219};
220
221struct acpi_resource_memory32 {
222 u8 write_protect;
223 u32 minimum;
224 u32 maximum;
225 u32 alignment;
226 u32 address_length;
227};
228
229struct acpi_resource_fixed_memory32 {
230 u8 write_protect;
231 u32 address;
232 u32 address_length;
233};
234
235struct acpi_memory_attribute {
236 u8 write_protect;
237 u8 caching;
238 u8 range_type;
239 u8 translation;
240};
241
242struct acpi_io_attribute {
243 u8 range_type;
244 u8 translation;
245 u8 translation_type;
246 u8 reserved1;
247};
248
249union acpi_resource_attribute {
250 struct acpi_memory_attribute mem;
251 struct acpi_io_attribute io;
252
253 /* Used for the *word_space macros */
254
255 u8 type_specific;
256};
257
258struct acpi_resource_source {
259 u8 index;
260 u16 string_length;
261 char *string_ptr;
262};
263
264/* Fields common to all address descriptors, 16/32/64 bit */
265
266#define ACPI_RESOURCE_ADDRESS_COMMON \
267 u8 resource_type; \
268 u8 producer_consumer; \
269 u8 decode; \
270 u8 min_address_fixed; \
271 u8 max_address_fixed; \
272 union acpi_resource_attribute info;
273
274struct acpi_resource_address {
275ACPI_RESOURCE_ADDRESS_COMMON};
276
277struct acpi_resource_address16 {
278 ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
279 u16 minimum;
280 u16 maximum;
281 u16 translation_offset;
282 u16 address_length;
283 struct acpi_resource_source resource_source;
284};
285
286struct acpi_resource_address32 {
287 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
288 u32 minimum;
289 u32 maximum;
290 u32 translation_offset;
291 u32 address_length;
292 struct acpi_resource_source resource_source;
293};
294
295struct acpi_resource_address64 {
296 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
297 u64 minimum;
298 u64 maximum;
299 u64 translation_offset;
300 u64 address_length;
301 struct acpi_resource_source resource_source;
302};
303
304struct acpi_resource_extended_address64 {
305 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
306 u64 granularity;
307 u64 minimum;
308 u64 maximum;
309 u64 translation_offset;
310 u64 address_length;
311 u64 type_specific;
312};
313
314struct acpi_resource_extended_irq {
315 u8 producer_consumer;
316 u8 triggering;
317 u8 polarity;
318 u8 sharable;
319 u8 interrupt_count;
320 struct acpi_resource_source resource_source;
321 u32 interrupts[1];
322};
323
324struct acpi_resource_generic_register {
325 u8 space_id;
326 u8 bit_width;
327 u8 bit_offset;
328 u8 access_size;
329 u64 address;
330};
331
332/* ACPI_RESOURCE_TYPEs */
333
334#define ACPI_RESOURCE_TYPE_IRQ 0
335#define ACPI_RESOURCE_TYPE_DMA 1
336#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
337#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
338#define ACPI_RESOURCE_TYPE_IO 4
339#define ACPI_RESOURCE_TYPE_FIXED_IO 5
340#define ACPI_RESOURCE_TYPE_VENDOR 6
341#define ACPI_RESOURCE_TYPE_END_TAG 7
342#define ACPI_RESOURCE_TYPE_MEMORY24 8
343#define ACPI_RESOURCE_TYPE_MEMORY32 9
344#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
345#define ACPI_RESOURCE_TYPE_ADDRESS16 11
346#define ACPI_RESOURCE_TYPE_ADDRESS32 12
347#define ACPI_RESOURCE_TYPE_ADDRESS64 13
348#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
349#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
350#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
351#define ACPI_RESOURCE_TYPE_MAX 16
352
353/* Master union for resource descriptors */
354
355union acpi_resource_data {
356 struct acpi_resource_irq irq;
357 struct acpi_resource_dma dma;
358 struct acpi_resource_start_dependent start_dpf;
359 struct acpi_resource_io io;
360 struct acpi_resource_fixed_io fixed_io;
361 struct acpi_resource_vendor vendor;
362 struct acpi_resource_vendor_typed vendor_typed;
363 struct acpi_resource_end_tag end_tag;
364 struct acpi_resource_memory24 memory24;
365 struct acpi_resource_memory32 memory32;
366 struct acpi_resource_fixed_memory32 fixed_memory32;
367 struct acpi_resource_address16 address16;
368 struct acpi_resource_address32 address32;
369 struct acpi_resource_address64 address64;
370 struct acpi_resource_extended_address64 ext_address64;
371 struct acpi_resource_extended_irq extended_irq;
372 struct acpi_resource_generic_register generic_reg;
373
374 /* Common fields */
375
376 struct acpi_resource_address address; /* Common 16/32/64 address fields */
377};
378
379/* Common resource header */
380
381struct acpi_resource {
382 u32 type;
383 u32 length;
384 union acpi_resource_data data;
385};
386
387/* restore default alignment */
388
389#pragma pack()
390
391#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
392#define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
393#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
394
395#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
396
397struct acpi_pci_routing_table {
398 u32 length;
399 u32 pin;
400 acpi_integer address; /* here for 64-bit alignment */
401 u32 source_index;
402 char source[4]; /* pad to 64 bits so sizeof() works in all cases */
403};
404
405#endif /* __ACRESTYP_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 13a3d9ad92db..813e4b6c2c0d 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -288,6 +288,31 @@ enum acpi_prefered_pm_profiles {
288 288
289#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f) 289#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f)
290 290
291union acpi_name_union {
292 u32 integer;
293 char ascii[4];
294};
295
296/*
297 * Internal ACPI Table Descriptor. One per ACPI table
298 */
299struct acpi_table_desc {
300 acpi_physical_address address;
301 struct acpi_table_header *pointer;
302 u32 length; /* Length fixed at 32 bits */
303 union acpi_name_union signature;
304 acpi_owner_id owner_id;
305 u8 flags;
306};
307
308/* Flags for above */
309
310#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
311#define ACPI_TABLE_ORIGIN_MAPPED (1)
312#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
313#define ACPI_TABLE_ORIGIN_MASK (3)
314#define ACPI_TABLE_IS_LOADED (4)
315
291/* 316/*
292 * Get the remaining ACPI tables 317 * Get the remaining ACPI tables
293 */ 318 */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index a9719d69e72e..20f6f9c5f21c 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -233,7 +233,11 @@ typedef u32 acpi_physical_address;
233/* Object returned from acpi_os_create_cache */ 233/* Object returned from acpi_os_create_cache */
234 234
235#ifndef acpi_cache_t 235#ifndef acpi_cache_t
236#ifdef ACPI_USE_LOCAL_CACHE
236#define acpi_cache_t struct acpi_memory_list 237#define acpi_cache_t struct acpi_memory_list
238#else
239#define acpi_cache_t void *
240#endif
237#endif 241#endif
238 242
239/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */ 243/* Use C99 uintptr_t for pointer casting if available, "void *" otherwise */
@@ -268,6 +272,37 @@ typedef u32 acpi_physical_address;
268#define ACPI_EXPORT_SYMBOL(symbol) 272#define ACPI_EXPORT_SYMBOL(symbol)
269#endif 273#endif
270 274
275/******************************************************************************
276 *
277 * ACPI Specification constants (Do not change unless the specification changes)
278 *
279 *****************************************************************************/
280
281/* Number of distinct GPE register blocks and register width */
282
283#define ACPI_MAX_GPE_BLOCKS 2
284#define ACPI_GPE_REGISTER_WIDTH 8
285
286/* Names within the namespace are 4 bytes long */
287
288#define ACPI_NAME_SIZE 4
289#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
290#define ACPI_PATH_SEPARATOR '.'
291
292/* Sizes for ACPI table headers */
293
294#define ACPI_OEM_ID_SIZE 6
295#define ACPI_OEM_TABLE_ID_SIZE 8
296
297/* ACPI/PNP hardware IDs */
298
299#define PCI_ROOT_HID_STRING "PNP0A03"
300#define PCI_EXPRESS_ROOT_HID_STRING "PNP0A08"
301
302/* PM Timer ticks per second (HZ) */
303
304#define PM_TIMER_FREQUENCY 3579545
305
271/******************************************************************************* 306/*******************************************************************************
272 * 307 *
273 * Independent types 308 * Independent types
@@ -298,6 +333,11 @@ typedef u32 acpi_name; /* 4-byte ACPI name */
298typedef char *acpi_string; /* Null terminated ASCII string */ 333typedef char *acpi_string; /* Null terminated ASCII string */
299typedef void *acpi_handle; /* Actually a ptr to a NS Node */ 334typedef void *acpi_handle; /* Actually a ptr to a NS Node */
300 335
336/* Owner IDs are used to track namespace nodes for selective deletion */
337
338typedef u8 acpi_owner_id;
339#define ACPI_OWNER_ID_MAX 0xFF
340
301struct uint64_struct { 341struct uint64_struct {
302 u32 lo; 342 u32 lo;
303 u32 hi; 343 u32 hi;
@@ -338,10 +378,75 @@ typedef unsigned long long acpi_integer;
338#define ACPI_MAX16_DECIMAL_DIGITS 5 378#define ACPI_MAX16_DECIMAL_DIGITS 5
339#define ACPI_MAX8_DECIMAL_DIGITS 3 379#define ACPI_MAX8_DECIMAL_DIGITS 3
340 380
381/* PM Timer ticks per second (HZ) */
382
383#define PM_TIMER_FREQUENCY 3579545
384
341/* 385/*
342 * Constants with special meanings 386 * Constants with special meanings
343 */ 387 */
344#define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR) 388#define ACPI_ROOT_OBJECT ACPI_ADD_PTR (acpi_handle, NULL, ACPI_MAX_PTR)
389#define ACPI_WAIT_FOREVER 0xFFFF /* u16, as per ACPI spec */
390#define ACPI_DO_NOT_WAIT 0
391
392/*******************************************************************************
393 *
394 * Commonly used macros
395 *
396 ******************************************************************************/
397
398/* Data manipulation */
399
400#define ACPI_LOWORD(l) ((u16)(u32)(l))
401#define ACPI_HIWORD(l) ((u16)((((u32)(l)) >> 16) & 0xFFFF))
402#define ACPI_LOBYTE(l) ((u8)(u16)(l))
403#define ACPI_HIBYTE(l) ((u8)((((u16)(l)) >> 8) & 0xFF))
404
405/* Full 64-bit integer must be available on both 32-bit and 64-bit platforms */
406
407struct acpi_integer_overlay {
408 u32 lo_dword;
409 u32 hi_dword;
410};
411
412#define ACPI_LODWORD(integer) (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->lo_dword)
413#define ACPI_HIDWORD(integer) (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->hi_dword)
414
415#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
416#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
417#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
418#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
419
420/* Size calculation */
421
422#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
423
424/* Pointer manipulation */
425
426#define ACPI_CAST_PTR(t, p) ((t *) (acpi_uintptr_t) (p))
427#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (acpi_uintptr_t) (p))
428#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (u8, (a)) + (acpi_size)(b)))
429#define ACPI_PTR_DIFF(a, b) (acpi_size) (ACPI_CAST_PTR (u8, (a)) - ACPI_CAST_PTR (u8, (b)))
430
431/* Pointer/Integer type conversions */
432
433#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i)
434#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
435#define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
436#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
437#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
438
439#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
440#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32, (a)) == *ACPI_CAST_PTR (u32, (b)))
441#else
442#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
443#endif
444
445/*******************************************************************************
446 *
447 * Miscellaneous constants
448 *
449 ******************************************************************************/
345 450
346/* 451/*
347 * Initialization sequence 452 * Initialization sequence
@@ -732,6 +837,15 @@ struct acpi_buffer {
732#define ACPI_NAME_TYPE_MAX 1 837#define ACPI_NAME_TYPE_MAX 1
733 838
734/* 839/*
840 * Predefined Namespace items
841 */
842struct acpi_predefined_names {
843 char *name;
844 u8 type;
845 char *val;
846};
847
848/*
735 * Structure and flags for acpi_get_system_info 849 * Structure and flags for acpi_get_system_info
736 */ 850 */
737#define ACPI_SYS_MODE_UNKNOWN 0x0000 851#define ACPI_SYS_MODE_UNKNOWN 0x0000
@@ -823,6 +937,12 @@ acpi_status(*acpi_walk_callback) (acpi_handle obj_handle,
823#define ACPI_INTERRUPT_NOT_HANDLED 0x00 937#define ACPI_INTERRUPT_NOT_HANDLED 0x00
824#define ACPI_INTERRUPT_HANDLED 0x01 938#define ACPI_INTERRUPT_HANDLED 0x01
825 939
940/* Length of _HID, _UID, _CID, and UUID values */
941
942#define ACPI_DEVICE_ID_LENGTH 0x09
943#define ACPI_MAX_CID_LENGTH 48
944#define ACPI_UUID_LENGTH 16
945
826/* Common string version of device HIDs and UIDs */ 946/* Common string version of device HIDs and UIDs */
827 947
828struct acpica_device_id { 948struct acpica_device_id {
@@ -900,357 +1020,28 @@ struct acpi_mem_space_context {
900}; 1020};
901 1021
902/* 1022/*
903 * Definitions for Resource Attributes 1023 * struct acpi_memory_list is used only if the ACPICA local cache is enabled
904 */ 1024 */
905typedef u16 acpi_rs_length; /* Resource Length field is fixed at 16 bits */ 1025struct acpi_memory_list {
906typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (64_k-1)+3 */ 1026 char *list_name;
907 1027 void *list_head;
908/* 1028 u16 object_size;
909 * Memory Attributes 1029 u16 max_depth;
910 */ 1030 u16 current_depth;
911#define ACPI_READ_ONLY_MEMORY (u8) 0x00 1031 u16 link_offset;
912#define ACPI_READ_WRITE_MEMORY (u8) 0x01 1032
913 1033#ifdef ACPI_DBG_TRACK_ALLOCATIONS
914#define ACPI_NON_CACHEABLE_MEMORY (u8) 0x00 1034
915#define ACPI_CACHABLE_MEMORY (u8) 0x01 1035 /* Statistics for debug memory tracking only */
916#define ACPI_WRITE_COMBINING_MEMORY (u8) 0x02 1036
917#define ACPI_PREFETCHABLE_MEMORY (u8) 0x03 1037 u32 total_allocated;
918 1038 u32 total_freed;
919/* 1039 u32 max_occupied;
920 * IO Attributes 1040 u32 total_size;
921 * The ISA IO ranges are: n000-n0_fFh, n400-n4_fFh, n800-n8_fFh, n_c00-n_cFFh. 1041 u32 current_total_size;
922 * The non-ISA IO ranges are: n100-n3_fFh, n500-n7_fFh, n900-n_bFFh, n_cd0-n_fFFh. 1042 u32 requests;
923 */ 1043 u32 hits;
924#define ACPI_NON_ISA_ONLY_RANGES (u8) 0x01
925#define ACPI_ISA_ONLY_RANGES (u8) 0x02
926#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
927
928/* Type of translation - 1=Sparse, 0=Dense */
929
930#define ACPI_SPARSE_TRANSLATION (u8) 0x01
931
932/*
933 * IO Port Descriptor Decode
934 */
935#define ACPI_DECODE_10 (u8) 0x00 /* 10-bit IO address decode */
936#define ACPI_DECODE_16 (u8) 0x01 /* 16-bit IO address decode */
937
938/*
939 * IRQ Attributes
940 */
941#define ACPI_LEVEL_SENSITIVE (u8) 0x00
942#define ACPI_EDGE_SENSITIVE (u8) 0x01
943
944#define ACPI_ACTIVE_HIGH (u8) 0x00
945#define ACPI_ACTIVE_LOW (u8) 0x01
946
947#define ACPI_EXCLUSIVE (u8) 0x00
948#define ACPI_SHARED (u8) 0x01
949
950/*
951 * DMA Attributes
952 */
953#define ACPI_COMPATIBILITY (u8) 0x00
954#define ACPI_TYPE_A (u8) 0x01
955#define ACPI_TYPE_B (u8) 0x02
956#define ACPI_TYPE_F (u8) 0x03
957
958#define ACPI_NOT_BUS_MASTER (u8) 0x00
959#define ACPI_BUS_MASTER (u8) 0x01
960
961#define ACPI_TRANSFER_8 (u8) 0x00
962#define ACPI_TRANSFER_8_16 (u8) 0x01
963#define ACPI_TRANSFER_16 (u8) 0x02
964
965/*
966 * Start Dependent Functions Priority definitions
967 */
968#define ACPI_GOOD_CONFIGURATION (u8) 0x00
969#define ACPI_ACCEPTABLE_CONFIGURATION (u8) 0x01
970#define ACPI_SUB_OPTIMAL_CONFIGURATION (u8) 0x02
971
972/*
973 * 16, 32 and 64-bit Address Descriptor resource types
974 */
975#define ACPI_MEMORY_RANGE (u8) 0x00
976#define ACPI_IO_RANGE (u8) 0x01
977#define ACPI_BUS_NUMBER_RANGE (u8) 0x02
978
979#define ACPI_ADDRESS_NOT_FIXED (u8) 0x00
980#define ACPI_ADDRESS_FIXED (u8) 0x01
981
982#define ACPI_POS_DECODE (u8) 0x00
983#define ACPI_SUB_DECODE (u8) 0x01
984
985#define ACPI_PRODUCER (u8) 0x00
986#define ACPI_CONSUMER (u8) 0x01
987
988/*
989 * If possible, pack the following structures to byte alignment
990 */
991#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
992#pragma pack(1)
993#endif 1044#endif
994
995/* UUID data structures for use in vendor-defined resource descriptors */
996
997struct acpi_uuid {
998 u8 data[ACPI_UUID_LENGTH];
999};
1000
1001struct acpi_vendor_uuid {
1002 u8 subtype;
1003 u8 data[ACPI_UUID_LENGTH];
1004};
1005
1006/*
1007 * Structures used to describe device resources
1008 */
1009struct acpi_resource_irq {
1010 u8 descriptor_length;
1011 u8 triggering;
1012 u8 polarity;
1013 u8 sharable;
1014 u8 interrupt_count;
1015 u8 interrupts[1];
1016};
1017
1018struct acpi_resource_dma {
1019 u8 type;
1020 u8 bus_master;
1021 u8 transfer;
1022 u8 channel_count;
1023 u8 channels[1];
1024};
1025
1026struct acpi_resource_start_dependent {
1027 u8 descriptor_length;
1028 u8 compatibility_priority;
1029 u8 performance_robustness;
1030};
1031
1032/*
1033 * END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
1034 * needed because it has no fields
1035 */
1036
1037struct acpi_resource_io {
1038 u8 io_decode;
1039 u8 alignment;
1040 u8 address_length;
1041 u16 minimum;
1042 u16 maximum;
1043};
1044
1045struct acpi_resource_fixed_io {
1046 u16 address;
1047 u8 address_length;
1048};
1049
1050struct acpi_resource_vendor {
1051 u16 byte_length;
1052 u8 byte_data[1];
1053};
1054
1055/* Vendor resource with UUID info (introduced in ACPI 3.0) */
1056
1057struct acpi_resource_vendor_typed {
1058 u16 byte_length;
1059 u8 uuid_subtype;
1060 u8 uuid[ACPI_UUID_LENGTH];
1061 u8 byte_data[1];
1062};
1063
1064struct acpi_resource_end_tag {
1065 u8 checksum;
1066};
1067
1068struct acpi_resource_memory24 {
1069 u8 write_protect;
1070 u16 minimum;
1071 u16 maximum;
1072 u16 alignment;
1073 u16 address_length;
1074};
1075
1076struct acpi_resource_memory32 {
1077 u8 write_protect;
1078 u32 minimum;
1079 u32 maximum;
1080 u32 alignment;
1081 u32 address_length;
1082};
1083
1084struct acpi_resource_fixed_memory32 {
1085 u8 write_protect;
1086 u32 address;
1087 u32 address_length;
1088};
1089
1090struct acpi_memory_attribute {
1091 u8 write_protect;
1092 u8 caching;
1093 u8 range_type;
1094 u8 translation;
1095};
1096
1097struct acpi_io_attribute {
1098 u8 range_type;
1099 u8 translation;
1100 u8 translation_type;
1101 u8 reserved1;
1102};
1103
1104union acpi_resource_attribute {
1105 struct acpi_memory_attribute mem;
1106 struct acpi_io_attribute io;
1107
1108 /* Used for the *word_space macros */
1109
1110 u8 type_specific;
1111};
1112
1113struct acpi_resource_source {
1114 u8 index;
1115 u16 string_length;
1116 char *string_ptr;
1117};
1118
1119/* Fields common to all address descriptors, 16/32/64 bit */
1120
1121#define ACPI_RESOURCE_ADDRESS_COMMON \
1122 u8 resource_type; \
1123 u8 producer_consumer; \
1124 u8 decode; \
1125 u8 min_address_fixed; \
1126 u8 max_address_fixed; \
1127 union acpi_resource_attribute info;
1128
1129struct acpi_resource_address {
1130ACPI_RESOURCE_ADDRESS_COMMON};
1131
1132struct acpi_resource_address16 {
1133 ACPI_RESOURCE_ADDRESS_COMMON u16 granularity;
1134 u16 minimum;
1135 u16 maximum;
1136 u16 translation_offset;
1137 u16 address_length;
1138 struct acpi_resource_source resource_source;
1139};
1140
1141struct acpi_resource_address32 {
1142 ACPI_RESOURCE_ADDRESS_COMMON u32 granularity;
1143 u32 minimum;
1144 u32 maximum;
1145 u32 translation_offset;
1146 u32 address_length;
1147 struct acpi_resource_source resource_source;
1148};
1149
1150struct acpi_resource_address64 {
1151 ACPI_RESOURCE_ADDRESS_COMMON u64 granularity;
1152 u64 minimum;
1153 u64 maximum;
1154 u64 translation_offset;
1155 u64 address_length;
1156 struct acpi_resource_source resource_source;
1157};
1158
1159struct acpi_resource_extended_address64 {
1160 ACPI_RESOURCE_ADDRESS_COMMON u8 revision_iD;
1161 u64 granularity;
1162 u64 minimum;
1163 u64 maximum;
1164 u64 translation_offset;
1165 u64 address_length;
1166 u64 type_specific;
1167};
1168
1169struct acpi_resource_extended_irq {
1170 u8 producer_consumer;
1171 u8 triggering;
1172 u8 polarity;
1173 u8 sharable;
1174 u8 interrupt_count;
1175 struct acpi_resource_source resource_source;
1176 u32 interrupts[1];
1177};
1178
1179struct acpi_resource_generic_register {
1180 u8 space_id;
1181 u8 bit_width;
1182 u8 bit_offset;
1183 u8 access_size;
1184 u64 address;
1185};
1186
1187/* ACPI_RESOURCE_TYPEs */
1188
1189#define ACPI_RESOURCE_TYPE_IRQ 0
1190#define ACPI_RESOURCE_TYPE_DMA 1
1191#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
1192#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
1193#define ACPI_RESOURCE_TYPE_IO 4
1194#define ACPI_RESOURCE_TYPE_FIXED_IO 5
1195#define ACPI_RESOURCE_TYPE_VENDOR 6
1196#define ACPI_RESOURCE_TYPE_END_TAG 7
1197#define ACPI_RESOURCE_TYPE_MEMORY24 8
1198#define ACPI_RESOURCE_TYPE_MEMORY32 9
1199#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
1200#define ACPI_RESOURCE_TYPE_ADDRESS16 11
1201#define ACPI_RESOURCE_TYPE_ADDRESS32 12
1202#define ACPI_RESOURCE_TYPE_ADDRESS64 13
1203#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
1204#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
1205#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
1206#define ACPI_RESOURCE_TYPE_MAX 16
1207
1208union acpi_resource_data {
1209 struct acpi_resource_irq irq;
1210 struct acpi_resource_dma dma;
1211 struct acpi_resource_start_dependent start_dpf;
1212 struct acpi_resource_io io;
1213 struct acpi_resource_fixed_io fixed_io;
1214 struct acpi_resource_vendor vendor;
1215 struct acpi_resource_vendor_typed vendor_typed;
1216 struct acpi_resource_end_tag end_tag;
1217 struct acpi_resource_memory24 memory24;
1218 struct acpi_resource_memory32 memory32;
1219 struct acpi_resource_fixed_memory32 fixed_memory32;
1220 struct acpi_resource_address16 address16;
1221 struct acpi_resource_address32 address32;
1222 struct acpi_resource_address64 address64;
1223 struct acpi_resource_extended_address64 ext_address64;
1224 struct acpi_resource_extended_irq extended_irq;
1225 struct acpi_resource_generic_register generic_reg;
1226
1227 /* Common fields */
1228
1229 struct acpi_resource_address address; /* Common 16/32/64 address fields */
1230};
1231
1232struct acpi_resource {
1233 u32 type;
1234 u32 length;
1235 union acpi_resource_data data;
1236};
1237
1238/* restore default alignment */
1239
1240#pragma pack()
1241
1242#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
1243#define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
1244#define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type))
1245
1246#define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length)
1247
1248struct acpi_pci_routing_table {
1249 u32 length;
1250 u32 pin;
1251 acpi_integer address; /* here for 64-bit alignment */
1252 u32 source_index;
1253 char source[4]; /* pad to 64 bits so sizeof() works in all cases */
1254}; 1045};
1255 1046
1256#endif /* __ACTYPES_H__ */ 1047#endif /* __ACTYPES_H__ */
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index d8307b2987e3..80d8813484fe 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -297,42 +297,6 @@ void acpi_ut_report_info(char *module_name, u32 line_number);
297 297
298void acpi_ut_report_warning(char *module_name, u32 line_number); 298void acpi_ut_report_warning(char *module_name, u32 line_number);
299 299
300/* Error and message reporting interfaces */
301
302void ACPI_INTERNAL_VAR_XFACE
303acpi_ut_debug_print(u32 requested_debug_level,
304 u32 line_number,
305 const char *function_name,
306 const char *module_name,
307 u32 component_id,
308 const char *format, ...) ACPI_PRINTF_LIKE(6);
309
310void ACPI_INTERNAL_VAR_XFACE
311acpi_ut_debug_print_raw(u32 requested_debug_level,
312 u32 line_number,
313 const char *function_name,
314 const char *module_name,
315 u32 component_id,
316 const char *format, ...) ACPI_PRINTF_LIKE(6);
317
318void ACPI_INTERNAL_VAR_XFACE
319acpi_ut_error(const char *module_name,
320 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
321
322void ACPI_INTERNAL_VAR_XFACE
323acpi_ut_exception(const char *module_name,
324 u32 line_number,
325 acpi_status status,
326 const char *format, ...) ACPI_PRINTF_LIKE(4);
327
328void ACPI_INTERNAL_VAR_XFACE
329acpi_ut_warning(const char *module_name,
330 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
331
332void ACPI_INTERNAL_VAR_XFACE
333acpi_ut_info(const char *module_name,
334 u32 line_number, const char *format, ...) ACPI_PRINTF_LIKE(3);
335
336/* 300/*
337 * utdelete - Object deletion and reference counts 301 * utdelete - Object deletion and reference counts
338 */ 302 */
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index fcd2572e428c..cbae39c728a5 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -47,7 +47,6 @@
47/* 47/*
48 * Configuration for ACPI tools and utilities 48 * Configuration for ACPI tools and utilities
49 */ 49 */
50
51#ifdef ACPI_LIBRARY 50#ifdef ACPI_LIBRARY
52/* 51/*
53 * Note: The non-debug version of the acpi_library does not contain any 52 * Note: The non-debug version of the acpi_library does not contain any
@@ -75,17 +74,6 @@
75#define ACPI_DBG_TRACK_ALLOCATIONS 74#define ACPI_DBG_TRACK_ALLOCATIONS
76#endif 75#endif
77 76
78#ifdef ACPI_DASM_APP
79#ifndef MSDOS
80#define ACPI_DEBUG_OUTPUT
81#endif
82#define ACPI_APPLICATION
83#define ACPI_DISASSEMBLER
84#define ACPI_NO_METHOD_EXECUTION
85#define ACPI_LARGE_NAMESPACE_NODE
86#define ACPI_DATA_TABLE_DISASSEMBLY
87#endif
88
89#ifdef ACPI_APPLICATION 77#ifdef ACPI_APPLICATION
90#define ACPI_USE_SYSTEM_CLIBRARY 78#define ACPI_USE_SYSTEM_CLIBRARY
91#define ACPI_USE_LOCAL_CACHE 79#define ACPI_USE_LOCAL_CACHE