aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2007-02-06 15:31:00 -0500
committerLen Brown <len.brown@intel.com>2007-02-06 15:31:00 -0500
commit57e1c5c87db512629dd44ddeb882a5aaf0e4299e (patch)
treee71e8a132d4f696beeae1bdab59efeed9517ba66 /include
parent62d0cfcb27cf755cebdc93ca95dabc83608007cd (diff)
parent76a2e849df47697706024262a8bbb83432b8bde7 (diff)
Pull test into release branch
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h13
-rw-r--r--include/acpi/acdebug.h8
-rw-r--r--include/acpi/acdisasm.h22
-rw-r--r--include/acpi/acdispat.h4
-rw-r--r--include/acpi/acevents.h2
-rw-r--r--include/acpi/acexcep.h10
-rw-r--r--include/acpi/acglobal.h117
-rw-r--r--include/acpi/achware.h6
-rw-r--r--include/acpi/acinterp.h14
-rw-r--r--include/acpi/aclocal.h77
-rw-r--r--include/acpi/acmacros.h71
-rw-r--r--include/acpi/acnames.h2
-rw-r--r--include/acpi/acnamesp.h21
-rw-r--r--include/acpi/acobject.h19
-rw-r--r--include/acpi/acopcode.h4
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acparser.h2
-rw-r--r--include/acpi/acpi.h2
-rw-r--r--include/acpi/acpi_bus.h23
-rw-r--r--include/acpi/acpi_drivers.h15
-rw-r--r--include/acpi/acpiosxf.h8
-rw-r--r--include/acpi/acpixf.h34
-rw-r--r--include/acpi/acresrc.h2
-rw-r--r--include/acpi/acstruct.h5
-rw-r--r--include/acpi/actables.h106
-rw-r--r--include/acpi/actbl.h333
-rw-r--r--include/acpi/actbl1.h568
-rw-r--r--include/acpi/actbl2.h49
-rw-r--r--include/acpi/actbl71.h134
-rw-r--r--include/acpi/actypes.h106
-rw-r--r--include/acpi/acutils.h8
-rw-r--r--include/acpi/amlcode.h4
-rw-r--r--include/acpi/amlresrc.h2
-rw-r--r--include/acpi/platform/acenv.h2
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/acpi/platform/aclinux.h2
-rw-r--r--include/asm-i386/acpi.h24
-rw-r--r--include/asm-i386/mach-es7000/mach_mpparse.h17
-rw-r--r--include/asm-ia64/acpi.h10
-rw-r--r--include/asm-ia64/sn/acpi.h3
-rw-r--r--include/asm-ia64/sn/pcibr_provider.h2
-rw-r--r--include/asm-ia64/sn/pcidev.h8
-rw-r--r--include/asm-x86_64/acpi.h24
-rw-r--r--include/linux/acpi.h339
-rw-r--r--include/linux/video_output.h42
45 files changed, 848 insertions, 1420 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index ebc1f697615a..422f29c06c77 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20060707 66#define ACPI_CA_VERSION 0x20070126
67 67
68/* 68/*
69 * OS name, used for the _OS object. The _OS object is essentially obsolete, 69 * OS name, used for the _OS object. The _OS object is essentially obsolete,
@@ -115,6 +115,10 @@
115 115
116#define ACPI_NUM_OWNERID_MASKS 8 116#define ACPI_NUM_OWNERID_MASKS 8
117 117
118/* Size of the root table array is increased by this increment */
119
120#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
121
118/****************************************************************************** 122/******************************************************************************
119 * 123 *
120 * ACPI Specification constants (Do not change unless the specification changes) 124 * ACPI Specification constants (Do not change unless the specification changes)
@@ -152,6 +156,11 @@
152#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ 156#define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */
153#define ACPI_PATH_SEPARATOR '.' 157#define ACPI_PATH_SEPARATOR '.'
154 158
159/* Sizes for ACPI table headers */
160
161#define ACPI_OEM_ID_SIZE 6
162#define ACPI_OEM_TABLE_ID_SIZE 8
163
155/* Constants used in searching for the RSDP in low memory */ 164/* Constants used in searching for the RSDP in low memory */
156 165
157#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ 166#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index d8167095caf3..d626bb1d2973 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -159,6 +159,10 @@ void
159acpi_db_create_execution_threads(char *num_threads_arg, 159acpi_db_create_execution_threads(char *num_threads_arg,
160 char *num_loops_arg, char *method_name_arg); 160 char *num_loops_arg, char *method_name_arg);
161 161
162#ifdef ACPI_DBG_TRACK_ALLOCATIONS
163u32 acpi_db_get_cache_info(struct acpi_memory_list *cache);
164#endif
165
162/* 166/*
163 * dbfileio - Debugger file I/O commands 167 * dbfileio - Debugger file I/O commands
164 */ 168 */
@@ -214,4 +218,6 @@ void acpi_db_prep_namestring(char *name);
214 218
215struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name); 219struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
216 220
221void acpi_db_uint32_to_hex_string(u32 value, char *buffer);
222
217#endif /* __ACDEBUG_H__ */ 223#endif /* __ACDEBUG_H__ */
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 9a7d6921f534..389d772c7d5b 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -97,9 +97,11 @@ typedef const struct acpi_dmtable_info {
97#define ACPI_DMT_CHKSUM 20 97#define ACPI_DMT_CHKSUM 20
98#define ACPI_DMT_SPACEID 21 98#define ACPI_DMT_SPACEID 21
99#define ACPI_DMT_GAS 22 99#define ACPI_DMT_GAS 22
100#define ACPI_DMT_MADT 23 100#define ACPI_DMT_DMAR 23
101#define ACPI_DMT_SRAT 24 101#define ACPI_DMT_MADT 24
102#define ACPI_DMT_EXIT 25 102#define ACPI_DMT_SRAT 25
103#define ACPI_DMT_EXIT 26
104#define ACPI_DMT_SIG 27
103 105
104typedef 106typedef
105void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table); 107void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
@@ -108,6 +110,7 @@ struct acpi_dmtable_data {
108 char *signature; 110 char *signature;
109 struct acpi_dmtable_info *table_info; 111 struct acpi_dmtable_info *table_info;
110 ACPI_TABLE_HANDLER table_handler; 112 ACPI_TABLE_HANDLER table_handler;
113 char *name;
111}; 114};
112 115
113struct acpi_op_walk_info { 116struct acpi_op_walk_info {
@@ -139,7 +142,9 @@ extern const char *acpi_gbl_match_ops[];
139 142
140extern struct acpi_dmtable_info acpi_dm_table_info_asf0[]; 143extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
141extern struct acpi_dmtable_info acpi_dm_table_info_asf1[]; 144extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
145extern struct acpi_dmtable_info acpi_dm_table_info_asf1a[];
142extern struct acpi_dmtable_info acpi_dm_table_info_asf2[]; 146extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
147extern struct acpi_dmtable_info acpi_dm_table_info_asf2a[];
143extern struct acpi_dmtable_info acpi_dm_table_info_asf3[]; 148extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
144extern struct acpi_dmtable_info acpi_dm_table_info_asf4[]; 149extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
145extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[]; 150extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
@@ -147,6 +152,11 @@ extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
147extern struct acpi_dmtable_info acpi_dm_table_info_cpep[]; 152extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
148extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[]; 153extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
149extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[]; 154extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
155extern struct acpi_dmtable_info acpi_dm_table_info_dmar[];
156extern struct acpi_dmtable_info acpi_dm_table_info_dmar_hdr[];
157extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
158extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
159extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
150extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[]; 160extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
151extern struct acpi_dmtable_info acpi_dm_table_info_facs[]; 161extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
152extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[]; 162extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
@@ -201,6 +211,8 @@ void acpi_dm_dump_asf(struct acpi_table_header *table);
201 211
202void acpi_dm_dump_cpep(struct acpi_table_header *table); 212void acpi_dm_dump_cpep(struct acpi_table_header *table);
203 213
214void acpi_dm_dump_dmar(struct acpi_table_header *table);
215
204void acpi_dm_dump_fadt(struct acpi_table_header *table); 216void acpi_dm_dump_fadt(struct acpi_table_header *table);
205 217
206void acpi_dm_dump_srat(struct acpi_table_header *table); 218void acpi_dm_dump_srat(struct acpi_table_header *table);
@@ -314,7 +326,7 @@ acpi_dm_resource_template(struct acpi_op_walk_info *info,
314 union acpi_parse_object *op, 326 union acpi_parse_object *op,
315 u8 * byte_data, u32 byte_count); 327 u8 * byte_data, u32 byte_count);
316 328
317u8 acpi_dm_is_resource_template(union acpi_parse_object *op); 329acpi_status acpi_dm_is_resource_template(union acpi_parse_object *op);
318 330
319void acpi_dm_indent(u32 level); 331void acpi_dm_indent(u32 level);
320 332
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index a22fe9cf8493..cb8d2868c8ac 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -210,7 +210,7 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state);
210 * dsinit 210 * dsinit
211 */ 211 */
212acpi_status 212acpi_status
213acpi_ds_initialize_objects(struct acpi_table_desc *table_desc, 213acpi_ds_initialize_objects(acpi_native_uint table_index,
214 struct acpi_namespace_node *start_node); 214 struct acpi_namespace_node *start_node);
215 215
216/* 216/*
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index 234142828e1a..d23cdf326808 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index 797ca1ea5214..b73f18a48785 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -178,8 +178,10 @@
178#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL) 178#define AE_CTRL_BREAK (acpi_status) (0x0009 | AE_CODE_CONTROL)
179#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL) 179#define AE_CTRL_CONTINUE (acpi_status) (0x000A | AE_CODE_CONTROL)
180#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL) 180#define AE_CTRL_SKIP (acpi_status) (0x000B | AE_CODE_CONTROL)
181#define AE_CTRL_PARSE_CONTINUE (acpi_status) (0x000C | AE_CODE_CONTROL)
182#define AE_CTRL_PARSE_PENDING (acpi_status) (0x000D | AE_CODE_CONTROL)
181 183
182#define AE_CODE_CTRL_MAX 0x000B 184#define AE_CODE_CTRL_MAX 0x000D
183 185
184#ifdef DEFINE_ACPI_GLOBALS 186#ifdef DEFINE_ACPI_GLOBALS
185 187
@@ -291,7 +293,9 @@ char const *acpi_gbl_exception_names_ctrl[] = {
291 "AE_CTRL_TRANSFER", 293 "AE_CTRL_TRANSFER",
292 "AE_CTRL_BREAK", 294 "AE_CTRL_BREAK",
293 "AE_CTRL_CONTINUE", 295 "AE_CTRL_CONTINUE",
294 "AE_CTRL_SKIP" 296 "AE_CTRL_SKIP",
297 "AE_CTRL_PARSE_CONTINUE",
298 "AE_CTRL_PARSE_PENDING"
295}; 299};
296 300
297#endif /* ACPI GLOBALS */ 301#endif /* ACPI GLOBALS */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 06972e6637de..24c3f05ab367 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -58,37 +58,6 @@
58#define ACPI_INIT_GLOBAL(a,b) a 58#define ACPI_INIT_GLOBAL(a,b) a
59#endif 59#endif
60 60
61/*
62 * Keep local copies of these FADT-based registers. NOTE: These globals
63 * are first in this file for alignment reasons on 64-bit systems.
64 */
65ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
66ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
67
68/*****************************************************************************
69 *
70 * Debug support
71 *
72 ****************************************************************************/
73
74/* Runtime configuration of debug print levels */
75
76extern u32 acpi_dbg_level;
77extern u32 acpi_dbg_layer;
78
79/* Procedure nesting level for debug output */
80
81extern u32 acpi_gbl_nesting_level;
82
83/* Support for dynamic control method tracing mechanism */
84
85ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
86ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
87ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
88ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
89ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
90ACPI_EXTERN u32 acpi_gbl_trace_flags;
91
92/***************************************************************************** 61/*****************************************************************************
93 * 62 *
94 * Runtime configuration (static defaults that can be overriden at runtime) 63 * Runtime configuration (static defaults that can be overriden at runtime)
@@ -135,52 +104,62 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
135 104
136/***************************************************************************** 105/*****************************************************************************
137 * 106 *
107 * Debug support
108 *
109 ****************************************************************************/
110
111/* Runtime configuration of debug print levels */
112
113extern u32 acpi_dbg_level;
114extern u32 acpi_dbg_layer;
115
116/* Procedure nesting level for debug output */
117
118extern u32 acpi_gbl_nesting_level;
119
120/* Event counters */
121
122ACPI_EXTERN u32 acpi_gpe_count;
123
124/* Support for dynamic control method tracing mechanism */
125
126ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
127ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
128ACPI_EXTERN acpi_name acpi_gbl_trace_method_name;
129ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
130ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;
131ACPI_EXTERN u32 acpi_gbl_trace_flags;
132
133/*****************************************************************************
134 *
138 * ACPI Table globals 135 * ACPI Table globals
139 * 136 *
140 ****************************************************************************/ 137 ****************************************************************************/
141 138
142/* 139/*
143 * Table pointers. 140 * acpi_gbl_root_table_list is the master list of ACPI tables found in the
144 * Although these pointers are somewhat redundant with the global acpi_table, 141 * RSDT/XSDT.
145 * they are convenient because they are typed pointers.
146 * 142 *
147 * These tables are single-table only; meaning that there can be at most one 143 * acpi_gbl_FADT is a local copy of the FADT, converted to a common format.
148 * of each in the system. Each global points to the actual table.
149 */
150ACPI_EXTERN u32 acpi_gbl_table_flags;
151ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
152ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP;
153ACPI_EXTERN struct xsdt_descriptor *acpi_gbl_XSDT;
154ACPI_EXTERN struct fadt_descriptor *acpi_gbl_FADT;
155ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
156ACPI_EXTERN struct facs_descriptor *acpi_gbl_FACS;
157ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
158/*
159 * Since there may be multiple SSDTs and PSDTs, a single pointer is not
160 * sufficient; Therefore, there isn't one!
161 */ 144 */
145ACPI_EXTERN struct acpi_internal_rsdt acpi_gbl_root_table_list;
146ACPI_EXTERN struct acpi_table_fadt acpi_gbl_FADT;
147extern acpi_native_uint acpi_gbl_permanent_mmap;
162 148
163/* The root table can be either an RSDT or an XSDT */ 149/* These addresses are calculated from FADT address values */
164 150
165ACPI_EXTERN u8 acpi_gbl_root_table_type; 151ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1a_enable;
166#define ACPI_TABLE_TYPE_RSDT 'R' 152ACPI_EXTERN struct acpi_generic_address acpi_gbl_xpm1b_enable;
167#define ACPI_TABLE_TYPE_XSDT 'X'
168 153
169/* 154/*
170 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths: 155 * Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
171 * If we are executing a method that exists in a 32-bit ACPI table, 156 * determined by the revision of the DSDT: If the DSDT revision is less than
172 * use only the lower 32 bits of the (internal) 64-bit Integer. 157 * 2, use only the lower 32 bits of the internal 64-bit Integer.
173 */ 158 */
174ACPI_EXTERN u8 acpi_gbl_integer_bit_width; 159ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
175ACPI_EXTERN u8 acpi_gbl_integer_byte_width; 160ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
176ACPI_EXTERN u8 acpi_gbl_integer_nybble_width; 161ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
177 162
178/*
179 * ACPI Table info arrays
180 */
181extern struct acpi_table_list acpi_gbl_table_lists[ACPI_TABLE_ID_MAX + 1];
182extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
183
184/***************************************************************************** 163/*****************************************************************************
185 * 164 *
186 * Mutual exlusion within ACPICA subsystem 165 * Mutual exlusion within ACPICA subsystem
@@ -188,7 +167,7 @@ extern struct acpi_table_support acpi_gbl_table_data[ACPI_TABLE_ID_MAX + 1];
188 ****************************************************************************/ 167 ****************************************************************************/
189 168
190/* 169/*
191 * Predefined mutex objects. This array contains the 170 * Predefined mutex objects. This array contains the
192 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs. 171 * actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
193 * (The table maps local handles to the real OS handles) 172 * (The table maps local handles to the real OS handles)
194 */ 173 */
@@ -197,6 +176,7 @@ ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
197/* 176/*
198 * Global lock semaphore works in conjunction with the actual HW global lock 177 * Global lock semaphore works in conjunction with the actual HW global lock
199 */ 178 */
179ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex;
200ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore; 180ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
201 181
202/* 182/*
@@ -220,6 +200,7 @@ ACPI_EXTERN spinlock_t _acpi_gbl_hardware_lock; /* For ACPI H/W except GPE regis
220 200
221ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list; 201ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
222ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list; 202ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
203ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
223#endif 204#endif
224 205
225/* Object caches */ 206/* Object caches */
@@ -240,7 +221,6 @@ ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
240 221
241/* Misc */ 222/* Misc */
242 223
243ACPI_EXTERN u32 acpi_gbl_global_lock_thread_count;
244ACPI_EXTERN u32 acpi_gbl_original_mode; 224ACPI_EXTERN u32 acpi_gbl_original_mode;
245ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 225ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
246ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 226ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
@@ -260,12 +240,19 @@ ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
260 240
261extern u8 acpi_gbl_shutdown; 241extern u8 acpi_gbl_shutdown;
262extern u32 acpi_gbl_startup_flags; 242extern u32 acpi_gbl_startup_flags;
263extern const u8 acpi_gbl_decode_to8bit[8];
264extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; 243extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
265extern const char *acpi_gbl_highest_dstate_names[4]; 244extern const char *acpi_gbl_highest_dstate_names[4];
266extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; 245extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
267extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; 246extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
268 247
248/* Exception codes */
249
250extern char const *acpi_gbl_exception_names_env[];
251extern char const *acpi_gbl_exception_names_pgm[];
252extern char const *acpi_gbl_exception_names_tbl[];
253extern char const *acpi_gbl_exception_names_aml[];
254extern char const *acpi_gbl_exception_names_ctrl[];
255
269/***************************************************************************** 256/*****************************************************************************
270 * 257 *
271 * Namespace globals 258 * Namespace globals
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 29b60a8c0593..9df275cf7bc1 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,8 +61,6 @@
61/* 61/*
62 * hwacpi - high level functions 62 * hwacpi - high level functions
63 */ 63 */
64acpi_status acpi_hw_initialize(void);
65
66acpi_status acpi_hw_set_mode(u32 mode); 64acpi_status acpi_hw_set_mode(u32 mode);
67 65
68u32 acpi_hw_get_mode(void); 66u32 acpi_hw_get_mode(void);
@@ -84,7 +82,7 @@ acpi_hw_low_level_read(u32 width,
84acpi_status 82acpi_status
85acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg); 83acpi_hw_low_level_write(u32 width, u32 value, struct acpi_generic_address *reg);
86 84
87acpi_status acpi_hw_clear_acpi_status(u32 flags); 85acpi_status acpi_hw_clear_acpi_status(void);
88 86
89/* 87/*
90 * hwgpe - GPE support 88 * hwgpe - GPE support
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index 91586d0d5bb5..ce7c9d653910 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -277,12 +277,6 @@ acpi_status acpi_ex_system_do_suspend(acpi_integer time);
277 277
278acpi_status acpi_ex_system_do_stall(u32 time); 278acpi_status acpi_ex_system_do_stall(u32 time);
279 279
280acpi_status
281acpi_ex_system_acquire_mutex(union acpi_operand_object *time,
282 union acpi_operand_object *obj_desc);
283
284acpi_status acpi_ex_system_release_mutex(union acpi_operand_object *obj_desc);
285
286acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc); 280acpi_status acpi_ex_system_signal_event(union acpi_operand_object *obj_desc);
287 281
288acpi_status 282acpi_status
@@ -451,10 +445,14 @@ acpi_ex_copy_integer_to_buffer_field(union acpi_operand_object *source_desc,
451/* 445/*
452 * exutils - interpreter/scanner utilities 446 * exutils - interpreter/scanner utilities
453 */ 447 */
454acpi_status acpi_ex_enter_interpreter(void); 448void acpi_ex_enter_interpreter(void);
455 449
456void acpi_ex_exit_interpreter(void); 450void acpi_ex_exit_interpreter(void);
457 451
452void acpi_ex_reacquire_interpreter(void);
453
454void acpi_ex_relinquish_interpreter(void);
455
458void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); 456void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
459 457
460u8 acpi_ex_acquire_global_lock(u32 rule); 458u8 acpi_ex_acquire_global_lock(u32 rule);
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 063c4b54290f..6f83ddbed3af 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -80,8 +80,8 @@ union acpi_parse_object;
80 * table below also! 80 * table below also!
81 */ 81 */
82#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */ 82#define ACPI_MTX_INTERPRETER 0 /* AML Interpreter, main lock */
83#define ACPI_MTX_TABLES 1 /* Data for ACPI tables */ 83#define ACPI_MTX_NAMESPACE 1 /* ACPI Namespace */
84#define ACPI_MTX_NAMESPACE 2 /* ACPI Namespace */ 84#define ACPI_MTX_TABLES 2 /* Data for ACPI tables */
85#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */ 85#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
86#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */ 86#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
87#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */ 87#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
@@ -162,7 +162,7 @@ struct acpi_mutex_info {
162typedef enum { 162typedef enum {
163 ACPI_IMODE_LOAD_PASS1 = 0x01, 163 ACPI_IMODE_LOAD_PASS1 = 0x01,
164 ACPI_IMODE_LOAD_PASS2 = 0x02, 164 ACPI_IMODE_LOAD_PASS2 = 0x02,
165 ACPI_IMODE_EXECUTE = 0x0E 165 ACPI_IMODE_EXECUTE = 0x03
166} acpi_interpreter_mode; 166} acpi_interpreter_mode;
167 167
168union acpi_name_union { 168union acpi_name_union {
@@ -204,7 +204,7 @@ struct acpi_namespace_node {
204/* Namespace Node flags */ 204/* Namespace Node flags */
205 205
206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */ 206#define ANOBJ_END_OF_PEER_LIST 0x01 /* End-of-list, Peer field points to parent */
207#define ANOBJ_RESERVED 0x02 /* Available for future use */ 207#define ANOBJ_TEMPORARY 0x02 /* Node is create by a method and is temporary */
208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */ 208#define ANOBJ_METHOD_ARG 0x04 /* Node is a method argument */
209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */ 209#define ANOBJ_METHOD_LOCAL 0x08 /* Node is a method local */
210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */ 210#define ANOBJ_SUBTREE_HAS_INI 0x10 /* Used to optimize device initialization */
@@ -219,25 +219,42 @@ struct acpi_namespace_node {
219 * ACPI Table Descriptor. One per ACPI table 219 * ACPI Table Descriptor. One per ACPI table
220 */ 220 */
221struct acpi_table_desc { 221struct acpi_table_desc {
222 struct acpi_table_desc *prev; 222 acpi_physical_address address;
223 struct acpi_table_desc *next;
224 struct acpi_table_desc *installed_desc;
225 struct acpi_table_header *pointer; 223 struct acpi_table_header *pointer;
226 u8 *aml_start; 224 u32 length; /* Length fixed at 32 bits */
227 u64 physical_address; 225 union acpi_name_union signature;
228 acpi_size length;
229 u32 aml_length;
230 acpi_owner_id owner_id; 226 acpi_owner_id owner_id;
231 u8 type; 227 u8 flags;
232 u8 allocation;
233 u8 loaded_into_namespace;
234}; 228};
235 229
236struct acpi_table_list { 230/* Flags for above */
237 struct acpi_table_desc *next; 231
232#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
233#define ACPI_TABLE_ORIGIN_MAPPED (1)
234#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
235#define ACPI_TABLE_ORIGIN_MASK (3)
236#define ACPI_TABLE_IS_LOADED (4)
237
238/* One internal RSDT for table management */
239
240struct acpi_internal_rsdt {
241 struct acpi_table_desc *tables;
238 u32 count; 242 u32 count;
243 u32 size;
244 u8 flags;
239}; 245};
240 246
247/* Flags for above */
248
249#define ACPI_ROOT_ORIGIN_UNKNOWN (0) /* ~ORIGIN_ALLOCATED */
250#define ACPI_ROOT_ORIGIN_ALLOCATED (1)
251#define ACPI_ROOT_ALLOW_RESIZE (2)
252
253/* Predefined (fixed) table indexes */
254
255#define ACPI_TABLE_INDEX_DSDT (0)
256#define ACPI_TABLE_INDEX_FACS (1)
257
241struct acpi_find_context { 258struct acpi_find_context {
242 char *search_for; 259 char *search_for;
243 acpi_handle *list; 260 acpi_handle *list;
@@ -350,7 +367,7 @@ struct acpi_gpe_event_info {
350 union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */ 367 union acpi_gpe_dispatch_info dispatch; /* Either Method or Handler */
351 struct acpi_gpe_register_info *register_info; /* Backpointer to register info */ 368 struct acpi_gpe_register_info *register_info; /* Backpointer to register info */
352 u8 flags; /* Misc info about this GPE */ 369 u8 flags; /* Misc info about this GPE */
353 u8 register_bit; /* This GPE bit within the register */ 370 u8 gpe_number; /* This GPE */
354}; 371};
355 372
356/* Information about a GPE register pair, one per each status/enable pair in an array */ 373/* Information about a GPE register pair, one per each status/enable pair in an array */
@@ -855,12 +872,30 @@ struct acpi_bit_register_info {
855 ****************************************************************************/ 872 ****************************************************************************/
856 873
857struct acpi_db_method_info { 874struct acpi_db_method_info {
858 acpi_handle thread_gate; 875 acpi_handle main_thread_gate;
876 acpi_handle thread_complete_gate;
877 u32 *threads;
878 u32 num_threads;
879 u32 num_created;
880 u32 num_completed;
881
859 char *name; 882 char *name;
860 char **args;
861 u32 flags; 883 u32 flags;
862 u32 num_loops; 884 u32 num_loops;
863 char pathname[128]; 885 char pathname[128];
886 char **args;
887
888 /*
889 * Arguments to be passed to method for the command
890 * Threads -
891 * the Number of threads, ID of current thread and
892 * Index of current thread inside all them created.
893 */
894 char init_args;
895 char *arguments[4];
896 char num_threads_str[11];
897 char id_of_thread_str[11];
898 char index_of_thread_str[11];
864}; 899};
865 900
866struct acpi_integrity_info { 901struct acpi_integrity_info {
@@ -919,6 +954,8 @@ struct acpi_memory_list {
919 954
920 u32 total_allocated; 955 u32 total_allocated;
921 u32 total_freed; 956 u32 total_freed;
957 u32 max_occupied;
958 u32 total_size;
922 u32 current_total_size; 959 u32 current_total_size;
923 u32 requests; 960 u32 requests;
924 u32 hits; 961 u32 hits;
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 192fa095a515..8948a6461834 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -55,25 +55,12 @@
55#define ACPI_SET_BIT(target,bit) ((target) |= (bit)) 55#define ACPI_SET_BIT(target,bit) ((target) |= (bit))
56#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit)) 56#define ACPI_CLEAR_BIT(target,bit) ((target) &= ~(bit))
57#define ACPI_MIN(a,b) (((a)<(b))?(a):(b)) 57#define ACPI_MIN(a,b) (((a)<(b))?(a):(b))
58#define ACPI_MAX(a,b) (((a)>(b))?(a):(b))
58 59
59/* Size calculation */ 60/* Size calculation */
60 61
61#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) 62#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
62 63
63#if ACPI_MACHINE_WIDTH == 16
64
65/*
66 * For 16-bit addresses, we have to assume that the upper 32 bits
67 * (out of 64) are zero.
68 */
69#define ACPI_LODWORD(l) ((u32)(l))
70#define ACPI_HIDWORD(l) ((u32)(0))
71
72#define ACPI_GET_ADDRESS(a) ((a).lo)
73#define ACPI_STORE_ADDRESS(a,b) {(a).hi=0;(a).lo=(u32)(b);}
74#define ACPI_VALID_ADDRESS(a) ((a).hi | (a).lo)
75
76#else
77#ifdef ACPI_NO_INTEGER64_SUPPORT 64#ifdef ACPI_NO_INTEGER64_SUPPORT
78/* 65/*
79 * acpi_integer is 32-bits, no 64-bit support on this platform 66 * acpi_integer is 32-bits, no 64-bit support on this platform
@@ -81,10 +68,6 @@
81#define ACPI_LODWORD(l) ((u32)(l)) 68#define ACPI_LODWORD(l) ((u32)(l))
82#define ACPI_HIDWORD(l) ((u32)(0)) 69#define ACPI_HIDWORD(l) ((u32)(0))
83 70
84#define ACPI_GET_ADDRESS(a) (a)
85#define ACPI_STORE_ADDRESS(a,b) ((a)=(b))
86#define ACPI_VALID_ADDRESS(a) (a)
87
88#else 71#else
89 72
90/* 73/*
@@ -92,11 +75,6 @@
92 */ 75 */
93#define ACPI_LODWORD(l) ((u32)(u64)(l)) 76#define ACPI_LODWORD(l) ((u32)(u64)(l))
94#define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi)) 77#define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
95
96#define ACPI_GET_ADDRESS(a) (a)
97#define ACPI_STORE_ADDRESS(a,b) ((a)=(acpi_physical_address)(b))
98#define ACPI_VALID_ADDRESS(a) (a)
99#endif
100#endif 78#endif
101 79
102/* 80/*
@@ -134,15 +112,8 @@
134#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) 112#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
135#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 113#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
136#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 114#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
137
138#if ACPI_MACHINE_WIDTH == 16
139#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
140#define ACPI_PHYSADDR_TO_PTR(i) (void *)(i)
141#define ACPI_PTR_TO_PHYSADDR(i) (u32) ACPI_CAST_PTR (u8,(i))
142#else
143#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 115#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
144#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 116#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
145#endif
146 117
147#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED 118#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
148#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b))) 119#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b)))
@@ -223,28 +194,6 @@
223 194
224/* The hardware supports unaligned transfers, just do the little-endian move */ 195/* The hardware supports unaligned transfers, just do the little-endian move */
225 196
226#if ACPI_MACHINE_WIDTH == 16
227
228/* No 64-bit integers */
229/* 16-bit source, 16/32/64 destination */
230
231#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
232#define ACPI_MOVE_16_TO_32(d,s) *(u32 *)(void *)(d) = *(u16 *)(void *)(s)
233#define ACPI_MOVE_16_TO_64(d,s) ACPI_MOVE_16_TO_32(d,s)
234
235/* 32-bit source, 16/32/64 destination */
236
237#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
238#define ACPI_MOVE_32_TO_32(d,s) *(u32 *)(void *)(d) = *(u32 *)(void *)(s)
239#define ACPI_MOVE_32_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
240
241/* 64-bit source, 16/32/64 destination */
242
243#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
244#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
245#define ACPI_MOVE_64_TO_64(d,s) ACPI_MOVE_32_TO_32(d,s)
246
247#else
248/* 16-bit source, 16/32/64 destination */ 197/* 16-bit source, 16/32/64 destination */
249 198
250#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s) 199#define ACPI_MOVE_16_TO_16(d,s) *(u16 *)(void *)(d) = *(u16 *)(void *)(s)
@@ -262,7 +211,6 @@
262#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 211#define ACPI_MOVE_64_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
263#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */ 212#define ACPI_MOVE_64_TO_32(d,s) ACPI_MOVE_32_TO_32(d,s) /* Truncate to 32 */
264#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s) 213#define ACPI_MOVE_64_TO_64(d,s) *(u64 *)(void *)(d) = *(u64 *)(void *)(s)
265#endif
266 214
267#else 215#else
268/* 216/*
@@ -307,10 +255,7 @@
307 255
308/* Macros based on machine integer width */ 256/* Macros based on machine integer width */
309 257
310#if ACPI_MACHINE_WIDTH == 16 258#if ACPI_MACHINE_WIDTH == 32
311#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s)
312
313#elif ACPI_MACHINE_WIDTH == 32
314#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s) 259#define ACPI_MOVE_SIZE_TO_16(d,s) ACPI_MOVE_32_TO_16(d,s)
315 260
316#elif ACPI_MACHINE_WIDTH == 64 261#elif ACPI_MACHINE_WIDTH == 64
@@ -695,16 +640,6 @@
695#define ACPI_DEBUGGER_EXEC(a) 640#define ACPI_DEBUGGER_EXEC(a)
696#endif 641#endif
697 642
698/*
699 * For 16-bit code, we want to shrink some things even though
700 * we are using ACPI_DEBUG_OUTPUT to get the debug output
701 */
702#if ACPI_MACHINE_WIDTH == 16
703#undef ACPI_DEBUG_ONLY_MEMBERS
704#undef _VERBOSE_STRUCTURES
705#define ACPI_DEBUG_ONLY_MEMBERS(a)
706#endif
707
708#ifdef ACPI_DEBUG_OUTPUT 643#ifdef ACPI_DEBUG_OUTPUT
709/* 644/*
710 * 1) Set name to blanks 645 * 1) Set name to blanks
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index b67da3636899..34bfae8a05f3 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index 83b52f9f899a..535b7e1c41bc 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -65,9 +65,13 @@
65#define ACPI_NS_ERROR_IF_FOUND 0x08 65#define ACPI_NS_ERROR_IF_FOUND 0x08
66#define ACPI_NS_PREFIX_IS_SCOPE 0x10 66#define ACPI_NS_PREFIX_IS_SCOPE 0x10
67#define ACPI_NS_EXTERNAL 0x20 67#define ACPI_NS_EXTERNAL 0x20
68#define ACPI_NS_TEMPORARY 0x40
68 69
69#define ACPI_NS_WALK_UNLOCK TRUE 70/* Flags for acpi_ns_walk_namespace */
70#define ACPI_NS_WALK_NO_UNLOCK FALSE 71
72#define ACPI_NS_WALK_NO_UNLOCK 0
73#define ACPI_NS_WALK_UNLOCK 0x01
74#define ACPI_NS_WALK_TEMP_NODES 0x02
71 75
72/* 76/*
73 * nsinit - Namespace initialization 77 * nsinit - Namespace initialization
@@ -82,7 +86,7 @@ acpi_status acpi_ns_initialize_devices(void);
82acpi_status acpi_ns_load_namespace(void); 86acpi_status acpi_ns_load_namespace(void);
83 87
84acpi_status 88acpi_status
85acpi_ns_load_table(struct acpi_table_desc *table_desc, 89acpi_ns_load_table(acpi_native_uint table_index,
86 struct acpi_namespace_node *node); 90 struct acpi_namespace_node *node);
87 91
88/* 92/*
@@ -92,7 +96,7 @@ acpi_status
92acpi_ns_walk_namespace(acpi_object_type type, 96acpi_ns_walk_namespace(acpi_object_type type,
93 acpi_handle start_object, 97 acpi_handle start_object,
94 u32 max_depth, 98 u32 max_depth,
95 u8 unlock_before_callback, 99 u32 flags,
96 acpi_walk_callback user_function, 100 acpi_walk_callback user_function,
97 void *context, void **return_value); 101 void *context, void **return_value);
98 102
@@ -106,11 +110,12 @@ struct acpi_namespace_node *acpi_ns_get_next_node(acpi_object_type type,
106 * nsparse - table parsing 110 * nsparse - table parsing
107 */ 111 */
108acpi_status 112acpi_status
109acpi_ns_parse_table(struct acpi_table_desc *table_desc, 113acpi_ns_parse_table(acpi_native_uint table_index,
110 struct acpi_namespace_node *scope); 114 struct acpi_namespace_node *start_node);
111 115
112acpi_status 116acpi_status
113acpi_ns_one_complete_parse(u8 pass_number, struct acpi_table_desc *table_desc); 117acpi_ns_one_complete_parse(acpi_native_uint pass_number,
118 acpi_native_uint table_index);
114 119
115/* 120/*
116 * nsaccess - Top-level namespace access 121 * nsaccess - Top-level namespace access
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 8fdee31119f3..04e9735a6742 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2006, R. Byron Moore 9 * Copyright (C) 2000 - 2007, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -52,7 +52,15 @@
52 * to the interpreter, and to keep track of the various handlers such as 52 * to the interpreter, and to keep track of the various handlers such as
53 * address space handlers and notify handlers. The object is a constant 53 * address space handlers and notify handlers. The object is a constant
54 * size in order to allow it to be cached and reused. 54 * size in order to allow it to be cached and reused.
55 *
56 * Note: The object is optimized to be aligned and will not work if it is
57 * byte-packed.
55 */ 58 */
59#if ACPI_MACHINE_WIDTH == 64
60#pragma pack(8)
61#else
62#pragma pack(4)
63#endif
56 64
57/******************************************************************************* 65/*******************************************************************************
58 * 66 *
@@ -101,7 +109,8 @@ struct acpi_object_common {
101ACPI_OBJECT_COMMON_HEADER}; 109ACPI_OBJECT_COMMON_HEADER};
102 110
103struct acpi_object_integer { 111struct acpi_object_integer {
104 ACPI_OBJECT_COMMON_HEADER acpi_integer value; 112 ACPI_OBJECT_COMMON_HEADER u8 fill[3]; /* Prevent warning on some compilers */
113 acpi_integer value;
105}; 114};
106 115
107/* 116/*
@@ -203,7 +212,9 @@ struct acpi_object_power_resource {
203}; 212};
204 213
205struct acpi_object_processor { 214struct acpi_object_processor {
206 ACPI_OBJECT_COMMON_HEADER u8 proc_id; 215 ACPI_OBJECT_COMMON_HEADER
216 /* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
217 u8 proc_id;
207 u8 length; 218 u8 length;
208 ACPI_COMMON_NOTIFY_INFO acpi_io_address address; 219 ACPI_COMMON_NOTIFY_INFO acpi_io_address address;
209}; 220};
@@ -406,4 +417,6 @@ union acpi_descriptor {
406 union acpi_parse_object op; 417 union acpi_parse_object op;
407}; 418};
408 419
420#pragma pack()
421
409#endif /* _ACOBJECT_H */ 422#endif /* _ACOBJECT_H */
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index 7659a46bc432..e6f76a280a94 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -257,7 +257,7 @@
257#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE 257#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
258#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER) 258#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
259#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE 259#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
260#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_FIELD,ARGI_TARGETREF) 260#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_BUFFER,ARGI_TARGETREF)
261#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE) 261#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
262#define ARGI_LOCAL0 ARG_NONE 262#define ARGI_LOCAL0 ARG_NONE
263#define ARGI_LOCAL1 ARG_NONE 263#define ARGI_LOCAL1 ARG_NONE
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index 8d5039d0b430..7812267b577f 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 9d49d3c41cd9..85c358e21014 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index b9a39d1009bd..2e5f00d3ea0d 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index fdd10953b2b6..0d9f984a60a1 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -59,7 +59,6 @@ acpi_evaluate_reference(acpi_handle handle,
59 59
60#define ACPI_BUS_FILE_ROOT "acpi" 60#define ACPI_BUS_FILE_ROOT "acpi"
61extern struct proc_dir_entry *acpi_root_dir; 61extern struct proc_dir_entry *acpi_root_dir;
62extern struct fadt_descriptor acpi_fadt;
63 62
64enum acpi_bus_removal_type { 63enum acpi_bus_removal_type {
65 ACPI_BUS_REMOVAL_NORMAL = 0, 64 ACPI_BUS_REMOVAL_NORMAL = 0,
@@ -92,13 +91,12 @@ typedef int (*acpi_op_remove) (struct acpi_device * device, int type);
92typedef int (*acpi_op_lock) (struct acpi_device * device, int type); 91typedef int (*acpi_op_lock) (struct acpi_device * device, int type);
93typedef int (*acpi_op_start) (struct acpi_device * device); 92typedef int (*acpi_op_start) (struct acpi_device * device);
94typedef int (*acpi_op_stop) (struct acpi_device * device, int type); 93typedef int (*acpi_op_stop) (struct acpi_device * device, int type);
95typedef int (*acpi_op_suspend) (struct acpi_device * device, int state); 94typedef int (*acpi_op_suspend) (struct acpi_device * device, pm_message_t state);
96typedef int (*acpi_op_resume) (struct acpi_device * device, int state); 95typedef int (*acpi_op_resume) (struct acpi_device * device);
97typedef int (*acpi_op_scan) (struct acpi_device * device); 96typedef int (*acpi_op_scan) (struct acpi_device * device);
98typedef int (*acpi_op_bind) (struct acpi_device * device); 97typedef int (*acpi_op_bind) (struct acpi_device * device);
99typedef int (*acpi_op_unbind) (struct acpi_device * device); 98typedef int (*acpi_op_unbind) (struct acpi_device * device);
100typedef int (*acpi_op_match) (struct acpi_device * device, 99typedef int (*acpi_op_shutdown) (struct acpi_device * device);
101 struct acpi_driver * driver);
102 100
103struct acpi_bus_ops { 101struct acpi_bus_ops {
104 u32 acpi_op_add:1; 102 u32 acpi_op_add:1;
@@ -111,7 +109,7 @@ struct acpi_bus_ops {
111 u32 acpi_op_scan:1; 109 u32 acpi_op_scan:1;
112 u32 acpi_op_bind:1; 110 u32 acpi_op_bind:1;
113 u32 acpi_op_unbind:1; 111 u32 acpi_op_unbind:1;
114 u32 acpi_op_match:1; 112 u32 acpi_op_shutdown:1;
115 u32 reserved:21; 113 u32 reserved:21;
116}; 114};
117 115
@@ -126,16 +124,16 @@ struct acpi_device_ops {
126 acpi_op_scan scan; 124 acpi_op_scan scan;
127 acpi_op_bind bind; 125 acpi_op_bind bind;
128 acpi_op_unbind unbind; 126 acpi_op_unbind unbind;
129 acpi_op_match match; 127 acpi_op_shutdown shutdown;
130}; 128};
131 129
132struct acpi_driver { 130struct acpi_driver {
133 struct list_head node;
134 char name[80]; 131 char name[80];
135 char class[80]; 132 char class[80];
136 atomic_t references;
137 char *ids; /* Supported Hardware IDs */ 133 char *ids; /* Supported Hardware IDs */
138 struct acpi_device_ops ops; 134 struct acpi_device_ops ops;
135 struct device_driver drv;
136 struct module *owner;
139}; 137};
140 138
141/* 139/*
@@ -185,7 +183,7 @@ struct acpi_device_dir {
185 183
186typedef char acpi_bus_id[5]; 184typedef char acpi_bus_id[5];
187typedef unsigned long acpi_bus_address; 185typedef unsigned long acpi_bus_address;
188typedef char acpi_hardware_id[9]; 186typedef char acpi_hardware_id[15];
189typedef char acpi_unique_id[9]; 187typedef char acpi_unique_id[9];
190typedef char acpi_device_name[40]; 188typedef char acpi_device_name[40];
191typedef char acpi_device_class[20]; 189typedef char acpi_device_class[20];
@@ -296,11 +294,14 @@ struct acpi_device {
296 struct acpi_device_ops ops; 294 struct acpi_device_ops ops;
297 struct acpi_driver *driver; 295 struct acpi_driver *driver;
298 void *driver_data; 296 void *driver_data;
299 struct kobject kobj;
300 struct device dev; 297 struct device dev;
298 struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */
299 enum acpi_bus_removal_type removal_type; /* indicate for different removal type */
301}; 300};
302 301
303#define acpi_driver_data(d) ((d)->driver_data) 302#define acpi_driver_data(d) ((d)->driver_data)
303#define to_acpi_device(d) container_of(d, struct acpi_device, dev)
304#define to_acpi_driver(d) container_of(d, struct acpi_driver, drv)
304 305
305/* 306/*
306 * Events 307 * Events
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 6a5bdcefec64..4dc8a5043ef0 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -36,13 +36,14 @@
36 36
37/* _HID definitions */ 37/* _HID definitions */
38 38
39#define ACPI_POWER_HID "ACPI_PWR" 39#define ACPI_POWER_HID "power_resource"
40#define ACPI_PROCESSOR_HID "ACPI_CPU" 40#define ACPI_PROCESSOR_HID "ACPI0007"
41#define ACPI_SYSTEM_HID "ACPI_SYS" 41#define ACPI_SYSTEM_HID "acpi_system"
42#define ACPI_THERMAL_HID "ACPI_THM" 42#define ACPI_THERMAL_HID "thermal"
43#define ACPI_BUTTON_HID_POWERF "ACPI_FPB" 43#define ACPI_BUTTON_HID_POWERF "button_power"
44#define ACPI_BUTTON_HID_SLEEPF "ACPI_FSB" 44#define ACPI_BUTTON_HID_SLEEPF "button_sleep"
45 45#define ACPI_VIDEO_HID "video"
46#define ACPI_BAY_HID "bay"
46/* -------------------------------------------------------------------------- 47/* --------------------------------------------------------------------------
47 PCI 48 PCI
48 -------------------------------------------------------------------------- */ 49 -------------------------------------------------------------------------- */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 0cd63bce0ae4..781394b9efe0 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -8,7 +8,7 @@
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
10/* 10/*
11 * Copyright (C) 2000 - 2006, R. Byron Moore 11 * Copyright (C) 2000 - 2007, R. Byron Moore
12 * All rights reserved. 12 * All rights reserved.
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
@@ -85,7 +85,7 @@ acpi_status acpi_os_terminate(void);
85/* 85/*
86 * ACPI Table interfaces 86 * ACPI Table interfaces
87 */ 87 */
88acpi_status acpi_os_get_root_pointer(u32 flags, struct acpi_pointer *address); 88acpi_physical_address acpi_os_get_root_pointer(void);
89 89
90acpi_status 90acpi_status
91acpi_os_predefined_override(const struct acpi_predefined_names *init_val, 91acpi_os_predefined_override(const struct acpi_predefined_names *init_val,
@@ -143,9 +143,7 @@ void acpi_os_release_mutex(acpi_mutex handle);
143 */ 143 */
144void *acpi_os_allocate(acpi_size size); 144void *acpi_os_allocate(acpi_size size);
145 145
146acpi_status 146void __iomem *acpi_os_map_memory(acpi_physical_address where, acpi_native_uint length);
147acpi_os_map_memory(acpi_physical_address physical_address,
148 acpi_size size, void __iomem ** logical_address);
149 147
150void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size); 148void acpi_os_unmap_memory(void __iomem * logical_address, acpi_size size);
151 149
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 81458767a90e..e08f7df85a4f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2006, R. Byron Moore 9 * Copyright (C) 2000 - 2007, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -51,6 +51,10 @@
51/* 51/*
52 * Global interfaces 52 * Global interfaces
53 */ 53 */
54acpi_status
55acpi_initialize_tables(struct acpi_table_desc *initial_storage,
56 u32 initial_table_count, u8 allow_resize);
57
54acpi_status acpi_initialize_subsystem(void); 58acpi_status acpi_initialize_subsystem(void);
55 59
56acpi_status acpi_enable_subsystem(u32 flags); 60acpi_status acpi_enable_subsystem(u32 flags);
@@ -92,30 +96,28 @@ void acpi_free(void *address);
92/* 96/*
93 * ACPI table manipulation interfaces 97 * ACPI table manipulation interfaces
94 */ 98 */
95acpi_status 99acpi_status acpi_reallocate_root_table(void);
96acpi_find_root_pointer(u32 flags, struct acpi_pointer *rsdp_address); 100
101acpi_status acpi_find_root_pointer(acpi_native_uint * rsdp_address);
97 102
98acpi_status acpi_load_tables(void); 103acpi_status acpi_load_tables(void);
99 104
100acpi_status acpi_load_table(struct acpi_table_header *table_ptr); 105acpi_status acpi_load_table(struct acpi_table_header *table_ptr);
101 106
102acpi_status acpi_unload_table_id(acpi_table_type table_type, acpi_owner_id id); 107acpi_status acpi_unload_table_id(acpi_owner_id id);
103 108
104#ifdef ACPI_FUTURE_USAGE
105acpi_status acpi_unload_table(acpi_table_type table_type);
106acpi_status 109acpi_status
107acpi_get_table_header(acpi_table_type table_type, 110acpi_get_table_header(acpi_string signature,
108 u32 instance, struct acpi_table_header *out_table_header); 111 acpi_native_uint instance,
109#endif /* ACPI_FUTURE_USAGE */ 112 struct acpi_table_header *out_table_header);
110 113
111acpi_status 114acpi_status
112acpi_get_table(acpi_table_type table_type, 115acpi_get_table(acpi_string signature,
113 u32 instance, struct acpi_buffer *ret_buffer); 116 acpi_native_uint instance, struct acpi_table_header **out_table);
114 117
115acpi_status 118acpi_status
116acpi_get_firmware_table(acpi_string signature, 119acpi_get_table_by_index(acpi_native_uint table_index,
117 u32 instance, 120 struct acpi_table_header **out_table);
118 u32 flags, struct acpi_table_header **table_pointer);
119 121
120/* 122/*
121 * Namespace and name interfaces 123 * Namespace and name interfaces
@@ -310,9 +312,9 @@ acpi_resource_to_address64(struct acpi_resource *resource,
310/* 312/*
311 * Hardware (ACPI device) interfaces 313 * Hardware (ACPI device) interfaces
312 */ 314 */
313acpi_status acpi_get_register(u32 register_id, u32 * return_value, u32 flags); 315acpi_status acpi_get_register(u32 register_id, u32 * return_value);
314 316
315acpi_status acpi_set_register(u32 register_id, u32 value, u32 flags); 317acpi_status acpi_set_register(u32 register_id, u32 value);
316 318
317acpi_status 319acpi_status
318acpi_set_firmware_waking_vector(acpi_physical_address physical_address); 320acpi_set_firmware_waking_vector(acpi_physical_address physical_address);
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 80a3b33571b4..9486ab266a5e 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 5e8095f0f78f..aeb4498e5e06 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -139,7 +139,8 @@ struct acpi_init_walk_info {
139 u16 buffer_init; 139 u16 buffer_init;
140 u16 package_init; 140 u16 package_init;
141 u16 object_count; 141 u16 object_count;
142 struct acpi_table_desc *table_desc; 142 acpi_owner_id owner_id;
143 acpi_native_uint table_index;
143}; 144};
144 145
145struct acpi_get_devices_info { 146struct acpi_get_devices_info {
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 4dbaf02fe526..2b9f46f9da4d 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -44,105 +44,75 @@
44#ifndef __ACTABLES_H__ 44#ifndef __ACTABLES_H__
45#define __ACTABLES_H__ 45#define __ACTABLES_H__
46 46
47/* Used in acpi_tb_map_acpi_table for size parameter if table header is to be used */ 47acpi_status acpi_allocate_root_table(u32 initial_table_count);
48
49#define SIZE_IN_HEADER 0
50 48
51/* 49/*
52 * tbconvrt - Table conversion routines 50 * tbfadt - FADT parse/convert/validate
53 */ 51 */
54acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info); 52void acpi_tb_parse_fadt(acpi_native_uint table_index, u8 flags);
55
56acpi_status acpi_tb_convert_table_fadt(void);
57 53
58acpi_status acpi_tb_build_common_facs(struct acpi_table_desc *table_info); 54void acpi_tb_create_local_fadt(struct acpi_table_header *table, u32 length);
59
60u32
61acpi_tb_get_table_count(struct rsdp_descriptor *RSDP,
62 struct acpi_table_header *RSDT);
63 55
64/* 56/*
65 * tbget - Table "get" routines 57 * tbfind - find ACPI table
66 */ 58 */
67acpi_status 59acpi_status
68acpi_tb_get_table(struct acpi_pointer *address, 60acpi_tb_find_table(char *signature,
69 struct acpi_table_desc *table_info); 61 char *oem_id,
70 62 char *oem_table_id, acpi_native_uint * table_index);
71acpi_status
72acpi_tb_get_table_header(struct acpi_pointer *address,
73 struct acpi_table_header *return_header);
74
75acpi_status
76acpi_tb_get_table_body(struct acpi_pointer *address,
77 struct acpi_table_header *header,
78 struct acpi_table_desc *table_info);
79
80acpi_status
81acpi_tb_get_table_ptr(acpi_table_type table_type,
82 u32 instance, struct acpi_table_header **table_ptr_loc);
83
84acpi_status acpi_tb_verify_rsdp(struct acpi_pointer *address);
85
86void acpi_tb_get_rsdt_address(struct acpi_pointer *out_address);
87
88acpi_status acpi_tb_validate_rsdt(struct acpi_table_header *table_ptr);
89 63
90/* 64/*
91 * tbgetall - get multiple required tables 65 * tbinstal - Table removal and deletion
92 */ 66 */
93acpi_status acpi_tb_get_required_tables(void); 67acpi_status acpi_tb_resize_root_table_list(void);
94 68
95/* 69acpi_status acpi_tb_verify_table(struct acpi_table_desc *table_desc);
96 * tbinstall - Table installation
97 */
98acpi_status acpi_tb_install_table(struct acpi_table_desc *table_info);
99 70
100acpi_status 71acpi_status
101acpi_tb_recognize_table(struct acpi_table_desc *table_info, u8 search_type); 72acpi_tb_add_table(struct acpi_table_desc *table_desc,
73 acpi_native_uint * table_index);
102 74
103acpi_status 75acpi_status
104acpi_tb_init_table_descriptor(acpi_table_type table_type, 76acpi_tb_store_table(acpi_physical_address address,
105 struct acpi_table_desc *table_info); 77 struct acpi_table_header *table,
78 u32 length, u8 flags, acpi_native_uint * table_index);
106 79
107/* 80void acpi_tb_delete_table(struct acpi_table_desc *table_desc);
108 * tbremove - Table removal and deletion
109 */
110void acpi_tb_delete_all_tables(void);
111 81
112void acpi_tb_delete_tables_by_type(acpi_table_type type); 82void acpi_tb_terminate(void);
113 83
114void acpi_tb_delete_single_table(struct acpi_table_desc *table_desc); 84void acpi_tb_delete_namespace_by_owner(acpi_native_uint table_index);
115 85
116struct acpi_table_desc *acpi_tb_uninstall_table(struct acpi_table_desc 86acpi_status acpi_tb_allocate_owner_id(acpi_native_uint table_index);
117 *table_desc); 87
88acpi_status acpi_tb_release_owner_id(acpi_native_uint table_index);
118 89
119/*
120 * tbxfroot - RSDP, RSDT utilities
121 */
122acpi_status 90acpi_status
123acpi_tb_find_table(char *signature, 91acpi_tb_get_owner_id(acpi_native_uint table_index, acpi_owner_id * owner_id);
124 char *oem_id,
125 char *oem_table_id, struct acpi_table_header **table_ptr);
126 92
127acpi_status acpi_tb_get_table_rsdt(void); 93u8 acpi_tb_is_table_loaded(acpi_native_uint table_index);
128 94
129acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp); 95void acpi_tb_set_table_loaded_flag(acpi_native_uint table_index, u8 is_loaded);
130 96
131/* 97/*
132 * tbutils - common table utilities 98 * tbutils - table manager utilities
133 */ 99 */
134acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc); 100u8 acpi_tb_tables_loaded(void);
135 101
136acpi_status 102void
137acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); 103acpi_tb_print_table_header(acpi_physical_address address,
104 struct acpi_table_header *header);
138 105
139u8 acpi_tb_sum_table(void *buffer, u32 length); 106u8 acpi_tb_checksum(u8 * buffer, acpi_native_uint length);
140 107
141u8 acpi_tb_generate_checksum(struct acpi_table_header *table); 108acpi_status
109acpi_tb_verify_checksum(struct acpi_table_header *table, u32 length);
142 110
143void acpi_tb_set_checksum(struct acpi_table_header *table); 111void
112acpi_tb_install_table(acpi_physical_address address,
113 u8 flags, char *signature, acpi_native_uint table_index);
144 114
145acpi_status 115acpi_status
146acpi_tb_validate_table_header(struct acpi_table_header *table_header); 116acpi_tb_parse_root_table(acpi_physical_address rsdp_address, u8 flags);
147 117
148#endif /* __ACTABLES_H__ */ 118#endif /* __ACTABLES_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index b125ceed9cb7..09469e7db6a5 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -48,15 +48,15 @@
48 * Values for description table header signatures. Useful because they make 48 * Values for description table header signatures. Useful because they make
49 * it more difficult to inadvertently type in the wrong signature. 49 * it more difficult to inadvertently type in the wrong signature.
50 */ 50 */
51#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ 51#define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */
52#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ 52#define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */
53#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ 53#define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */
54#define PSDT_SIG "PSDT" /* Persistent System Description Table */ 54#define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */
55#define RSDP_SIG "RSD PTR " /* Root System Description Pointer */ 55#define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */
56#define RSDT_SIG "RSDT" /* Root System Description Table */ 56#define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */
57#define XSDT_SIG "XSDT" /* Extended System Description Table */ 57#define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */
58#define SSDT_SIG "SSDT" /* Secondary System Description Table */ 58#define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */
59#define RSDP_NAME "RSDP" 59#define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */
60 60
61/* 61/*
62 * All tables and structures must be byte-packed to match the ACPI 62 * All tables and structures must be byte-packed to match the ACPI
@@ -83,27 +83,29 @@
83 * 83 *
84 ******************************************************************************/ 84 ******************************************************************************/
85 85
86#define ACPI_TABLE_HEADER_DEF \
87 char signature[4]; /* ASCII table signature */\
88 u32 length; /* Length of table in bytes, including this header */\
89 u8 revision; /* ACPI Specification minor version # */\
90 u8 checksum; /* To make sum of entire table == 0 */\
91 char oem_id[6]; /* ASCII OEM identification */\
92 char oem_table_id[8]; /* ASCII OEM table identification */\
93 u32 oem_revision; /* OEM revision number */\
94 char asl_compiler_id[4]; /* ASCII ASL compiler vendor ID */\
95 u32 asl_compiler_revision; /* ASL compiler version */
96
97struct acpi_table_header { 86struct acpi_table_header {
98ACPI_TABLE_HEADER_DEF}; 87 char signature[ACPI_NAME_SIZE]; /* ASCII table signature */
88 u32 length; /* Length of table in bytes, including this header */
89 u8 revision; /* ACPI Specification minor version # */
90 u8 checksum; /* To make sum of entire table == 0 */
91 char oem_id[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
92 char oem_table_id[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
93 u32 oem_revision; /* OEM revision number */
94 char asl_compiler_id[ACPI_NAME_SIZE]; /* ASCII ASL compiler vendor ID */
95 u32 asl_compiler_revision; /* ASL compiler version */
96};
99 97
100/* 98/*
101 * GAS - Generic Address Structure (ACPI 2.0+) 99 * GAS - Generic Address Structure (ACPI 2.0+)
100 *
101 * Note: Since this structure is used in the ACPI tables, it is byte aligned.
102 * If misalignment is not supported, access to the Address field must be
103 * performed with care.
102 */ 104 */
103struct acpi_generic_address { 105struct acpi_generic_address {
104 u8 address_space_id; /* Address space where struct or register exists */ 106 u8 space_id; /* Address space where struct or register exists */
105 u8 register_bit_width; /* Size in bits of given register */ 107 u8 bit_width; /* Size in bits of given register */
106 u8 register_bit_offset; /* Bit offset within the register */ 108 u8 bit_offset; /* Bit offset within the register */
107 u8 access_width; /* Minimum Access size (ACPI 3.0) */ 109 u8 access_width; /* Minimum Access size (ACPI 3.0) */
108 u64 address; /* 64-bit address of struct or register */ 110 u64 address; /* 64-bit address of struct or register */
109}; 111};
@@ -114,10 +116,10 @@ struct acpi_generic_address {
114 * 116 *
115 ******************************************************************************/ 117 ******************************************************************************/
116 118
117struct rsdp_descriptor { 119struct acpi_table_rsdp {
118 char signature[8]; /* ACPI signature, contains "RSD PTR " */ 120 char signature[8]; /* ACPI signature, contains "RSD PTR " */
119 u8 checksum; /* ACPI 1.0 checksum */ 121 u8 checksum; /* ACPI 1.0 checksum */
120 char oem_id[6]; /* OEM identification */ 122 char oem_id[ACPI_OEM_ID_SIZE]; /* OEM identification */
121 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */ 123 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
122 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */ 124 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
123 u32 length; /* Table length in bytes, including header (ACPI 2.0+) */ 125 u32 length; /* Table length in bytes, including header (ACPI 2.0+) */
@@ -134,12 +136,14 @@ struct rsdp_descriptor {
134 * 136 *
135 ******************************************************************************/ 137 ******************************************************************************/
136 138
137struct rsdt_descriptor { 139struct acpi_table_rsdt {
138 ACPI_TABLE_HEADER_DEF u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ 140 struct acpi_table_header header; /* Common ACPI table header */
141 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
139}; 142};
140 143
141struct xsdt_descriptor { 144struct acpi_table_xsdt {
142 ACPI_TABLE_HEADER_DEF u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */ 145 struct acpi_table_header header; /* Common ACPI table header */
146 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
143}; 147};
144 148
145/******************************************************************************* 149/*******************************************************************************
@@ -148,36 +152,27 @@ struct xsdt_descriptor {
148 * 152 *
149 ******************************************************************************/ 153 ******************************************************************************/
150 154
151struct facs_descriptor { 155struct acpi_table_facs {
152 char signature[4]; /* ASCII table signature */ 156 char signature[4]; /* ASCII table signature */
153 u32 length; /* Length of structure, in bytes */ 157 u32 length; /* Length of structure, in bytes */
154 u32 hardware_signature; /* Hardware configuration signature */ 158 u32 hardware_signature; /* Hardware configuration signature */
155 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */ 159 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */
156 u32 global_lock; /* Global Lock for shared hardware resources */ 160 u32 global_lock; /* Global Lock for shared hardware resources */
157 161 u32 flags;
158 /* Flags (32 bits) */
159
160 u8 S4bios_f:1; /* 00: S4BIOS support is present */
161 u8:7; /* 01-07: Reserved, must be zero */
162 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
163
164 u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */ 162 u64 xfirmware_waking_vector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */
165 u8 version; /* Version of this table (ACPI 2.0+) */ 163 u8 version; /* Version of this table (ACPI 2.0+) */
166 u8 reserved[31]; /* Reserved, must be zero */ 164 u8 reserved[31]; /* Reserved, must be zero */
167}; 165};
168 166
167/* Flag macros */
168
169#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
170
171/* Global lock flags */
172
169#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */ 173#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */
170#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */ 174#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */
171 175
172/*
173 * Common FACS - This is a version-independent FACS structure used for internal use only
174 */
175struct acpi_common_facs {
176 u32 *global_lock;
177 u64 *firmware_waking_vector;
178 u8 vector_width;
179};
180
181/******************************************************************************* 176/*******************************************************************************
182 * 177 *
183 * FADT - Fixed ACPI Description Table (Signature "FACP") 178 * FADT - Fixed ACPI Description Table (Signature "FACP")
@@ -186,121 +181,98 @@ struct acpi_common_facs {
186 181
187/* Fields common to all versions of the FADT */ 182/* Fields common to all versions of the FADT */
188 183
189#define ACPI_FADT_COMMON \ 184struct acpi_table_fadt {
190 ACPI_TABLE_HEADER_DEF \ 185 struct acpi_table_header header; /* Common ACPI table header */
191 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \ 186 u32 facs; /* 32-bit physical address of FACS */
192 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \ 187 u32 dsdt; /* 32-bit physical address of DSDT */
193 u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \ 188 u8 model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
194 u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \ 189 u8 preferred_profile; /* Conveys preferred power management profile to OSPM. */
195 u16 sci_int; /* System vector of SCI interrupt */ \ 190 u16 sci_interrupt; /* System vector of SCI interrupt */
196 u32 smi_cmd; /* Port address of SMI command port */ \ 191 u32 smi_command; /* 32-bit Port address of SMI command port */
197 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \ 192 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */
198 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \ 193 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */
199 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \ 194 u8 S4bios_request; /* Value to write to SMI CMD to enter S4BIOS state */
200 u8 pstate_cnt; /* Processor performance state control*/ \ 195 u8 pstate_control; /* Processor performance state control */
201 u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Event Reg Blk */ \ 196 u32 pm1a_event_block; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */
202 u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Event Reg Blk */ \ 197 u32 pm1b_event_block; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */
203 u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \ 198 u32 pm1a_control_block; /* 32-bit Port address of Power Mgt 1a Control Reg Blk */
204 u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \ 199 u32 pm1b_control_block; /* 32-bit Port address of Power Mgt 1b Control Reg Blk */
205 u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \ 200 u32 pm2_control_block; /* 32-bit Port address of Power Mgt 2 Control Reg Blk */
206 u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \ 201 u32 pm_timer_block; /* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */
207 u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \ 202 u32 gpe0_block; /* 32-bit Port address of General Purpose Event 0 Reg Blk */
208 u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \ 203 u32 gpe1_block; /* 32-bit Port address of General Purpose Event 1 Reg Blk */
209 u8 pm1_evt_len; /* Byte Length of ports at pm1_x_evt_blk */ \ 204 u8 pm1_event_length; /* Byte Length of ports at pm1x_event_block */
210 u8 pm1_cnt_len; /* Byte Length of ports at pm1_x_cnt_blk */ \ 205 u8 pm1_control_length; /* Byte Length of ports at pm1x_control_block */
211 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \ 206 u8 pm2_control_length; /* Byte Length of ports at pm2_control_block */
212 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \ 207 u8 pm_timer_length; /* Byte Length of ports at pm_timer_block */
213 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \ 208 u8 gpe0_block_length; /* Byte Length of ports at gpe0_block */
214 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \ 209 u8 gpe1_block_length; /* Byte Length of ports at gpe1_block */
215 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \ 210 u8 gpe1_base; /* Offset in GPE number space where GPE1 events start */
216 u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \ 211 u8 cst_control; /* Support for the _CST object and C States change notification */
217 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \ 212 u16 C2latency; /* Worst case HW latency to enter/exit C2 state */
218 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \ 213 u16 C3latency; /* Worst case HW latency to enter/exit C3 state */
219 u16 flush_size; /* Processor's memory cache line width, in bytes */ \ 214 u16 flush_size; /* Processor's memory cache line width, in bytes */
220 u16 flush_stride; /* Number of flush strides that need to be read */ \ 215 u16 flush_stride; /* Number of flush strides that need to be read */
221 u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \ 216 u8 duty_offset; /* Processor duty cycle index in processor's P_CNT reg */
222 u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \ 217 u8 duty_width; /* Processor duty cycle value bit width in P_CNT register. */
223 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \ 218 u8 day_alarm; /* Index to day-of-month alarm in RTC CMOS RAM */
224 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \ 219 u8 month_alarm; /* Index to month-of-year alarm in RTC CMOS RAM */
225 u8 century; /* Index to century in RTC CMOS RAM */ \ 220 u8 century; /* Index to century in RTC CMOS RAM */
226 u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/ \ 221 u16 boot_flags; /* IA-PC Boot Architecture Flags. See Table 5-10 for description */
227 u8 reserved2; /* Reserved, must be zero */ 222 u8 reserved; /* Reserved, must be zero */
228 223 u32 flags; /* Miscellaneous flag bits (see below for individual flags) */
229/* 224 struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */
230 * ACPI 2.0+ FADT
231 */
232struct fadt_descriptor {
233 ACPI_FADT_COMMON
234 /* Flags (32 bits) */
235 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */
236 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */
237 u8 proc_c1:1; /* 02: All processors support C1 state */
238 u8 plvl2_up:1; /* 03: C2 state works on MP system */
239 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */
240 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */
241 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */
242 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */
243 u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */
244 u8 dock_cap:1; /* 09: Docking supported */
245 u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */
246 u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */
247 u8 headless:1; /* 12: No local video capabilities or local input devices */
248 u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */
249
250 u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
251 u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
252 u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
253 u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */
254 u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
255 u8 force_apic_physical_destination_mode:1; /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */
256 u8:4; /* 20-23: Reserved, must be zero */
257 u8 reserved3; /* 24-31: Reserved, must be zero */
258
259 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
260 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 225 u8 reset_value; /* Value to write to the reset_register port to reset the system */
261 u8 reserved4[3]; /* These three bytes must be zero */ 226 u8 reserved4[3]; /* Reserved, must be zero */
262 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */ 227 u64 Xfacs; /* 64-bit physical address of FACS */
263 u64 Xdsdt; /* 64-bit physical address of DSDT */ 228 u64 Xdsdt; /* 64-bit physical address of DSDT */
264 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */ 229 struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
265 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */ 230 struct acpi_generic_address xpm1b_event_block; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */
266 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */ 231 struct acpi_generic_address xpm1a_control_block; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */
267 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */ 232 struct acpi_generic_address xpm1b_control_block; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */
268 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */ 233 struct acpi_generic_address xpm2_control_block; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */
269 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */ 234 struct acpi_generic_address xpm_timer_block; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
270 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */ 235 struct acpi_generic_address xgpe0_block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
271 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */ 236 struct acpi_generic_address xgpe1_block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
272}; 237};
273 238
274/* 239/* FADT flags */
275 * "Down-revved" ACPI 2.0 FADT descriptor 240
276 * Defined here to allow compiler to generate the length of the struct 241#define ACPI_FADT_WBINVD (1) /* 00: The wbinvd instruction works properly */
277 */ 242#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: The wbinvd flushes but does not invalidate */
278struct fadt_descriptor_rev2_minus { 243#define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: All processors support C1 state */
279 ACPI_FADT_COMMON u32 flags; 244#define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: C2 state works on MP system */
280 struct acpi_generic_address reset_register; /* Reset register address in GAS format */ 245#define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: Power button is handled as a generic feature */
281 u8 reset_value; /* Value to write to the reset_register port to reset the system. */ 246#define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: Sleep button is handled as a generic feature, or not present */
282 u8 reserved7[3]; /* Reserved, must be zero */ 247#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: RTC wakeup stat not in fixed register space */
283}; 248#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: RTC wakeup stat not possible from S4 */
249#define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: tmr_val is 32 bits 0=24-bits */
250#define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: Docking supported */
251#define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: System reset via the FADT RESET_REG supported */
252#define ACPI_FADT_SEALED_CASE (1<<11) /* 11: No internal expansion capabilities and case is sealed */
253#define ACPI_FADT_HEADLESS (1<<12) /* 12: No local video capabilities or local input devices */
254#define ACPI_FADT_SLEEP_TYPE (1<<13) /* 13: Must execute native instruction after writing SLP_TYPx register */
255#define ACPI_FADT_PCI_EXPRESS_WAKE (1<<14) /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
256#define ACPI_FADT_PLATFORM_CLOCK (1<<15) /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
257#define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
258#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: System is compatible with remote power on (ACPI 3.0) */
259#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: All local APICs must use cluster model (ACPI 3.0) */
260#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: All local x_aPICs must use physical dest mode (ACPI 3.0) */
284 261
285/* 262/*
286 * ACPI 1.0 FADT 263 * FADT Prefered Power Management Profiles
287 * Defined here to allow compiler to generate the length of the struct
288 */ 264 */
289struct fadt_descriptor_rev1 { 265enum acpi_prefered_pm_profiles {
290 ACPI_FADT_COMMON u32 flags; 266 PM_UNSPECIFIED = 0,
267 PM_DESKTOP = 1,
268 PM_MOBILE = 2,
269 PM_WORKSTATION = 3,
270 PM_ENTERPRISE_SERVER = 4,
271 PM_SOHO_SERVER = 5,
272 PM_APPLIANCE_PC = 6
291}; 273};
292 274
293/* FADT: Prefered Power Management Profiles */ 275/* FADT Boot Arch Flags */
294
295#define PM_UNSPECIFIED 0
296#define PM_DESKTOP 1
297#define PM_MOBILE 2
298#define PM_WORKSTATION 3
299#define PM_ENTERPRISE_SERVER 4
300#define PM_SOHO_SERVER 5
301#define PM_APPLIANCE_PC 6
302
303/* FADT: Boot Arch Flags */
304 276
305#define BAF_LEGACY_DEVICES 0x0001 277#define BAF_LEGACY_DEVICES 0x0001
306#define BAF_8042_KEYBOARD_CONTROLLER 0x0002 278#define BAF_8042_KEYBOARD_CONTROLLER 0x0002
@@ -312,59 +284,12 @@ struct fadt_descriptor_rev1 {
312 284
313#pragma pack() 285#pragma pack()
314 286
315/* 287#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_fadt, f)
316 * This macro is temporary until the table bitfield flag definitions
317 * are removed and replaced by a Flags field.
318 */
319#define ACPI_FLAG_OFFSET(d,f,o) (u8) (ACPI_OFFSET (d,f) + \
320 sizeof(((d *)0)->f) + o)
321/*
322 * Get the remaining ACPI tables
323 */
324#include "actbl1.h"
325 288
326/* 289/*
327 * ACPI Table information. We save the table address, length, 290 * Get the remaining ACPI tables
328 * and type of memory allocation (mapped or allocated) for each
329 * table for 1) when we exit, and 2) if a new table is installed
330 */ 291 */
331#define ACPI_MEM_NOT_ALLOCATED 0
332#define ACPI_MEM_ALLOCATED 1
333#define ACPI_MEM_MAPPED 2
334
335/* Definitions for the Flags bitfield member of struct acpi_table_support */
336
337#define ACPI_TABLE_SINGLE 0x00
338#define ACPI_TABLE_MULTIPLE 0x01
339#define ACPI_TABLE_EXECUTABLE 0x02
340
341#define ACPI_TABLE_ROOT 0x00
342#define ACPI_TABLE_PRIMARY 0x10
343#define ACPI_TABLE_SECONDARY 0x20
344#define ACPI_TABLE_ALL 0x30
345#define ACPI_TABLE_TYPE_MASK 0x30
346
347/* Data about each known table type */
348
349struct acpi_table_support {
350 char *name;
351 char *signature;
352 void **global_ptr;
353 u8 sig_length;
354 u8 flags;
355};
356
357extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1,
358 * needed for certain workarounds */
359/* Macros used to generate offsets to specific table fields */
360
361#define ACPI_FACS_OFFSET(f) (u8) ACPI_OFFSET (struct facs_descriptor,f)
362#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct fadt_descriptor, f)
363#define ACPI_GAS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_generic_address,f)
364#define ACPI_HDR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_header,f)
365#define ACPI_RSDP_OFFSET(f) (u8) ACPI_OFFSET (struct rsdp_descriptor,f)
366 292
367#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct fadt_descriptor,f,o) 293#include <acpi/actbl1.h>
368#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct facs_descriptor,f,o)
369 294
370#endif /* __ACTBL_H__ */ 295#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 745a6445a4f9..4e5d3ca53a8e 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,6 +61,7 @@
61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ 61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ 62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ 63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
64#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
64#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ 65#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
65#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ 66#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
66#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 67#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
@@ -73,12 +74,6 @@
73#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ 74#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
74#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ 75#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
75 76
76/* Legacy names */
77
78#define APIC_SIG "APIC" /* Multiple APIC Description Table */
79#define BOOT_SIG "BOOT" /* Simple Boot Flag Table */
80#define SBST_SIG "SBST" /* Smart Battery Specification Table */
81
82/* 77/*
83 * All tables must be byte-packed to match the ACPI specification, since 78 * All tables must be byte-packed to match the ACPI specification, since
84 * the tables are provided by the system BIOS. 79 * the tables are provided by the system BIOS.
@@ -91,31 +86,43 @@
91 * portable, so do not use any other bitfield types. 86 * portable, so do not use any other bitfield types.
92 */ 87 */
93 88
89/* Common Sub-table header (used in MADT, SRAT, etc.) */
90
91struct acpi_subtable_header {
92 u8 type;
93 u8 length;
94};
95
94/******************************************************************************* 96/*******************************************************************************
95 * 97 *
96 * ASF - Alert Standard Format table (Signature "ASF!") 98 * ASF - Alert Standard Format table (Signature "ASF!")
97 * 99 *
100 * Conforms to the Alert Standard Format Specification V2.0, 23 April 2003
101 *
98 ******************************************************************************/ 102 ******************************************************************************/
99 103
100struct acpi_table_asf { 104struct acpi_table_asf {
101ACPI_TABLE_HEADER_DEF}; 105 struct acpi_table_header header; /* Common ACPI table header */
106};
102 107
103#define ACPI_ASF_HEADER_DEF \ 108/* ASF subtable header */
104 u8 type; \
105 u8 reserved; \
106 u16 length;
107 109
108struct acpi_asf_header { 110struct acpi_asf_header {
109ACPI_ASF_HEADER_DEF}; 111 u8 type;
112 u8 reserved;
113 u16 length;
114};
110 115
111/* Values for Type field */ 116/* Values for Type field above */
112 117
113#define ASF_INFO 0 118enum acpi_asf_type {
114#define ASF_ALERT 1 119 ACPI_ASF_TYPE_INFO = 0,
115#define ASF_CONTROL 2 120 ACPI_ASF_TYPE_ALERT = 1,
116#define ASF_BOOT 3 121 ACPI_ASF_TYPE_CONTROL = 2,
117#define ASF_ADDRESS 4 122 ACPI_ASF_TYPE_BOOT = 3,
118#define ASF_RESERVED 5 123 ACPI_ASF_TYPE_ADDRESS = 4,
124 ACPI_ASF_TYPE_RESERVED = 5
125};
119 126
120/* 127/*
121 * ASF subtables 128 * ASF subtables
@@ -124,7 +131,8 @@ ACPI_ASF_HEADER_DEF};
124/* 0: ASF Information */ 131/* 0: ASF Information */
125 132
126struct acpi_asf_info { 133struct acpi_asf_info {
127 ACPI_ASF_HEADER_DEF u8 min_reset_value; 134 struct acpi_asf_header header;
135 u8 min_reset_value;
128 u8 min_poll_interval; 136 u8 min_poll_interval;
129 u16 system_id; 137 u16 system_id;
130 u32 mfg_id; 138 u32 mfg_id;
@@ -135,26 +143,49 @@ struct acpi_asf_info {
135/* 1: ASF Alerts */ 143/* 1: ASF Alerts */
136 144
137struct acpi_asf_alert { 145struct acpi_asf_alert {
138 ACPI_ASF_HEADER_DEF u8 assert_mask; 146 struct acpi_asf_header header;
147 u8 assert_mask;
139 u8 deassert_mask; 148 u8 deassert_mask;
140 u8 alerts; 149 u8 alerts;
141 u8 data_length; 150 u8 data_length;
142 u8 array[1]; 151};
152
153struct acpi_asf_alert_data {
154 u8 address;
155 u8 command;
156 u8 mask;
157 u8 value;
158 u8 sensor_type;
159 u8 type;
160 u8 offset;
161 u8 source_type;
162 u8 severity;
163 u8 sensor_number;
164 u8 entity;
165 u8 instance;
143}; 166};
144 167
145/* 2: ASF Remote Control */ 168/* 2: ASF Remote Control */
146 169
147struct acpi_asf_remote { 170struct acpi_asf_remote {
148 ACPI_ASF_HEADER_DEF u8 controls; 171 struct acpi_asf_header header;
172 u8 controls;
149 u8 data_length; 173 u8 data_length;
150 u16 reserved2; 174 u16 reserved2;
151 u8 array[1]; 175};
176
177struct acpi_asf_control_data {
178 u8 function;
179 u8 address;
180 u8 command;
181 u8 value;
152}; 182};
153 183
154/* 3: ASF RMCP Boot Options */ 184/* 3: ASF RMCP Boot Options */
155 185
156struct acpi_asf_rmcp { 186struct acpi_asf_rmcp {
157 ACPI_ASF_HEADER_DEF u8 capabilities[7]; 187 struct acpi_asf_header header;
188 u8 capabilities[7];
158 u8 completion_code; 189 u8 completion_code;
159 u32 enterprise_id; 190 u32 enterprise_id;
160 u8 command; 191 u8 command;
@@ -166,9 +197,9 @@ struct acpi_asf_rmcp {
166/* 4: ASF Address */ 197/* 4: ASF Address */
167 198
168struct acpi_asf_address { 199struct acpi_asf_address {
169 ACPI_ASF_HEADER_DEF u8 eprom_address; 200 struct acpi_asf_header header;
201 u8 eprom_address;
170 u8 devices; 202 u8 devices;
171 u8 smbus_addresses[1];
172}; 203};
173 204
174/******************************************************************************* 205/*******************************************************************************
@@ -178,7 +209,8 @@ struct acpi_asf_address {
178 ******************************************************************************/ 209 ******************************************************************************/
179 210
180struct acpi_table_boot { 211struct acpi_table_boot {
181 ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */ 212 struct acpi_table_header header; /* Common ACPI table header */
213 u8 cmos_index; /* Index in CMOS RAM for the boot register */
182 u8 reserved[3]; 214 u8 reserved[3];
183}; 215};
184 216
@@ -189,7 +221,8 @@ struct acpi_table_boot {
189 ******************************************************************************/ 221 ******************************************************************************/
190 222
191struct acpi_table_cpep { 223struct acpi_table_cpep {
192 ACPI_TABLE_HEADER_DEF u64 reserved; 224 struct acpi_table_header header; /* Common ACPI table header */
225 u64 reserved;
193}; 226};
194 227
195/* Subtable */ 228/* Subtable */
@@ -197,9 +230,9 @@ struct acpi_table_cpep {
197struct acpi_cpep_polling { 230struct acpi_cpep_polling {
198 u8 type; 231 u8 type;
199 u8 length; 232 u8 length;
200 u8 processor_id; /* Processor ID */ 233 u8 id; /* Processor ID */
201 u8 processor_eid; /* Processor EID */ 234 u8 eid; /* Processor EID */
202 u32 polling_interval; /* Polling interval (msec) */ 235 u32 interval; /* Polling interval (msec) */
203}; 236};
204 237
205/******************************************************************************* 238/*******************************************************************************
@@ -209,196 +242,281 @@ struct acpi_cpep_polling {
209 ******************************************************************************/ 242 ******************************************************************************/
210 243
211struct acpi_table_dbgp { 244struct acpi_table_dbgp {
212 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ 245 struct acpi_table_header header; /* Common ACPI table header */
246 u8 type; /* 0=full 16550, 1=subset of 16550 */
213 u8 reserved[3]; 247 u8 reserved[3];
214 struct acpi_generic_address debug_port; 248 struct acpi_generic_address debug_port;
215}; 249};
216 250
217/******************************************************************************* 251/*******************************************************************************
218 * 252 *
219 * ECDT - Embedded Controller Boot Resources Table 253 * DMAR - DMA Remapping table
220 * 254 *
221 ******************************************************************************/ 255 ******************************************************************************/
222 256
223struct ec_boot_resources { 257struct acpi_table_dmar {
224 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */ 258 struct acpi_table_header header; /* Common ACPI table header */
225 struct acpi_generic_address ec_data; /* Address of EC data register */ 259 u8 width; /* Host Address Width */
226 u32 uid; /* Unique ID - must be same as the EC _UID method */ 260 u8 reserved[11];
227 u8 gpe_bit; /* The GPE for the EC */ 261};
228 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */ 262
263/* DMAR subtable header */
264
265struct acpi_dmar_header {
266 u16 type;
267 u16 length;
268 u8 flags;
269 u8 reserved[3];
270};
271
272/* Values for subtable type in struct acpi_dmar_header */
273
274enum acpi_dmar_type {
275 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
276 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
277 ACPI_DMAR_TYPE_RESERVED = 2 /* 2 and greater are reserved */
278};
279
280struct acpi_dmar_device_scope {
281 u8 entry_type;
282 u8 length;
283 u8 segment;
284 u8 bus;
285};
286
287/* Values for entry_type in struct acpi_dmar_device_scope */
288
289enum acpi_dmar_scope_type {
290 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
291 ACPI_DMAR_SCOPE_TYPE_ENDPOINT = 1,
292 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
293 ACPI_DMAR_SCOPE_TYPE_RESERVED = 3 /* 3 and greater are reserved */
294};
295
296/*
297 * DMAR Sub-tables, correspond to Type in struct acpi_dmar_header
298 */
299
300/* 0: Hardware Unit Definition */
301
302struct acpi_dmar_hardware_unit {
303 struct acpi_dmar_header header;
304 u64 address; /* Register Base Address */
305};
306
307/* Flags */
308
309#define ACPI_DMAR_INCLUDE_ALL (1)
310
311/* 1: Reserved Memory Defininition */
312
313struct acpi_dmar_reserved_memory {
314 struct acpi_dmar_header header;
315 u64 address; /* 4_k aligned base address */
316 u64 end_address; /* 4_k aligned limit address */
229}; 317};
230 318
319/* Flags */
320
321#define ACPI_DMAR_ALLOW_ALL (1)
322
231/******************************************************************************* 323/*******************************************************************************
232 * 324 *
233 * HPET - High Precision Event Timer table 325 * ECDT - Embedded Controller Boot Resources Table
234 * 326 *
235 ******************************************************************************/ 327 ******************************************************************************/
236 328
237struct acpi_hpet_table { 329struct acpi_table_ecdt {
238 ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */ 330 struct acpi_table_header header; /* Common ACPI table header */
239 struct acpi_generic_address base_address; /* Address of event timer block */ 331 struct acpi_generic_address control; /* Address of EC command/status register */
240 u8 hpet_number; /* HPET sequence number */ 332 struct acpi_generic_address data; /* Address of EC data register */
241 u16 clock_tick; /* Main counter min tick, periodic mode */ 333 u32 uid; /* Unique ID - must be same as the EC _UID method */
242 u8 attributes; 334 u8 gpe; /* The GPE for the EC */
335 u8 id[1]; /* Full namepath of the EC in the ACPI namespace */
243}; 336};
244 337
245#if 0 /* HPET flags to be converted to macros */
246struct { /* Flags (8 bits) */
247 u8 page_protect:1; /* 00: No page protection */
248 u8 page_protect4:1; /* 01: 4_kB page protected */
249 u8 page_protect64:1; /* 02: 64_kB page protected */
250 u8:5; /* 03-07: Reserved, must be zero */
251} flags;
252#endif
253
254/******************************************************************************* 338/*******************************************************************************
255 * 339 *
256 * MADT - Multiple APIC Description Table 340 * HPET - High Precision Event Timer table
257 * 341 *
258 ******************************************************************************/ 342 ******************************************************************************/
259 343
260struct multiple_apic_table { 344struct acpi_table_hpet {
261 ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */ 345 struct acpi_table_header header; /* Common ACPI table header */
262 346 u32 id; /* Hardware ID of event timer block */
263 /* Flags (32 bits) */ 347 struct acpi_generic_address address; /* Address of event timer block */
264 348 u8 sequence; /* HPET sequence number */
265 u8 PCATcompat:1; /* 00: System also has dual 8259s */ 349 u16 minimum_tick; /* Main counter min tick, periodic mode */
266 u8:7; /* 01-07: Reserved, must be zero */ 350 u8 flags;
267 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
268}; 351};
269 352
270/* Values for MADT PCATCompat */ 353/*! Flags */
271 354
272#define DUAL_PIC 0 355#define ACPI_HPET_PAGE_PROTECT (1) /* 00: No page protection */
273#define MULTIPLE_APIC 1 356#define ACPI_HPET_PAGE_PROTECT_4 (1<<1) /* 01: 4KB page protected */
357#define ACPI_HPET_PAGE_PROTECT_64 (1<<2) /* 02: 64KB page protected */
274 358
275/* Common MADT Sub-table header */ 359/*! [End] no source code translation !*/
276 360
277#define APIC_HEADER_DEF \ 361/*******************************************************************************
278 u8 type; \ 362 *
279 u8 length; 363 * MADT - Multiple APIC Description Table
280 364 *
281struct apic_header { 365 ******************************************************************************/
282APIC_HEADER_DEF};
283
284/* Values for Type in struct apic_header */
285 366
286#define APIC_PROCESSOR 0 367struct acpi_table_madt {
287#define APIC_IO 1 368 struct acpi_table_header header; /* Common ACPI table header */
288#define APIC_XRUPT_OVERRIDE 2 369 u32 address; /* Physical address of local APIC */
289#define APIC_NMI 3 370 u32 flags;
290#define APIC_LOCAL_NMI 4 371};
291#define APIC_ADDRESS_OVERRIDE 5
292#define APIC_IO_SAPIC 6
293#define APIC_LOCAL_SAPIC 7
294#define APIC_XRUPT_SOURCE 8
295#define APIC_RESERVED 9 /* 9 and greater are reserved */
296 372
297/* Flag definitions for MADT sub-tables */ 373/* Flags */
298 374
299#define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \ 375#define ACPI_MADT_PCAT_COMPAT (1) /* 00: System also has dual 8259s */
300 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
301 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
302 u8 : 4; /* 04-07: Reserved, must be zero */\
303 u8 reserved1; /* 08-15: Reserved, must be zero */
304 376
305#define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \ 377/* Values for PCATCompat flag */
306 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
307 u8 : 7; /* 01-07: Reserved, must be zero */\
308 u8 reserved2[3]; /* 08-31: Reserved, must be zero */
309 378
310/* Values for MPS INTI flags */ 379#define ACPI_MADT_DUAL_PIC 0
380#define ACPI_MADT_MULTIPLE_APIC 1
311 381
312#define POLARITY_CONFORMS 0 382/* Values for subtable type in struct acpi_subtable_header */
313#define POLARITY_ACTIVE_HIGH 1
314#define POLARITY_RESERVED 2
315#define POLARITY_ACTIVE_LOW 3
316 383
317#define TRIGGER_CONFORMS 0 384enum acpi_madt_type {
318#define TRIGGER_EDGE 1 385 ACPI_MADT_TYPE_LOCAL_APIC = 0,
319#define TRIGGER_RESERVED 2 386 ACPI_MADT_TYPE_IO_APIC = 1,
320#define TRIGGER_LEVEL 3 387 ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
388 ACPI_MADT_TYPE_NMI_SOURCE = 3,
389 ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
390 ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
391 ACPI_MADT_TYPE_IO_SAPIC = 6,
392 ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
393 ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
394 ACPI_MADT_TYPE_RESERVED = 9 /* 9 and greater are reserved */
395};
321 396
322/* 397/*
323 * MADT Sub-tables, correspond to Type in struct apic_header 398 * MADT Sub-tables, correspond to Type in struct acpi_subtable_header
324 */ 399 */
325 400
326/* 0: processor APIC */ 401/* 0: Processor Local APIC */
327 402
328struct madt_processor_apic { 403struct acpi_madt_local_apic {
329 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 404 struct acpi_subtable_header header;
330 u8 local_apic_id; /* Processor's local APIC id */ 405 u8 processor_id; /* ACPI processor id */
331 ACPI_MADT_LFLAGS}; 406 u8 id; /* Processor's local APIC id */
407 u32 lapic_flags;
408};
332 409
333/* 1: IO APIC */ 410/* 1: IO APIC */
334 411
335struct madt_io_apic { 412struct acpi_madt_io_apic {
336 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */ 413 struct acpi_subtable_header header;
414 u8 id; /* I/O APIC ID */
337 u8 reserved; /* Reserved - must be zero */ 415 u8 reserved; /* Reserved - must be zero */
338 u32 address; /* APIC physical address */ 416 u32 address; /* APIC physical address */
339 u32 interrupt; /* Global system interrupt where INTI lines start */ 417 u32 global_irq_base; /* Global system interrupt where INTI lines start */
340}; 418};
341 419
342/* 2: Interrupt Override */ 420/* 2: Interrupt Override */
343 421
344struct madt_interrupt_override { 422struct acpi_madt_interrupt_override {
345 APIC_HEADER_DEF u8 bus; /* 0 - ISA */ 423 struct acpi_subtable_header header;
346 u8 source; /* Interrupt source (IRQ) */ 424 u8 bus; /* 0 - ISA */
347 u32 interrupt; /* Global system interrupt */ 425 u8 source_irq; /* Interrupt source (IRQ) */
348 ACPI_MADT_IFLAGS}; 426 u32 global_irq; /* Global system interrupt */
427 u16 inti_flags;
428};
349 429
350/* 3: NMI Sources */ 430/* 3: NMI Source */
351 431
352struct madt_nmi_source { 432struct acpi_madt_nmi_source {
353 APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */ 433 struct acpi_subtable_header header;
434 u16 inti_flags;
435 u32 global_irq; /* Global system interrupt */
354}; 436};
355 437
356/* 4: Local APIC NMI */ 438/* 4: Local APIC NMI */
357 439
358struct madt_local_apic_nmi { 440struct acpi_madt_local_apic_nmi {
359 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 441 struct acpi_subtable_header header;
360 ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */ 442 u8 processor_id; /* ACPI processor id */
443 u16 inti_flags;
444 u8 lint; /* LINTn to which NMI is connected */
361}; 445};
362 446
363/* 5: Address Override */ 447/* 5: Address Override */
364 448
365struct madt_address_override { 449struct acpi_madt_local_apic_override {
366 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ 450 struct acpi_subtable_header header;
451 u16 reserved; /* Reserved, must be zero */
367 u64 address; /* APIC physical address */ 452 u64 address; /* APIC physical address */
368}; 453};
369 454
370/* 6: I/O Sapic */ 455/* 6: I/O Sapic */
371 456
372struct madt_io_sapic { 457struct acpi_madt_io_sapic {
373 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */ 458 struct acpi_subtable_header header;
459 u8 id; /* I/O SAPIC ID */
374 u8 reserved; /* Reserved, must be zero */ 460 u8 reserved; /* Reserved, must be zero */
375 u32 interrupt_base; /* Glocal interrupt for SAPIC start */ 461 u32 global_irq_base; /* Global interrupt for SAPIC start */
376 u64 address; /* SAPIC physical address */ 462 u64 address; /* SAPIC physical address */
377}; 463};
378 464
379/* 7: Local Sapic */ 465/* 7: Local Sapic */
380 466
381struct madt_local_sapic { 467struct acpi_madt_local_sapic {
382 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 468 struct acpi_subtable_header header;
383 u8 local_sapic_id; /* SAPIC ID */ 469 u8 processor_id; /* ACPI processor id */
384 u8 local_sapic_eid; /* SAPIC EID */ 470 u8 id; /* SAPIC ID */
471 u8 eid; /* SAPIC EID */
385 u8 reserved[3]; /* Reserved, must be zero */ 472 u8 reserved[3]; /* Reserved, must be zero */
386 ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ 473 u32 lapic_flags;
387 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ 474 u32 uid; /* Numeric UID - ACPI 3.0 */
475 char uid_string[1]; /* String UID - ACPI 3.0 */
388}; 476};
389 477
390/* 8: Platform Interrupt Source */ 478/* 8: Platform Interrupt Source */
391 479
392struct madt_interrupt_source { 480struct acpi_madt_interrupt_source {
393 APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */ 481 struct acpi_subtable_header header;
394 u8 processor_id; /* Processor ID */ 482 u16 inti_flags;
395 u8 processor_eid; /* Processor EID */ 483 u8 type; /* 1=PMI, 2=INIT, 3=corrected */
484 u8 id; /* Processor ID */
485 u8 eid; /* Processor EID */
396 u8 io_sapic_vector; /* Vector value for PMI interrupts */ 486 u8 io_sapic_vector; /* Vector value for PMI interrupts */
397 u32 interrupt; /* Global system interrupt */ 487 u32 global_irq; /* Global system interrupt */
398 u32 flags; /* Interrupt Source Flags */ 488 u32 flags; /* Interrupt Source Flags */
399}; 489};
400 490
401#ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H 491/* Flags field above */
492
493#define ACPI_MADT_CPEI_OVERRIDE (1)
494
495/*
496 * Common flags fields for MADT subtables
497 */
498
499/* MADT Local APIC flags (lapic_flags) */
500
501#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
502
503/* MADT MPS INTI flags (inti_flags) */
504
505#define ACPI_MADT_POLARITY_MASK (3) /* 00-01: Polarity of APIC I/O input signals */
506#define ACPI_MADT_TRIGGER_MASK (3<<2) /* 02-03: Trigger mode of APIC input signals */
507
508/* Values for MPS INTI flags */
509
510#define ACPI_MADT_POLARITY_CONFORMS 0
511#define ACPI_MADT_POLARITY_ACTIVE_HIGH 1
512#define ACPI_MADT_POLARITY_RESERVED 2
513#define ACPI_MADT_POLARITY_ACTIVE_LOW 3
514
515#define ACPI_MADT_TRIGGER_CONFORMS (0)
516#define ACPI_MADT_TRIGGER_EDGE (1<<2)
517#define ACPI_MADT_TRIGGER_RESERVED (2<<2)
518#define ACPI_MADT_TRIGGER_LEVEL (3<<2)
519
402/******************************************************************************* 520/*******************************************************************************
403 * 521 *
404 * MCFG - PCI Memory Mapped Configuration table and sub-table 522 * MCFG - PCI Memory Mapped Configuration table and sub-table
@@ -406,17 +524,19 @@ struct madt_interrupt_source {
406 ******************************************************************************/ 524 ******************************************************************************/
407 525
408struct acpi_table_mcfg { 526struct acpi_table_mcfg {
409 ACPI_TABLE_HEADER_DEF u8 reserved[8]; 527 struct acpi_table_header header; /* Common ACPI table header */
528 u8 reserved[8];
410}; 529};
411 530
531/* Subtable */
532
412struct acpi_mcfg_allocation { 533struct acpi_mcfg_allocation {
413 u64 base_address; /* Base address, processor-relative */ 534 u64 address; /* Base address, processor-relative */
414 u16 pci_segment; /* PCI segment group number */ 535 u16 pci_segment; /* PCI segment group number */
415 u8 start_bus_number; /* Starting PCI Bus number */ 536 u8 start_bus_number; /* Starting PCI Bus number */
416 u8 end_bus_number; /* Final PCI Bus number */ 537 u8 end_bus_number; /* Final PCI Bus number */
417 u32 reserved; 538 u32 reserved;
418}; 539};
419#endif
420 540
421/******************************************************************************* 541/*******************************************************************************
422 * 542 *
@@ -424,8 +544,9 @@ struct acpi_mcfg_allocation {
424 * 544 *
425 ******************************************************************************/ 545 ******************************************************************************/
426 546
427struct smart_battery_table { 547struct acpi_table_sbst {
428 ACPI_TABLE_HEADER_DEF u32 warning_level; 548 struct acpi_table_header header; /* Common ACPI table header */
549 u32 warning_level;
429 u32 low_level; 550 u32 low_level;
430 u32 critical_level; 551 u32 critical_level;
431}; 552};
@@ -436,9 +557,10 @@ struct smart_battery_table {
436 * 557 *
437 ******************************************************************************/ 558 ******************************************************************************/
438 559
439struct system_locality_info { 560struct acpi_table_slit {
440 ACPI_TABLE_HEADER_DEF u64 locality_count; 561 struct acpi_table_header header; /* Common ACPI table header */
441 u8 entry[1][1]; 562 u64 locality_count;
563 u8 entry[1]; /* Real size = localities^2 */
442}; 564};
443 565
444/******************************************************************************* 566/*******************************************************************************
@@ -448,7 +570,8 @@ struct system_locality_info {
448 ******************************************************************************/ 570 ******************************************************************************/
449 571
450struct acpi_table_spcr { 572struct acpi_table_spcr {
451 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */ 573 struct acpi_table_header header; /* Common ACPI table header */
574 u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
452 u8 reserved[3]; 575 u8 reserved[3];
453 struct acpi_generic_address serial_port; 576 struct acpi_generic_address serial_port;
454 u8 interrupt_type; 577 u8 interrupt_type;
@@ -459,7 +582,7 @@ struct acpi_table_spcr {
459 u8 stop_bits; 582 u8 stop_bits;
460 u8 flow_control; 583 u8 flow_control;
461 u8 terminal_type; 584 u8 terminal_type;
462 u8 reserved2; 585 u8 reserved1;
463 u16 pci_device_id; 586 u16 pci_device_id;
464 u16 pci_vendor_id; 587 u16 pci_vendor_id;
465 u8 pci_bus; 588 u8 pci_bus;
@@ -467,7 +590,7 @@ struct acpi_table_spcr {
467 u8 pci_function; 590 u8 pci_function;
468 u32 pci_flags; 591 u32 pci_flags;
469 u8 pci_segment; 592 u8 pci_segment;
470 u32 reserved3; 593 u32 reserved2;
471}; 594};
472 595
473/******************************************************************************* 596/*******************************************************************************
@@ -477,12 +600,13 @@ struct acpi_table_spcr {
477 ******************************************************************************/ 600 ******************************************************************************/
478 601
479struct acpi_table_spmi { 602struct acpi_table_spmi {
480 ACPI_TABLE_HEADER_DEF u8 reserved; 603 struct acpi_table_header header; /* Common ACPI table header */
604 u8 reserved;
481 u8 interface_type; 605 u8 interface_type;
482 u16 spec_revision; /* Version of IPMI */ 606 u16 spec_revision; /* Version of IPMI */
483 u8 interrupt_type; 607 u8 interrupt_type;
484 u8 gpe_number; /* GPE assigned */ 608 u8 gpe_number; /* GPE assigned */
485 u8 reserved2; 609 u8 reserved1;
486 u8 pci_device_flag; 610 u8 pci_device_flag;
487 u32 interrupt; 611 u32 interrupt;
488 struct acpi_generic_address ipmi_register; 612 struct acpi_generic_address ipmi_register;
@@ -498,58 +622,53 @@ struct acpi_table_spmi {
498 * 622 *
499 ******************************************************************************/ 623 ******************************************************************************/
500 624
501struct system_resource_affinity { 625struct acpi_table_srat {
502 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */ 626 struct acpi_table_header header; /* Common ACPI table header */
503 u64 reserved2; /* Reserved, must be zero */ 627 u32 table_revision; /* Must be value '1' */
628 u64 reserved; /* Reserved, must be zero */
504}; 629};
505 630
506/* SRAT common sub-table header */ 631/* Values for subtable type in struct acpi_subtable_header */
507 632
508#define SRAT_SUBTABLE_HEADER \ 633enum acpi_srat_type {
509 u8 type; \ 634 ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
510 u8 length; 635 ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
511 636 ACPI_SRAT_TYPE_RESERVED = 2
512/* Values for Type above */ 637};
513
514#define SRAT_CPU_AFFINITY 0
515#define SRAT_MEMORY_AFFINITY 1
516#define SRAT_RESERVED 2
517 638
518/* SRAT sub-tables */ 639/* SRAT sub-tables */
519 640
520struct static_resource_alloc { 641struct acpi_srat_cpu_affinity {
521 SRAT_SUBTABLE_HEADER u8 proximity_domain_lo; 642 struct acpi_subtable_header header;
643 u8 proximity_domain_lo;
522 u8 apic_id; 644 u8 apic_id;
523 645 u32 flags;
524 /* Flags (32 bits) */
525
526 u8 enabled:1; /* 00: Use affinity structure */
527 u8:7; /* 01-07: Reserved, must be zero */
528 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
529
530 u8 local_sapic_eid; 646 u8 local_sapic_eid;
531 u8 proximity_domain_hi[3]; 647 u8 proximity_domain_hi[3];
532 u32 reserved4; /* Reserved, must be zero */ 648 u32 reserved; /* Reserved, must be zero */
533}; 649};
534 650
535struct memory_affinity { 651/* Flags */
536 SRAT_SUBTABLE_HEADER u32 proximity_domain;
537 u16 reserved3;
538 u64 base_address;
539 u64 address_length;
540 u32 reserved4;
541
542 /* Flags (32 bits) */
543 652
544 u8 enabled:1; /* 00: Use affinity structure */ 653#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
545 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
546 u8 non_volatile:1; /* 02: Memory is non-volatile */
547 u8:5; /* 03-07: Reserved, must be zero */
548 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
549 654
550 u64 reserved6; /* Reserved, must be zero */ 655struct acpi_srat_mem_affinity {
656 struct acpi_subtable_header header;
657 u32 proximity_domain;
658 u16 reserved; /* Reserved, must be zero */
659 u64 base_address;
660 u64 length;
661 u32 memory_type; /* See acpi_address_range_id */
662 u32 flags;
663 u64 reserved1; /* Reserved, must be zero */
551}; 664};
552 665
666/* Flags */
667
668#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
669#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
670#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
671
553/******************************************************************************* 672/*******************************************************************************
554 * 673 *
555 * TCPA - Trusted Computing Platform Alliance table 674 * TCPA - Trusted Computing Platform Alliance table
@@ -557,7 +676,8 @@ struct memory_affinity {
557 ******************************************************************************/ 676 ******************************************************************************/
558 677
559struct acpi_table_tcpa { 678struct acpi_table_tcpa {
560 ACPI_TABLE_HEADER_DEF u16 reserved; 679 struct acpi_table_header header; /* Common ACPI table header */
680 u16 reserved;
561 u32 max_log_length; /* Maximum length for the event log area */ 681 u32 max_log_length; /* Maximum length for the event log area */
562 u64 log_address; /* Address of the event log area */ 682 u64 log_address; /* Address of the event log area */
563}; 683};
@@ -569,7 +689,8 @@ struct acpi_table_tcpa {
569 ******************************************************************************/ 689 ******************************************************************************/
570 690
571struct acpi_table_wdrt { 691struct acpi_table_wdrt {
572 ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */ 692 struct acpi_table_header header; /* Common ACPI table header */
693 u32 header_length; /* Watchdog Header Length */
573 u8 pci_segment; /* PCI Segment number */ 694 u8 pci_segment; /* PCI Segment number */
574 u8 pci_bus; /* PCI Bus number */ 695 u8 pci_bus; /* PCI Bus number */
575 u8 pci_device; /* PCI Device number */ 696 u8 pci_device; /* PCI Device number */
@@ -582,58 +703,9 @@ struct acpi_table_wdrt {
582 u32 entries; /* Number of watchdog entries that follow */ 703 u32 entries; /* Number of watchdog entries that follow */
583}; 704};
584 705
585#if 0 /* Flags, will be converted to macros */ 706/* Flags */
586u8 enabled:1; /* 00: Timer enabled */ 707
587u8:6; /* 01-06: Reserved */ 708#define ACPI_WDRT_TIMER_ENABLED (1) /* 00: Timer enabled */
588u8 sleep_stop:1; /* 07: Timer stopped in sleep state */
589#endif
590
591/* Macros used to generate offsets to specific table fields */
592
593#define ACPI_ASF0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_info,f)
594#define ACPI_ASF1_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_alert,f)
595#define ACPI_ASF2_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_remote,f)
596#define ACPI_ASF3_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_rmcp,f)
597#define ACPI_ASF4_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_asf_address,f)
598#define ACPI_BOOT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_boot,f)
599#define ACPI_CPEP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_cpep,f)
600#define ACPI_CPEP0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_cpep_polling,f)
601#define ACPI_DBGP_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_dbgp,f)
602#define ACPI_ECDT_OFFSET(f) (u8) ACPI_OFFSET (struct ec_boot_resources,f)
603#define ACPI_HPET_OFFSET(f) (u8) ACPI_OFFSET (struct hpet_table,f)
604#define ACPI_MADT_OFFSET(f) (u8) ACPI_OFFSET (struct multiple_apic_table,f)
605#define ACPI_MADT0_OFFSET(f) (u8) ACPI_OFFSET (struct madt_processor_apic,f)
606#define ACPI_MADT1_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_apic,f)
607#define ACPI_MADT2_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_override,f)
608#define ACPI_MADT3_OFFSET(f) (u8) ACPI_OFFSET (struct madt_nmi_source,f)
609#define ACPI_MADT4_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_apic_nmi,f)
610#define ACPI_MADT5_OFFSET(f) (u8) ACPI_OFFSET (struct madt_address_override,f)
611#define ACPI_MADT6_OFFSET(f) (u8) ACPI_OFFSET (struct madt_io_sapic,f)
612#define ACPI_MADT7_OFFSET(f) (u8) ACPI_OFFSET (struct madt_local_sapic,f)
613#define ACPI_MADT8_OFFSET(f) (u8) ACPI_OFFSET (struct madt_interrupt_source,f)
614#define ACPI_MADTH_OFFSET(f) (u8) ACPI_OFFSET (struct apic_header,f)
615#define ACPI_MCFG_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_mcfg,f)
616#define ACPI_MCFG0_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_mcfg_allocation,f)
617#define ACPI_SBST_OFFSET(f) (u8) ACPI_OFFSET (struct smart_battery_table,f)
618#define ACPI_SLIT_OFFSET(f) (u8) ACPI_OFFSET (struct system_locality_info,f)
619#define ACPI_SPCR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spcr,f)
620#define ACPI_SPMI_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_spmi,f)
621#define ACPI_SRAT_OFFSET(f) (u8) ACPI_OFFSET (struct system_resource_affinity,f)
622#define ACPI_SRAT0_OFFSET(f) (u8) ACPI_OFFSET (struct static_resource_alloc,f)
623#define ACPI_SRAT1_OFFSET(f) (u8) ACPI_OFFSET (struct memory_affinity,f)
624#define ACPI_TCPA_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_tcpa,f)
625#define ACPI_WDRT_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_wdrt,f)
626
627#define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct hpet_table,f,o)
628#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct static_resource_alloc,f,o)
629#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct memory_affinity,f,o)
630#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct multiple_apic_table,f,o)
631#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_processor_apic,f,o)
632#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_override,f,o)
633#define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_nmi_source,f,o)
634#define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_apic_nmi,f,o)
635#define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_local_sapic,f,o)
636#define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct madt_interrupt_source,f,o)
637 709
638/* Reset to default packing */ 710/* Reset to default packing */
639 711
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
deleted file mode 100644
index 67efe6cad27b..000000000000
--- a/include/acpi/actbl2.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/******************************************************************************
2 *
3 * Name: actbl2.h - ACPI Specification Revision 2.0 Tables
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore
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 __ACTBL2_H__
45#define __ACTBL2_H__
46
47/* Code moved to both actbl.h and actbl1.h */
48
49#endif /* __ACTBL2_H__ */
diff --git a/include/acpi/actbl71.h b/include/acpi/actbl71.h
deleted file mode 100644
index 10ac05bb36bc..000000000000
--- a/include/acpi/actbl71.h
+++ /dev/null
@@ -1,134 +0,0 @@
1/******************************************************************************
2 *
3 * Name: actbl71.h - IA-64 Extensions to the ACPI Spec Rev. 0.71
4 * This file includes tables specific to this
5 * specification revision.
6 *
7 *****************************************************************************/
8
9/*
10 * Copyright (C) 2000 - 2003, R. Byron Moore
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27#ifndef __ACTBL71_H__
28#define __ACTBL71_H__
29
30/* 0.71 FADT address_space data item bitmasks defines */
31/* If the associated bit is zero then it is in memory space else in io space */
32
33#define SMI_CMD_ADDRESS_SPACE 0x01
34#define PM1_BLK_ADDRESS_SPACE 0x02
35#define PM2_CNT_BLK_ADDRESS_SPACE 0x04
36#define PM_TMR_BLK_ADDRESS_SPACE 0x08
37#define GPE0_BLK_ADDRESS_SPACE 0x10
38#define GPE1_BLK_ADDRESS_SPACE 0x20
39
40/* Only for clarity in declarations */
41
42typedef u64 IO_ADDRESS;
43
44#pragma pack(1)
45struct { /* Root System Descriptor Pointer */
46 NATIVE_CHAR signature[8]; /* contains "RSD PTR " */
47 u8 checksum; /* to make sum of struct == 0 */
48 NATIVE_CHAR oem_id[6]; /* OEM identification */
49 u8 reserved; /* Must be 0 for 1.0, 2 for 2.0 */
50 u64 rsdt_physical_address; /* 64-bit physical address of RSDT */
51};
52
53/*****************************************/
54/* IA64 Extensions to ACPI Spec Rev 0.71 */
55/* for the Root System Description Table */
56/*****************************************/
57struct {
58 struct acpi_table_header header; /* Table header */
59 u32 reserved_pad; /* IA64 alignment, must be 0 */
60 u64 table_offset_entry[1]; /* Array of pointers to other */
61 /* tables' headers */
62};
63
64/*******************************************/
65/* IA64 Extensions to ACPI Spec Rev 0.71 */
66/* for the Firmware ACPI Control Structure */
67/*******************************************/
68struct {
69 NATIVE_CHAR signature[4]; /* signature "FACS" */
70 u32 length; /* length of structure, in bytes */
71 u32 hardware_signature; /* hardware configuration signature */
72 u32 reserved4; /* must be 0 */
73 u64 firmware_waking_vector; /* ACPI OS waking vector */
74 u64 global_lock; /* Global Lock */
75 u32 S4bios_f:1; /* Indicates if S4BIOS support is present */
76 u32 reserved1:31; /* must be 0 */
77 u8 reserved3[28]; /* reserved - must be zero */
78};
79
80/******************************************/
81/* IA64 Extensions to ACPI Spec Rev 0.71 */
82/* for the Fixed ACPI Description Table */
83/******************************************/
84struct {
85 struct acpi_table_header header; /* table header */
86 u32 reserved_pad; /* IA64 alignment, must be 0 */
87 u64 firmware_ctrl; /* 64-bit Physical address of FACS */
88 u64 dsdt; /* 64-bit Physical address of DSDT */
89 u8 model; /* System Interrupt Model */
90 u8 address_space; /* Address Space Bitmask */
91 u16 sci_int; /* System vector of SCI interrupt */
92 u8 acpi_enable; /* value to write to smi_cmd to enable ACPI */
93 u8 acpi_disable; /* value to write to smi_cmd to disable ACPI */
94 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */
95 u8 reserved2; /* reserved - must be zero */
96 u64 smi_cmd; /* Port address of SMI command port */
97 u64 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */
98 u64 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */
99 u64 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */
100 u64 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */
101 u64 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */
102 u64 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */
103 u64 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */
104 u64 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */
105 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */
106 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */
107 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */
108 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */
109 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */
110 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */
111 u8 gpe1_base; /* offset in gpe model where gpe1 events start */
112 u8 reserved3; /* reserved */
113 u16 plvl2_lat; /* worst case HW latency to enter/exit C2 state */
114 u16 plvl3_lat; /* worst case HW latency to enter/exit C3 state */
115 u8 day_alrm; /* index to day-of-month alarm in RTC CMOS RAM */
116 u8 mon_alrm; /* index to month-of-year alarm in RTC CMOS RAM */
117 u8 century; /* index to century in RTC CMOS RAM */
118 u8 reserved4; /* reserved */
119 u32 flush_cash:1; /* PAL_FLUSH_CACHE is correctly supported */
120 u32 reserved5:1; /* reserved - must be zero */
121 u32 proc_c1:1; /* all processors support C1 state */
122 u32 plvl2_up:1; /* C2 state works on MP system */
123 u32 pwr_button:1; /* Power button is handled as a generic feature */
124 u32 sleep_button:1; /* Sleep button is handled as a generic feature, or not present */
125 u32 fixed_rTC:1; /* RTC wakeup stat not in fixed register space */
126 u32 rtcs4:1; /* RTC wakeup stat not possible from S4 */
127 u32 tmr_val_ext:1; /* tmr_val is 32 bits */
128 u32 dock_cap:1; /* Supports Docking */
129 u32 reserved6:22; /* reserved - must be zero */
130};
131
132#pragma pack()
133
134#endif /* __ACTBL71_H__ */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 64b603cfe92e..72a6e2c3a536 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -48,7 +48,8 @@
48 48
49/* 49/*
50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header 50 * ACPI_MACHINE_WIDTH must be specified in an OS- or compiler-dependent header
51 * and must be either 16, 32, or 64 51 * and must be either 32 or 64. 16-bit ACPICA is no longer supported, as of
52 * 12/2006.
52 */ 53 */
53#ifndef ACPI_MACHINE_WIDTH 54#ifndef ACPI_MACHINE_WIDTH
54#error ACPI_MACHINE_WIDTH not defined 55#error ACPI_MACHINE_WIDTH not defined
@@ -149,7 +150,6 @@ typedef int INT32;
149typedef u64 acpi_native_uint; 150typedef u64 acpi_native_uint;
150typedef s64 acpi_native_int; 151typedef s64 acpi_native_int;
151 152
152typedef u64 acpi_table_ptr;
153typedef u64 acpi_io_address; 153typedef u64 acpi_io_address;
154typedef u64 acpi_physical_address; 154typedef u64 acpi_physical_address;
155 155
@@ -189,48 +189,15 @@ typedef int INT32;
189typedef u32 acpi_native_uint; 189typedef u32 acpi_native_uint;
190typedef s32 acpi_native_int; 190typedef s32 acpi_native_int;
191 191
192typedef u64 acpi_table_ptr;
193typedef u32 acpi_io_address; 192typedef u32 acpi_io_address;
194typedef u64 acpi_physical_address; 193typedef u32 acpi_physical_address;
195 194
196#define ACPI_MAX_PTR ACPI_UINT32_MAX 195#define ACPI_MAX_PTR ACPI_UINT32_MAX
197#define ACPI_SIZE_MAX ACPI_UINT32_MAX 196#define ACPI_SIZE_MAX ACPI_UINT32_MAX
198 197
199/*******************************************************************************
200 *
201 * Types specific to 16-bit targets
202 *
203 ******************************************************************************/
204
205#elif ACPI_MACHINE_WIDTH == 16
206
207/*! [Begin] no source code translation (keep the typedefs as-is) */
208
209typedef unsigned long UINT32;
210typedef short INT16;
211typedef long INT32;
212
213/*! [End] no source code translation !*/
214
215typedef u16 acpi_native_uint;
216typedef s16 acpi_native_int;
217
218typedef u32 acpi_table_ptr;
219typedef u32 acpi_io_address;
220typedef char *acpi_physical_address;
221
222#define ACPI_MAX_PTR ACPI_UINT16_MAX
223#define ACPI_SIZE_MAX ACPI_UINT16_MAX
224
225#define ACPI_USE_NATIVE_DIVIDE /* No 64-bit integers, ok to use native divide */
226
227/* 64-bit integers cannot be supported */
228
229#define ACPI_NO_INTEGER64_SUPPORT
230
231#else 198#else
232 199
233/* ACPI_MACHINE_WIDTH must be either 64, 32, or 16 */ 200/* ACPI_MACHINE_WIDTH must be either 64 or 32 */
234 201
235#error unknown ACPI_MACHINE_WIDTH 202#error unknown ACPI_MACHINE_WIDTH
236#endif 203#endif
@@ -311,36 +278,6 @@ typedef acpi_native_uint acpi_size;
311 * 278 *
312 ******************************************************************************/ 279 ******************************************************************************/
313 280
314/*
315 * Pointer overlays to avoid lots of typecasting for
316 * code that accepts both physical and logical pointers.
317 */
318union acpi_pointers {
319 acpi_physical_address physical;
320 void *logical;
321 acpi_table_ptr value;
322};
323
324struct acpi_pointer {
325 u32 pointer_type;
326 union acpi_pointers pointer;
327};
328
329/* pointer_types for above */
330
331#define ACPI_PHYSICAL_POINTER 0x01
332#define ACPI_LOGICAL_POINTER 0x02
333
334/* Processor mode */
335
336#define ACPI_PHYSICAL_ADDRESSING 0x04
337#define ACPI_LOGICAL_ADDRESSING 0x08
338#define ACPI_MEMORY_MODE 0x0C
339
340#define ACPI_PHYSMODE_PHYSPTR ACPI_PHYSICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
341#define ACPI_LOGMODE_PHYSPTR ACPI_LOGICAL_ADDRESSING | ACPI_PHYSICAL_POINTER
342#define ACPI_LOGMODE_LOGPTR ACPI_LOGICAL_ADDRESSING | ACPI_LOGICAL_POINTER
343
344/* Logical defines and NULL */ 281/* Logical defines and NULL */
345 282
346#ifdef FALSE 283#ifdef FALSE
@@ -442,7 +379,8 @@ typedef u64 acpi_integer;
442/* 379/*
443 * Initialization state 380 * Initialization state
444 */ 381 */
445#define ACPI_INITIALIZED_OK 0x01 382#define ACPI_SUBSYSTEM_INITIALIZE 0x01
383#define ACPI_INITIALIZED_OK 0x02
446 384
447/* 385/*
448 * Power state values 386 * Power state values
@@ -491,21 +429,6 @@ typedef u64 acpi_integer;
491#define ACPI_NOTIFY_POWER_FAULT (u8) 7 429#define ACPI_NOTIFY_POWER_FAULT (u8) 7
492 430
493/* 431/*
494 * Table types. These values are passed to the table related APIs
495 */
496typedef u32 acpi_table_type;
497
498#define ACPI_TABLE_ID_RSDP (acpi_table_type) 0
499#define ACPI_TABLE_ID_DSDT (acpi_table_type) 1
500#define ACPI_TABLE_ID_FADT (acpi_table_type) 2
501#define ACPI_TABLE_ID_FACS (acpi_table_type) 3
502#define ACPI_TABLE_ID_PSDT (acpi_table_type) 4
503#define ACPI_TABLE_ID_SSDT (acpi_table_type) 5
504#define ACPI_TABLE_ID_XSDT (acpi_table_type) 6
505#define ACPI_TABLE_ID_MAX 6
506#define ACPI_NUM_TABLE_TYPES (ACPI_TABLE_ID_MAX+1)
507
508/*
509 * Types associated with ACPI names and objects. The first group of 432 * Types associated with ACPI names and objects. The first group of
510 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition 433 * values (up to ACPI_TYPE_EXTERNAL_MAX) correspond to the definition
511 * of the ACPI object_type() operator (See the ACPI Spec). Therefore, 434 * of the ACPI object_type() operator (See the ACPI Spec). Therefore,
@@ -637,7 +560,7 @@ typedef u32 acpi_event_status;
637 * | | | +--- Type of dispatch -- to method, handler, or none 560 * | | | +--- Type of dispatch -- to method, handler, or none
638 * | | +--- Enabled for runtime? 561 * | | +--- Enabled for runtime?
639 * | +--- Enabled for wake? 562 * | +--- Enabled for wake?
640 * +--- System state when GPE ocurred (running/waking) 563 * +--- Unused
641 */ 564 */
642#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01 565#define ACPI_GPE_XRUPT_TYPE_MASK (u8) 0x01
643#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01 566#define ACPI_GPE_LEVEL_TRIGGERED (u8) 0x01
@@ -663,10 +586,6 @@ typedef u32 acpi_event_status;
663 586
664#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */ 587#define ACPI_GPE_ENABLE_MASK (u8) 0x60 /* Both run/wake */
665 588
666#define ACPI_GPE_SYSTEM_MASK (u8) 0x80
667#define ACPI_GPE_SYSTEM_RUNNING (u8) 0x80
668#define ACPI_GPE_SYSTEM_WAKING (u8) 0x00
669
670/* 589/*
671 * Flags for GPE and Lock interfaces 590 * Flags for GPE and Lock interfaces
672 */ 591 */
@@ -816,13 +735,6 @@ struct acpi_buffer {
816#define ACPI_SYS_MODES_MASK 0x0003 735#define ACPI_SYS_MODES_MASK 0x0003
817 736
818/* 737/*
819 * ACPI Table Info. One per ACPI table _type_
820 */
821struct acpi_table_info {
822 u32 count;
823};
824
825/*
826 * System info returned by acpi_get_system_info() 738 * System info returned by acpi_get_system_info()
827 */ 739 */
828struct acpi_system_info { 740struct acpi_system_info {
@@ -833,8 +745,6 @@ struct acpi_system_info {
833 u32 reserved2; 745 u32 reserved2;
834 u32 debug_level; 746 u32 debug_level;
835 u32 debug_layer; 747 u32 debug_layer;
836 u32 num_table_types;
837 struct acpi_table_info table_info[ACPI_TABLE_ID_MAX + 1];
838}; 748};
839 749
840/* 750/*
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index ba039ea1a057..883ffe92148f 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -141,8 +141,6 @@ acpi_status acpi_ut_hardware_initialize(void);
141 141
142void acpi_ut_subsystem_shutdown(void); 142void acpi_ut_subsystem_shutdown(void);
143 143
144acpi_status acpi_ut_validate_fadt(void);
145
146/* 144/*
147 * utclib - Local implementations of C library functions 145 * utclib - Local implementations of C library functions
148 */ 146 */
@@ -453,6 +451,8 @@ acpi_ut_short_divide(acpi_integer in_dividend,
453/* 451/*
454 * utmisc 452 * utmisc
455 */ 453 */
454const char *acpi_ut_validate_exception(acpi_status status);
455
456u8 acpi_ut_is_aml_table(struct acpi_table_header *table); 456u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
457 457
458acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); 458acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id);
@@ -470,7 +470,7 @@ void acpi_ut_print_string(char *string, u8 max_length);
470 470
471u8 acpi_ut_valid_acpi_name(u32 name); 471u8 acpi_ut_valid_acpi_name(u32 name);
472 472
473acpi_name acpi_ut_repair_name(acpi_name name); 473acpi_name acpi_ut_repair_name(char *name);
474 474
475u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position); 475u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position);
476 476
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index cf18426a87b1..da53a4ef287a 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2006, R. Byron Moore 10 * Copyright (C) 2000 - 2007, R. Byron Moore
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
@@ -273,7 +273,7 @@
273#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */ 273#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by size_of operator */
274#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */ 274#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
275#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */ 275#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
276#define ARGI_REGION_OR_FIELD 0x15 /* Used by LOAD op only */ 276#define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */
277#define ARGI_DATAREFOBJ 0x16 277#define ARGI_DATAREFOBJ 0x16
278 278
279/* Note: types above can expand to 0x1F maximum */ 279/* Note: types above can expand to 0x1F maximum */
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index be03818af9d1..f7d541239da4 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2006, R. Byron Moore 9 * Copyright (C) 2000 - 2007, R. Byron Moore
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 453a469fd397..dab2ec59a3b0 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index da80933963db..3bb50494a38a 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 7f1e92930b62..5f532d2ac180 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2006, R. Byron Moore 8 * Copyright (C) 2000 - 2007, R. Byron Moore
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h
index 7cfad93edf10..5e657eb8946c 100644
--- a/include/asm-i386/acpi.h
+++ b/include/asm-i386/acpi.h
@@ -39,7 +39,7 @@
39 * Calling conventions: 39 * Calling conventions:
40 * 40 *
41 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 41 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
42 * ACPI_EXTERNAL_XFACE - External ACPI interfaces 42 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
43 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 43 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
44 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 44 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
45 */ 45 */
@@ -59,11 +59,11 @@
59int __acpi_acquire_global_lock(unsigned int *lock); 59int __acpi_acquire_global_lock(unsigned int *lock);
60int __acpi_release_global_lock(unsigned int *lock); 60int __acpi_release_global_lock(unsigned int *lock);
61 61
62#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 62#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
63 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 63 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
64 64
65#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 65#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
66 ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr)) 66 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
67 67
68/* 68/*
69 * Math helper asm macros 69 * Math helper asm macros
@@ -87,7 +87,7 @@ extern void check_acpi_pci(void);
87static inline void check_acpi_pci(void) { } 87static inline void check_acpi_pci(void) { }
88#endif 88#endif
89 89
90#ifdef CONFIG_ACPI 90#ifdef CONFIG_ACPI
91extern int acpi_lapic; 91extern int acpi_lapic;
92extern int acpi_ioapic; 92extern int acpi_ioapic;
93extern int acpi_noirq; 93extern int acpi_noirq;
@@ -95,9 +95,9 @@ extern int acpi_strict;
95extern int acpi_disabled; 95extern int acpi_disabled;
96extern int acpi_ht; 96extern int acpi_ht;
97extern int acpi_pci_disabled; 97extern int acpi_pci_disabled;
98static inline void disable_acpi(void) 98static inline void disable_acpi(void)
99{ 99{
100 acpi_disabled = 1; 100 acpi_disabled = 1;
101 acpi_ht = 0; 101 acpi_ht = 0;
102 acpi_pci_disabled = 1; 102 acpi_pci_disabled = 1;
103 acpi_noirq = 1; 103 acpi_noirq = 1;
@@ -114,9 +114,9 @@ extern int acpi_use_timer_override;
114#endif 114#endif
115 115
116static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 116static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
117static inline void acpi_disable_pci(void) 117static inline void acpi_disable_pci(void)
118{ 118{
119 acpi_pci_disabled = 1; 119 acpi_pci_disabled = 1;
120 acpi_noirq_set(); 120 acpi_noirq_set();
121} 121}
122extern int acpi_irq_balance_set(char *str); 122extern int acpi_irq_balance_set(char *str);
@@ -144,8 +144,6 @@ extern void acpi_reserve_bootmem(void);
144 144
145#endif /*CONFIG_ACPI_SLEEP*/ 145#endif /*CONFIG_ACPI_SLEEP*/
146 146
147extern u8 x86_acpiid_to_apicid[];
148
149#define ARCH_HAS_POWER_INIT 1 147#define ARCH_HAS_POWER_INIT 1
150 148
151#endif /*__KERNEL__*/ 149#endif /*__KERNEL__*/
diff --git a/include/asm-i386/mach-es7000/mach_mpparse.h b/include/asm-i386/mach-es7000/mach_mpparse.h
index 99f66be240be..24990e546da3 100644
--- a/include/asm-i386/mach-es7000/mach_mpparse.h
+++ b/include/asm-i386/mach-es7000/mach_mpparse.h
@@ -3,13 +3,13 @@
3 3
4#include <linux/acpi.h> 4#include <linux/acpi.h>
5 5
6static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name, 6static inline void mpc_oem_bus_info(struct mpc_config_bus *m, char *name,
7 struct mpc_config_translation *translation) 7 struct mpc_config_translation *translation)
8{ 8{
9 Dprintk("Bus #%d is %s\n", m->mpc_busid, name); 9 Dprintk("Bus #%d is %s\n", m->mpc_busid, name);
10} 10}
11 11
12static inline void mpc_oem_pci_bus(struct mpc_config_bus *m, 12static inline void mpc_oem_pci_bus(struct mpc_config_bus *m,
13 struct mpc_config_translation *translation) 13 struct mpc_config_translation *translation)
14{ 14{
15} 15}
@@ -22,7 +22,7 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
22 char *productid) 22 char *productid)
23{ 23{
24 if (mpc->mpc_oemptr) { 24 if (mpc->mpc_oemptr) {
25 struct mp_config_oemtable *oem_table = 25 struct mp_config_oemtable *oem_table =
26 (struct mp_config_oemtable *)mpc->mpc_oemptr; 26 (struct mp_config_oemtable *)mpc->mpc_oemptr;
27 if (!strncmp(oem, "UNISYS", 6)) 27 if (!strncmp(oem, "UNISYS", 6))
28 return parse_unisys_oem((char *)oem_table); 28 return parse_unisys_oem((char *)oem_table);
@@ -31,12 +31,13 @@ static inline int mps_oem_check(struct mp_config_table *mpc, char *oem,
31} 31}
32 32
33#ifdef CONFIG_ACPI 33#ifdef CONFIG_ACPI
34
34static inline int es7000_check_dsdt(void) 35static inline int es7000_check_dsdt(void)
35{ 36{
36 struct acpi_table_header *header = NULL; 37 struct acpi_table_header header;
37 if(!acpi_get_table_header_early(ACPI_DSDT, &header)) 38 memcpy(&header, 0, sizeof(struct acpi_table_header));
38 acpi_table_print(header, 0); 39 acpi_get_table_header(ACPI_SIG_DSDT, 0, &header);
39 if (!strncmp(header->oem_id, "UNISYS", 6)) 40 if (!strncmp(header.oem_id, "UNISYS", 6))
40 return 1; 41 return 1;
41 return 0; 42 return 0;
42} 43}
@@ -44,7 +45,7 @@ static inline int es7000_check_dsdt(void)
44/* Hook from generic ACPI tables.c */ 45/* Hook from generic ACPI tables.c */
45static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id) 46static inline int acpi_madt_oem_check(char *oem_id, char *oem_table_id)
46{ 47{
47 unsigned long oem_addr; 48 unsigned long oem_addr;
48 if (!find_unisys_acpi_oem_table(&oem_addr)) { 49 if (!find_unisys_acpi_oem_table(&oem_addr)) {
49 if (es7000_check_dsdt()) 50 if (es7000_check_dsdt())
50 return parse_unisys_oem((char *)oem_addr); 51 return parse_unisys_oem((char *)oem_addr);
diff --git a/include/asm-ia64/acpi.h b/include/asm-ia64/acpi.h
index 09a5dd0e44a8..5d03792d4f65 100644
--- a/include/asm-ia64/acpi.h
+++ b/include/asm-ia64/acpi.h
@@ -82,11 +82,11 @@ ia64_acpi_release_global_lock (unsigned int *lock)
82 return old & 0x1; 82 return old & 0x1;
83} 83}
84 84
85#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 85#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
86 ((Acq) = ia64_acpi_acquire_global_lock((unsigned int *) GLptr)) 86 ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock))
87 87
88#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 88#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
89 ((Acq) = ia64_acpi_release_global_lock((unsigned int *) GLptr)) 89 ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock))
90 90
91#define acpi_disabled 0 /* ACPI always enabled on IA64 */ 91#define acpi_disabled 0 /* ACPI always enabled on IA64 */
92#define acpi_noirq 0 /* ACPI always enabled on IA64 */ 92#define acpi_noirq 0 /* ACPI always enabled on IA64 */
@@ -119,8 +119,6 @@ extern int __devinitdata pxm_to_nid_map[MAX_PXM_DOMAINS];
119extern int __initdata nid_to_pxm_map[MAX_NUMNODES]; 119extern int __initdata nid_to_pxm_map[MAX_NUMNODES];
120#endif 120#endif
121 121
122extern u16 ia64_acpiid_to_sapicid[];
123
124/* 122/*
125 * Refer Intel ACPI _PDC support document for bit definitions 123 * Refer Intel ACPI _PDC support document for bit definitions
126 */ 124 */
diff --git a/include/asm-ia64/sn/acpi.h b/include/asm-ia64/sn/acpi.h
index 2850a7ef5e71..9ce2801cbd57 100644
--- a/include/asm-ia64/sn/acpi.h
+++ b/include/asm-ia64/sn/acpi.h
@@ -11,6 +11,7 @@
11 11
12#include "acpi/acglobal.h" 12#include "acpi/acglobal.h"
13 13
14#define SN_ACPI_BASE_SUPPORT() (acpi_gbl_DSDT->oem_revision >= 0x20101) 14extern int sn_acpi_rev;
15#define SN_ACPI_BASE_SUPPORT() (sn_acpi_rev >= 0x20101)
15 16
16#endif /* _ASM_IA64_SN_ACPI_H */ 17#endif /* _ASM_IA64_SN_ACPI_H */
diff --git a/include/asm-ia64/sn/pcibr_provider.h b/include/asm-ia64/sn/pcibr_provider.h
index da3eade0cae2..17cb6cc3f21a 100644
--- a/include/asm-ia64/sn/pcibr_provider.h
+++ b/include/asm-ia64/sn/pcibr_provider.h
@@ -142,7 +142,7 @@ extern int pcibr_ate_alloc(struct pcibus_info *, int);
142extern void pcibr_ate_free(struct pcibus_info *, int); 142extern void pcibr_ate_free(struct pcibus_info *, int);
143extern void ate_write(struct pcibus_info *, int, int, u64); 143extern void ate_write(struct pcibus_info *, int, int, u64);
144extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device, 144extern int sal_pcibr_slot_enable(struct pcibus_info *soft, int device,
145 void *resp); 145 void *resp, char **ssdt);
146extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device, 146extern int sal_pcibr_slot_disable(struct pcibus_info *soft, int device,
147 int action, void *resp); 147 int action, void *resp);
148extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus); 148extern u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus);
diff --git a/include/asm-ia64/sn/pcidev.h b/include/asm-ia64/sn/pcidev.h
index 9fe89a93d880..1c2382cea807 100644
--- a/include/asm-ia64/sn/pcidev.h
+++ b/include/asm-ia64/sn/pcidev.h
@@ -70,10 +70,16 @@ extern void sn_irq_fixup(struct pci_dev *pci_dev,
70 struct sn_irq_info *sn_irq_info); 70 struct sn_irq_info *sn_irq_info);
71extern void sn_irq_unfixup(struct pci_dev *pci_dev); 71extern void sn_irq_unfixup(struct pci_dev *pci_dev);
72extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *); 72extern struct pcidev_info * sn_pcidev_info_get(struct pci_dev *);
73extern void sn_bus_fixup(struct pci_bus *);
74extern void sn_acpi_bus_fixup(struct pci_bus *);
75extern void sn_common_bus_fixup(struct pci_bus *, struct pcibus_bussoft *);
73extern void sn_bus_store_sysdata(struct pci_dev *dev); 76extern void sn_bus_store_sysdata(struct pci_dev *dev);
74extern void sn_bus_free_sysdata(void); 77extern void sn_bus_free_sysdata(void);
75extern void sn_generate_path(struct pci_bus *pci_bus, char *address); 78extern void sn_generate_path(struct pci_bus *pci_bus, char *address);
76extern void sn_pci_fixup_slot(struct pci_dev *dev); 79extern void sn_io_slot_fixup(struct pci_dev *);
80extern void sn_acpi_slot_fixup(struct pci_dev *);
81extern void sn_pci_fixup_slot(struct pci_dev *dev, struct pcidev_info *,
82 struct sn_irq_info *);
77extern void sn_pci_unfixup_slot(struct pci_dev *dev); 83extern void sn_pci_unfixup_slot(struct pci_dev *dev);
78extern void sn_irq_lh_init(void); 84extern void sn_irq_lh_init(void);
79#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */ 85#endif /* _ASM_IA64_SN_PCI_PCIDEV_H */
diff --git a/include/asm-x86_64/acpi.h b/include/asm-x86_64/acpi.h
index 6b6fc6f8be7e..a29f05087a31 100644
--- a/include/asm-x86_64/acpi.h
+++ b/include/asm-x86_64/acpi.h
@@ -37,7 +37,7 @@
37 * Calling conventions: 37 * Calling conventions:
38 * 38 *
39 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) 39 * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
40 * ACPI_EXTERNAL_XFACE - External ACPI interfaces 40 * ACPI_EXTERNAL_XFACE - External ACPI interfaces
41 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces 41 * ACPI_INTERNAL_XFACE - Internal ACPI interfaces
42 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces 42 * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
43 */ 43 */
@@ -57,11 +57,11 @@
57int __acpi_acquire_global_lock(unsigned int *lock); 57int __acpi_acquire_global_lock(unsigned int *lock);
58int __acpi_release_global_lock(unsigned int *lock); 58int __acpi_release_global_lock(unsigned int *lock);
59 59
60#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ 60#define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \
61 ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) 61 ((Acq) = __acpi_acquire_global_lock(&facs->global_lock))
62 62
63#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ 63#define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \
64 ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr)) 64 ((Acq) = __acpi_release_global_lock(&facs->global_lock))
65 65
66/* 66/*
67 * Math helper asm macros 67 * Math helper asm macros
@@ -87,10 +87,10 @@ extern int acpi_strict;
87extern int acpi_disabled; 87extern int acpi_disabled;
88extern int acpi_pci_disabled; 88extern int acpi_pci_disabled;
89extern int acpi_ht; 89extern int acpi_ht;
90static inline void disable_acpi(void) 90static inline void disable_acpi(void)
91{ 91{
92 acpi_disabled = 1; 92 acpi_disabled = 1;
93 acpi_ht = 0; 93 acpi_ht = 0;
94 acpi_pci_disabled = 1; 94 acpi_pci_disabled = 1;
95 acpi_noirq = 1; 95 acpi_noirq = 1;
96} 96}
@@ -100,9 +100,9 @@ static inline void disable_acpi(void)
100 100
101extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq); 101extern int acpi_gsi_to_irq(u32 gsi, unsigned int *irq);
102static inline void acpi_noirq_set(void) { acpi_noirq = 1; } 102static inline void acpi_noirq_set(void) { acpi_noirq = 1; }
103static inline void acpi_disable_pci(void) 103static inline void acpi_disable_pci(void)
104{ 104{
105 acpi_pci_disabled = 1; 105 acpi_pci_disabled = 1;
106 acpi_noirq_set(); 106 acpi_noirq_set();
107} 107}
108extern int acpi_irq_balance_set(char *str); 108extern int acpi_irq_balance_set(char *str);
@@ -136,8 +136,6 @@ extern void acpi_reserve_bootmem(void);
136extern int acpi_disabled; 136extern int acpi_disabled;
137extern int acpi_pci_disabled; 137extern int acpi_pci_disabled;
138 138
139extern u8 x86_acpiid_to_apicid[];
140
141#define ARCH_HAS_POWER_INIT 1 139#define ARCH_HAS_POWER_INIT 1
142 140
143extern int acpi_skip_timer_override; 141extern int acpi_skip_timer_override;
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 91f1f2363870..815f1fb4ce21 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -53,166 +53,6 @@ enum acpi_irq_model_id {
53 53
54extern enum acpi_irq_model_id acpi_irq_model; 54extern enum acpi_irq_model_id acpi_irq_model;
55 55
56
57/* Root System Description Pointer (RSDP) */
58
59struct acpi_table_rsdp {
60 char signature[8];
61 u8 checksum;
62 char oem_id[6];
63 u8 revision;
64 u32 rsdt_address;
65} __attribute__ ((packed));
66
67struct acpi20_table_rsdp {
68 char signature[8];
69 u8 checksum;
70 char oem_id[6];
71 u8 revision;
72 u32 rsdt_address;
73 u32 length;
74 u64 xsdt_address;
75 u8 ext_checksum;
76 u8 reserved[3];
77} __attribute__ ((packed));
78
79typedef struct {
80 u8 type;
81 u8 length;
82} __attribute__ ((packed)) acpi_table_entry_header;
83
84/* Root System Description Table (RSDT) */
85
86struct acpi_table_rsdt {
87 struct acpi_table_header header;
88 u32 entry[8];
89} __attribute__ ((packed));
90
91/* Extended System Description Table (XSDT) */
92
93struct acpi_table_xsdt {
94 struct acpi_table_header header;
95 u64 entry[1];
96} __attribute__ ((packed));
97
98/* Fixed ACPI Description Table (FADT) */
99
100struct acpi_table_fadt {
101 struct acpi_table_header header;
102 u32 facs_addr;
103 u32 dsdt_addr;
104 /* ... */
105} __attribute__ ((packed));
106
107/* Multiple APIC Description Table (MADT) */
108
109struct acpi_table_madt {
110 struct acpi_table_header header;
111 u32 lapic_address;
112 struct {
113 u32 pcat_compat:1;
114 u32 reserved:31;
115 } flags;
116} __attribute__ ((packed));
117
118enum acpi_madt_entry_id {
119 ACPI_MADT_LAPIC = 0,
120 ACPI_MADT_IOAPIC,
121 ACPI_MADT_INT_SRC_OVR,
122 ACPI_MADT_NMI_SRC,
123 ACPI_MADT_LAPIC_NMI,
124 ACPI_MADT_LAPIC_ADDR_OVR,
125 ACPI_MADT_IOSAPIC,
126 ACPI_MADT_LSAPIC,
127 ACPI_MADT_PLAT_INT_SRC,
128 ACPI_MADT_ENTRY_COUNT
129};
130
131typedef struct {
132 u16 polarity:2;
133 u16 trigger:2;
134 u16 reserved:12;
135} __attribute__ ((packed)) acpi_interrupt_flags;
136
137struct acpi_table_lapic {
138 acpi_table_entry_header header;
139 u8 acpi_id;
140 u8 id;
141 struct {
142 u32 enabled:1;
143 u32 reserved:31;
144 } flags;
145} __attribute__ ((packed));
146
147struct acpi_table_ioapic {
148 acpi_table_entry_header header;
149 u8 id;
150 u8 reserved;
151 u32 address;
152 u32 global_irq_base;
153} __attribute__ ((packed));
154
155struct acpi_table_int_src_ovr {
156 acpi_table_entry_header header;
157 u8 bus;
158 u8 bus_irq;
159 u32 global_irq;
160 acpi_interrupt_flags flags;
161} __attribute__ ((packed));
162
163struct acpi_table_nmi_src {
164 acpi_table_entry_header header;
165 acpi_interrupt_flags flags;
166 u32 global_irq;
167} __attribute__ ((packed));
168
169struct acpi_table_lapic_nmi {
170 acpi_table_entry_header header;
171 u8 acpi_id;
172 acpi_interrupt_flags flags;
173 u8 lint;
174} __attribute__ ((packed));
175
176struct acpi_table_lapic_addr_ovr {
177 acpi_table_entry_header header;
178 u8 reserved[2];
179 u64 address;
180} __attribute__ ((packed));
181
182struct acpi_table_iosapic {
183 acpi_table_entry_header header;
184 u8 id;
185 u8 reserved;
186 u32 global_irq_base;
187 u64 address;
188} __attribute__ ((packed));
189
190struct acpi_table_lsapic {
191 acpi_table_entry_header header;
192 u8 acpi_id;
193 u8 id;
194 u8 eid;
195 u8 reserved[3];
196 struct {
197 u32 enabled:1;
198 u32 reserved:31;
199 } flags;
200} __attribute__ ((packed));
201
202struct acpi_table_plat_int_src {
203 acpi_table_entry_header header;
204 acpi_interrupt_flags flags;
205 u8 type; /* See acpi_interrupt_type */
206 u8 id;
207 u8 eid;
208 u8 iosapic_vector;
209 u32 global_irq;
210 struct {
211 u32 cpei_override_flag:1;
212 u32 reserved:31;
213 } plint_flags;
214} __attribute__ ((packed));
215
216enum acpi_interrupt_id { 56enum acpi_interrupt_id {
217 ACPI_INTERRUPT_PMI = 1, 57 ACPI_INTERRUPT_PMI = 1,
218 ACPI_INTERRUPT_INIT, 58 ACPI_INTERRUPT_INIT,
@@ -222,89 +62,6 @@ enum acpi_interrupt_id {
222 62
223#define ACPI_SPACE_MEM 0 63#define ACPI_SPACE_MEM 0
224 64
225struct acpi_gen_regaddr {
226 u8 space_id;
227 u8 bit_width;
228 u8 bit_offset;
229 u8 resv;
230 u32 addrl;
231 u32 addrh;
232} __attribute__ ((packed));
233
234struct acpi_table_hpet {
235 struct acpi_table_header header;
236 u32 id;
237 struct acpi_gen_regaddr addr;
238 u8 number;
239 u16 min_tick;
240 u8 page_protect;
241} __attribute__ ((packed));
242
243/*
244 * Simple Boot Flags
245 * http://www.microsoft.com/whdc/hwdev/resources/specs/simp_bios.mspx
246 */
247struct acpi_table_sbf
248{
249 u8 sbf_signature[4];
250 u32 sbf_len;
251 u8 sbf_revision;
252 u8 sbf_csum;
253 u8 sbf_oemid[6];
254 u8 sbf_oemtable[8];
255 u8 sbf_revdata[4];
256 u8 sbf_creator[4];
257 u8 sbf_crearev[4];
258 u8 sbf_cmos;
259 u8 sbf_spare[3];
260} __attribute__ ((packed));
261
262/*
263 * System Resource Affinity Table (SRAT)
264 * http://www.microsoft.com/whdc/hwdev/platform/proc/SRAT.mspx
265 */
266
267struct acpi_table_srat {
268 struct acpi_table_header header;
269 u32 table_revision;
270 u64 reserved;
271} __attribute__ ((packed));
272
273enum acpi_srat_entry_id {
274 ACPI_SRAT_PROCESSOR_AFFINITY = 0,
275 ACPI_SRAT_MEMORY_AFFINITY,
276 ACPI_SRAT_ENTRY_COUNT
277};
278
279struct acpi_table_processor_affinity {
280 acpi_table_entry_header header;
281 u8 proximity_domain;
282 u8 apic_id;
283 struct {
284 u32 enabled:1;
285 u32 reserved:31;
286 } flags;
287 u8 lsapic_eid;
288 u8 reserved[7];
289} __attribute__ ((packed));
290
291struct acpi_table_memory_affinity {
292 acpi_table_entry_header header;
293 u8 proximity_domain;
294 u8 reserved1[5];
295 u32 base_addr_lo;
296 u32 base_addr_hi;
297 u32 length_lo;
298 u32 length_hi;
299 u32 memory_type; /* See acpi_address_range_id */
300 struct {
301 u32 enabled:1;
302 u32 hot_pluggable:1;
303 u32 reserved:30;
304 } flags;
305 u64 reserved2;
306} __attribute__ ((packed));
307
308enum acpi_address_range_id { 65enum acpi_address_range_id {
309 ACPI_ADDRESS_RANGE_MEMORY = 1, 66 ACPI_ADDRESS_RANGE_MEMORY = 1,
310 ACPI_ADDRESS_RANGE_RESERVED = 2, 67 ACPI_ADDRESS_RANGE_RESERVED = 2,
@@ -313,84 +70,12 @@ enum acpi_address_range_id {
313 ACPI_ADDRESS_RANGE_COUNT 70 ACPI_ADDRESS_RANGE_COUNT
314}; 71};
315 72
316/*
317 * System Locality Information Table (SLIT)
318 * see http://devresource.hp.com/devresource/docs/techpapers/ia64/slit.pdf
319 */
320
321struct acpi_table_slit {
322 struct acpi_table_header header;
323 u64 localities;
324 u8 entry[1]; /* real size = localities^2 */
325} __attribute__ ((packed));
326
327/* Smart Battery Description Table (SBST) */
328
329struct acpi_table_sbst {
330 struct acpi_table_header header;
331 u32 warning; /* Warn user */
332 u32 low; /* Critical sleep */
333 u32 critical; /* Critical shutdown */
334} __attribute__ ((packed));
335
336/* Embedded Controller Boot Resources Table (ECDT) */
337
338struct acpi_table_ecdt {
339 struct acpi_table_header header;
340 struct acpi_generic_address ec_control;
341 struct acpi_generic_address ec_data;
342 u32 uid;
343 u8 gpe_bit;
344 char ec_id[0];
345} __attribute__ ((packed));
346
347/* PCI MMCONFIG */
348
349/* Defined in PCI Firmware Specification 3.0 */
350struct acpi_table_mcfg_config {
351 u32 base_address;
352 u32 base_reserved;
353 u16 pci_segment_group_number;
354 u8 start_bus_number;
355 u8 end_bus_number;
356 u8 reserved[4];
357} __attribute__ ((packed));
358struct acpi_table_mcfg {
359 struct acpi_table_header header;
360 u8 reserved[8];
361 struct acpi_table_mcfg_config config[0];
362} __attribute__ ((packed));
363 73
364/* Table Handlers */ 74/* Table Handlers */
365 75
366enum acpi_table_id { 76typedef int (*acpi_table_handler) (struct acpi_table_header *table);
367 ACPI_TABLE_UNKNOWN = 0,
368 ACPI_APIC,
369 ACPI_BOOT,
370 ACPI_DBGP,
371 ACPI_DSDT,
372 ACPI_ECDT,
373 ACPI_ETDT,
374 ACPI_FADT,
375 ACPI_FACS,
376 ACPI_OEMX,
377 ACPI_PSDT,
378 ACPI_SBST,
379 ACPI_SLIT,
380 ACPI_SPCR,
381 ACPI_SRAT,
382 ACPI_SSDT,
383 ACPI_SPMI,
384 ACPI_HPET,
385 ACPI_MCFG,
386 ACPI_TABLE_COUNT
387};
388
389typedef int (*acpi_table_handler) (unsigned long phys_addr, unsigned long size);
390
391extern acpi_table_handler acpi_table_ops[ACPI_TABLE_COUNT];
392 77
393typedef int (*acpi_madt_entry_handler) (acpi_table_entry_header *header, const unsigned long end); 78typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
394 79
395char * __acpi_map_table (unsigned long phys_addr, unsigned long size); 80char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
396unsigned long acpi_find_rsdp (void); 81unsigned long acpi_find_rsdp (void);
@@ -399,14 +84,12 @@ int acpi_boot_table_init (void);
399int acpi_numa_init (void); 84int acpi_numa_init (void);
400 85
401int acpi_table_init (void); 86int acpi_table_init (void);
402int acpi_table_parse (enum acpi_table_id id, acpi_table_handler handler); 87int acpi_table_parse (char *id, acpi_table_handler handler);
403int acpi_get_table_header_early (enum acpi_table_id id, struct acpi_table_header **header); 88int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
404int acpi_table_parse_madt (enum acpi_madt_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); 89int acpi_table_parse_srat (enum acpi_srat_type id, acpi_madt_entry_handler handler, unsigned int max_entries);
405int acpi_table_parse_srat (enum acpi_srat_entry_id id, acpi_madt_entry_handler handler, unsigned int max_entries); 90int acpi_parse_mcfg (struct acpi_table_header *header);
406int acpi_parse_mcfg (unsigned long phys_addr, unsigned long size); 91void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
407void acpi_table_print (struct acpi_table_header *header, unsigned long phys_addr); 92void acpi_table_print_srat_entry (struct acpi_subtable_header *srat);
408void acpi_table_print_madt_entry (acpi_table_entry_header *madt);
409void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
410 93
411/* the following four functions are architecture-dependent */ 94/* the following four functions are architecture-dependent */
412#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT 95#ifdef CONFIG_HAVE_ARCH_PARSE_SRAT
@@ -417,8 +100,8 @@ void acpi_table_print_srat_entry (acpi_table_entry_header *srat);
417#define acpi_numa_arch_fixup() do {} while (0) 100#define acpi_numa_arch_fixup() do {} while (0)
418#else 101#else
419void acpi_numa_slit_init (struct acpi_table_slit *slit); 102void acpi_numa_slit_init (struct acpi_table_slit *slit);
420void acpi_numa_processor_affinity_init (struct acpi_table_processor_affinity *pa); 103void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
421void acpi_numa_memory_affinity_init (struct acpi_table_memory_affinity *ma); 104void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
422void acpi_numa_arch_fixup(void); 105void acpi_numa_arch_fixup(void);
423#endif 106#endif
424 107
@@ -433,7 +116,7 @@ int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
433 116
434extern int acpi_mp_config; 117extern int acpi_mp_config;
435 118
436extern struct acpi_table_mcfg_config *pci_mmcfg_config; 119extern struct acpi_mcfg_allocation *pci_mmcfg_config;
437extern int pci_mmcfg_config_num; 120extern int pci_mmcfg_config_num;
438 121
439extern int sbf_port; 122extern int sbf_port;
diff --git a/include/linux/video_output.h b/include/linux/video_output.h
new file mode 100644
index 000000000000..e63e0c03ee0d
--- /dev/null
+++ b/include/linux/video_output.h
@@ -0,0 +1,42 @@
1/*
2 *
3 * Copyright (C) 2006 Luming Yu <luming.yu@intel.com>
4 *
5 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or (at
10 * your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 *
21 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 */
23#ifndef _LINUX_VIDEO_OUTPUT_H
24#define _LINUX_VIDEO_OUTPUT_H
25#include <linux/device.h>
26struct output_device;
27struct output_properties {
28 int (*set_state)(struct output_device *);
29 int (*get_status)(struct output_device *);
30};
31struct output_device {
32 int request_state;
33 struct output_properties *props;
34 struct class_device class_dev;
35};
36#define to_output_device(obj) container_of(obj, struct output_device, class_dev)
37struct output_device *video_output_register(const char *name,
38 struct device *dev,
39 void *devdata,
40 struct output_properties *op);
41void video_output_unregister(struct output_device *dev);
42#endif