aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/i386/kernel/acpi/boot.c4
-rw-r--r--drivers/acpi/bus.c2
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c2
-rw-r--r--drivers/acpi/dispatcher/dswexec.c1
-rw-r--r--drivers/acpi/events/evrgnini.c13
-rw-r--r--drivers/acpi/executer/exdump.c6
-rw-r--r--drivers/acpi/executer/exnames.c2
-rw-r--r--drivers/acpi/hardware/hwtimer.c4
-rw-r--r--drivers/acpi/namespace/nsalloc.c2
-rw-r--r--drivers/acpi/namespace/nsdump.c3
-rw-r--r--drivers/acpi/namespace/nssearch.c50
-rw-r--r--drivers/acpi/parser/psloop.c12
-rw-r--r--drivers/acpi/parser/psscope.c4
-rw-r--r--drivers/acpi/resources/rslist.c8
-rw-r--r--drivers/acpi/system.c2
-rw-r--r--drivers/acpi/tables.c4
-rw-r--r--drivers/acpi/tables/tbconvrt.c31
-rw-r--r--drivers/acpi/tables/tbrsdt.c3
-rw-r--r--drivers/acpi/tables/tbutils.c122
-rw-r--r--drivers/acpi/tables/tbxfroot.c9
-rw-r--r--drivers/acpi/utilities/utdebug.c38
-rw-r--r--drivers/acpi/utilities/utdelete.c16
-rw-r--r--drivers/acpi/utilities/utglobal.c2
-rw-r--r--drivers/acpi/utilities/utinit.c6
-rw-r--r--drivers/acpi/utilities/utmisc.c104
-rw-r--r--drivers/acpi/utilities/utresrc.c6
-rw-r--r--drivers/acpi/utilities/utstate.c10
-rw-r--r--include/acpi/acconfig.h2
-rw-r--r--include/acpi/acdisasm.h141
-rw-r--r--include/acpi/acglobal.h7
-rw-r--r--include/acpi/aclocal.h14
-rw-r--r--include/acpi/acmacros.h7
-rw-r--r--include/acpi/acobject.h4
-rw-r--r--include/acpi/acparser.h9
-rw-r--r--include/acpi/acpi_bus.h2
-rw-r--r--include/acpi/acpiosxf.h2
-rw-r--r--include/acpi/acstruct.h2
-rw-r--r--include/acpi/actables.h6
-rw-r--r--include/acpi/actbl.h400
-rw-r--r--include/acpi/actbl1.h639
-rw-r--r--include/acpi/actbl2.h230
-rw-r--r--include/acpi/acutils.h10
-rw-r--r--include/acpi/platform/acenv.h4
43 files changed, 1314 insertions, 631 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c
index 033066176b3e..a6fe91225202 100644
--- a/arch/i386/kernel/acpi/boot.c
+++ b/arch/i386/kernel/acpi/boot.c
@@ -621,9 +621,9 @@ extern u32 pmtmr_ioport;
621 621
622static int __init acpi_parse_fadt(unsigned long phys, unsigned long size) 622static int __init acpi_parse_fadt(unsigned long phys, unsigned long size)
623{ 623{
624 struct fadt_descriptor_rev2 *fadt = NULL; 624 struct fadt_descriptor *fadt = NULL;
625 625
626 fadt = (struct fadt_descriptor_rev2 *)__acpi_map_table(phys, size); 626 fadt = (struct fadt_descriptor *)__acpi_map_table(phys, size);
627 if (!fadt) { 627 if (!fadt) {
628 printk(KERN_WARNING PREFIX "Unable to map FADT\n"); 628 printk(KERN_WARNING PREFIX "Unable to map FADT\n");
629 return 0; 629 return 0;
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 9c4ac0191f64..b3a214db56f6 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -43,7 +43,7 @@ ACPI_MODULE_NAME("acpi_bus")
43extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger); 43extern void __init acpi_pic_sci_set_trigger(unsigned int irq, u16 trigger);
44#endif 44#endif
45 45
46FADT_DESCRIPTOR acpi_fadt; 46struct fadt_descriptor acpi_fadt;
47EXPORT_SYMBOL(acpi_fadt); 47EXPORT_SYMBOL(acpi_fadt);
48 48
49struct acpi_device *acpi_root; 49struct acpi_device *acpi_root;
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 238916ce5412..7dc59fc7344f 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -502,7 +502,7 @@ void acpi_ds_terminate_control_method(struct acpi_walk_state *walk_state)
502 * Delete any namespace entries created immediately underneath 502 * Delete any namespace entries created immediately underneath
503 * the method 503 * the method
504 */ 504 */
505 if (method_node->child) { 505 if (method_node && method_node->child) {
506 acpi_ns_delete_namespace_subtree(method_node); 506 acpi_ns_delete_namespace_subtree(method_node);
507 } 507 }
508 508
diff --git a/drivers/acpi/dispatcher/dswexec.c b/drivers/acpi/dispatcher/dswexec.c
index 198949f41048..8b740b370eb1 100644
--- a/drivers/acpi/dispatcher/dswexec.c
+++ b/drivers/acpi/dispatcher/dswexec.c
@@ -49,7 +49,6 @@
49#include <acpi/acinterp.h> 49#include <acpi/acinterp.h>
50#include <acpi/acnamesp.h> 50#include <acpi/acnamesp.h>
51#include <acpi/acdebug.h> 51#include <acpi/acdebug.h>
52#include <acpi/acdisasm.h>
53 52
54#define _COMPONENT ACPI_DISPATCHER 53#define _COMPONENT ACPI_DISPATCHER
55ACPI_MODULE_NAME("dswexec") 54ACPI_MODULE_NAME("dswexec")
diff --git a/drivers/acpi/events/evrgnini.c b/drivers/acpi/events/evrgnini.c
index db98747fe54d..d1809f4240a4 100644
--- a/drivers/acpi/events/evrgnini.c
+++ b/drivers/acpi/events/evrgnini.c
@@ -75,7 +75,18 @@ acpi_ev_system_memory_region_setup(acpi_handle handle,
75 75
76 if (function == ACPI_REGION_DEACTIVATE) { 76 if (function == ACPI_REGION_DEACTIVATE) {
77 if (*region_context) { 77 if (*region_context) {
78 ACPI_FREE(*region_context); 78 local_region_context =
79 (struct acpi_mem_space_context *)*region_context;
80
81 /* Delete a cached mapping if present */
82
83 if (local_region_context->mapped_length) {
84 acpi_os_unmap_memory(local_region_context->
85 mapped_logical_address,
86 local_region_context->
87 mapped_length);
88 }
89 ACPI_FREE(local_region_context);
79 *region_context = NULL; 90 *region_context = NULL;
80 } 91 }
81 return_ACPI_STATUS(AE_OK); 92 return_ACPI_STATUS(AE_OK);
diff --git a/drivers/acpi/executer/exdump.c b/drivers/acpi/executer/exdump.c
index 56db58b8e23a..1dfebf9e7074 100644
--- a/drivers/acpi/executer/exdump.c
+++ b/drivers/acpi/executer/exdump.c
@@ -61,6 +61,10 @@ static void acpi_ex_out_pointer(char *title, void *value);
61 61
62static void acpi_ex_out_address(char *title, acpi_physical_address value); 62static void acpi_ex_out_address(char *title, acpi_physical_address value);
63 63
64static void
65acpi_ex_dump_object(union acpi_operand_object *obj_desc,
66 struct acpi_exdump_info *info);
67
64static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc); 68static void acpi_ex_dump_reference_obj(union acpi_operand_object *obj_desc);
65 69
66static void 70static void
@@ -263,7 +267,7 @@ static struct acpi_exdump_info acpi_ex_dump_field_common[7] = {
263 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(common_field.node), "Parent Node"} 267 {ACPI_EXD_POINTER, ACPI_EXD_OFFSET(common_field.node), "Parent Node"}
264}; 268};
265 269
266static struct acpi_exdump_info acpi_ex_dump_node[6] = { 270static struct acpi_exdump_info acpi_ex_dump_node[5] = {
267 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL}, 271 {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE(acpi_ex_dump_node), NULL},
268 {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"}, 272 {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(flags), "Flags"},
269 {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"}, 273 {ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET(owner_id), "Owner Id"},
diff --git a/drivers/acpi/executer/exnames.c b/drivers/acpi/executer/exnames.c
index 80bbc20756a1..085b18f8dd00 100644
--- a/drivers/acpi/executer/exnames.c
+++ b/drivers/acpi/executer/exnames.c
@@ -179,7 +179,7 @@ static acpi_status acpi_ex_name_segment(u8 ** in_aml_address, char *name_string)
179 179
180 for (index = 0; 180 for (index = 0;
181 (index < ACPI_NAME_SIZE) 181 (index < ACPI_NAME_SIZE)
182 && (acpi_ut_valid_acpi_character(*aml_address)); index++) { 182 && (acpi_ut_valid_acpi_char(*aml_address, 0)); index++) {
183 char_buf[index] = *aml_address++; 183 char_buf[index] = *aml_address++;
184 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "%c\n", char_buf[index])); 184 ACPI_DEBUG_PRINT((ACPI_DB_LOAD, "%c\n", char_buf[index]));
185 } 185 }
diff --git a/drivers/acpi/hardware/hwtimer.c b/drivers/acpi/hardware/hwtimer.c
index 9d53e46bc331..a559ac17b132 100644
--- a/drivers/acpi/hardware/hwtimer.c
+++ b/drivers/acpi/hardware/hwtimer.c
@@ -66,7 +66,7 @@ acpi_status acpi_get_timer_resolution(u32 * resolution)
66 return_ACPI_STATUS(AE_BAD_PARAMETER); 66 return_ACPI_STATUS(AE_BAD_PARAMETER);
67 } 67 }
68 68
69 if (0 == acpi_gbl_FADT->tmr_val_ext) { 69 if (acpi_gbl_FADT->tmr_val_ext == 0) {
70 *resolution = 24; 70 *resolution = 24;
71 } else { 71 } else {
72 *resolution = 32; 72 *resolution = 32;
@@ -153,7 +153,7 @@ acpi_get_timer_duration(u32 start_ticks, u32 end_ticks, u32 * time_elapsed)
153 if (start_ticks < end_ticks) { 153 if (start_ticks < end_ticks) {
154 delta_ticks = end_ticks - start_ticks; 154 delta_ticks = end_ticks - start_ticks;
155 } else if (start_ticks > end_ticks) { 155 } else if (start_ticks > end_ticks) {
156 if (0 == acpi_gbl_FADT->tmr_val_ext) { 156 if (acpi_gbl_FADT->tmr_val_ext == 0) {
157 157
158 /* 24-bit Timer */ 158 /* 24-bit Timer */
159 159
diff --git a/drivers/acpi/namespace/nsalloc.c b/drivers/acpi/namespace/nsalloc.c
index 8b921c96d6a5..c92c03693a16 100644
--- a/drivers/acpi/namespace/nsalloc.c
+++ b/drivers/acpi/namespace/nsalloc.c
@@ -211,6 +211,8 @@ void acpi_ns_install_node(struct acpi_walk_state *walk_state, struct acpi_namesp
211 acpi_ut_get_node_name(parent_node), 211 acpi_ut_get_node_name(parent_node),
212 acpi_ut_get_type_name(parent_node->type), 212 acpi_ut_get_type_name(parent_node->type),
213 parent_node)); 213 parent_node));
214
215 return_VOID;
214} 216}
215 217
216/******************************************************************************* 218/*******************************************************************************
diff --git a/drivers/acpi/namespace/nsdump.c b/drivers/acpi/namespace/nsdump.c
index e275373b1705..5662d2def62f 100644
--- a/drivers/acpi/namespace/nsdump.c
+++ b/drivers/acpi/namespace/nsdump.c
@@ -204,6 +204,9 @@ acpi_ns_dump_one_object(acpi_handle obj_handle,
204 } 204 }
205 205
206 if (!acpi_ut_valid_acpi_name(this_node->name.integer)) { 206 if (!acpi_ut_valid_acpi_name(this_node->name.integer)) {
207 this_node->name.integer =
208 acpi_ut_repair_name(this_node->name.integer);
209
207 ACPI_WARNING((AE_INFO, "Invalid ACPI Name %08X", 210 ACPI_WARNING((AE_INFO, "Invalid ACPI Name %08X",
208 this_node->name.integer)); 211 this_node->name.integer));
209 } 212 }
diff --git a/drivers/acpi/namespace/nssearch.c b/drivers/acpi/namespace/nssearch.c
index c929f45071c0..51adec5a23d6 100644
--- a/drivers/acpi/namespace/nssearch.c
+++ b/drivers/acpi/namespace/nssearch.c
@@ -128,9 +128,8 @@ acpi_ns_search_node(u32 target_name,
128 next_node->object); 128 next_node->object);
129 } 129 }
130 130
131 /* 131 /* Found matching entry */
132 * Found matching entry. 132
133 */
134 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 133 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
135 "Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n", 134 "Name [%4.4s] (%s) %p found in scope [%4.4s] %p\n",
136 ACPI_CAST_PTR(char, &target_name), 135 ACPI_CAST_PTR(char, &target_name),
@@ -248,10 +247,8 @@ acpi_ns_search_parent_tree(u32 target_name,
248 return_ACPI_STATUS(status); 247 return_ACPI_STATUS(status);
249 } 248 }
250 249
251 /* 250 /* Not found here, go up another level (until we reach the root) */
252 * Not found here, go up another level 251
253 * (until we reach the root)
254 */
255 parent_node = acpi_ns_get_parent_node(parent_node); 252 parent_node = acpi_ns_get_parent_node(parent_node);
256 } 253 }
257 254
@@ -307,12 +304,29 @@ acpi_ns_search_and_enter(u32 target_name,
307 return_ACPI_STATUS(AE_BAD_PARAMETER); 304 return_ACPI_STATUS(AE_BAD_PARAMETER);
308 } 305 }
309 306
310 /* Name must consist of printable characters */ 307 /*
311 308 * Name must consist of valid ACPI characters. We will repair the name if
309 * necessary because we don't want to abort because of this, but we want
310 * all namespace names to be printable. A warning message is appropriate.
311 *
312 * This issue came up because there are in fact machines that exhibit
313 * this problem, and we want to be able to enable ACPI support for them,
314 * even though there are a few bad names.
315 */
312 if (!acpi_ut_valid_acpi_name(target_name)) { 316 if (!acpi_ut_valid_acpi_name(target_name)) {
313 ACPI_ERROR((AE_INFO, "Bad character in ACPI Name: %X", 317 target_name = acpi_ut_repair_name(target_name);
314 target_name)); 318
315 return_ACPI_STATUS(AE_BAD_CHARACTER); 319 /* Report warning only if in strict mode or debug mode */
320
321 if (!acpi_gbl_enable_interpreter_slack) {
322 ACPI_WARNING((AE_INFO,
323 "Found bad character(s) in name, repaired: [%4.4s]\n",
324 ACPI_CAST_PTR(char, &target_name)));
325 } else {
326 ACPI_DEBUG_PRINT((ACPI_DB_WARN,
327 "Found bad character(s) in name, repaired: [%4.4s]\n",
328 ACPI_CAST_PTR(char, &target_name)));
329 }
316 } 330 }
317 331
318 /* Try to find the name in the namespace level specified by the caller */ 332 /* Try to find the name in the namespace level specified by the caller */
@@ -328,10 +342,8 @@ acpi_ns_search_and_enter(u32 target_name,
328 status = AE_ALREADY_EXISTS; 342 status = AE_ALREADY_EXISTS;
329 } 343 }
330 344
331 /* 345 /* Either found it or there was an error: finished either way */
332 * Either found it or there was an error 346
333 * -- finished either way
334 */
335 return_ACPI_STATUS(status); 347 return_ACPI_STATUS(status);
336 } 348 }
337 349
@@ -357,9 +369,8 @@ acpi_ns_search_and_enter(u32 target_name,
357 } 369 }
358 } 370 }
359 371
360 /* 372 /* In execute mode, just search, never add names. Exit now */
361 * In execute mode, just search, never add names. Exit now. 373
362 */
363 if (interpreter_mode == ACPI_IMODE_EXECUTE) { 374 if (interpreter_mode == ACPI_IMODE_EXECUTE) {
364 ACPI_DEBUG_PRINT((ACPI_DB_NAMES, 375 ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
365 "%4.4s Not found in %p [Not adding]\n", 376 "%4.4s Not found in %p [Not adding]\n",
@@ -379,6 +390,5 @@ acpi_ns_search_and_enter(u32 target_name,
379 390
380 acpi_ns_install_node(walk_state, node, new_node, type); 391 acpi_ns_install_node(walk_state, node, new_node, type);
381 *return_node = new_node; 392 *return_node = new_node;
382
383 return_ACPI_STATUS(AE_OK); 393 return_ACPI_STATUS(AE_OK);
384} 394}
diff --git a/drivers/acpi/parser/psloop.c b/drivers/acpi/parser/psloop.c
index 14052cb648c1..3a29ce680370 100644
--- a/drivers/acpi/parser/psloop.c
+++ b/drivers/acpi/parser/psloop.c
@@ -747,7 +747,19 @@ acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state)
747 if (ACPI_FAILURE(status2)) { 747 if (ACPI_FAILURE(status2)) {
748 return_ACPI_STATUS(status2); 748 return_ACPI_STATUS(status2);
749 } 749 }
750
751 status2 =
752 acpi_ds_result_stack_pop
753 (walk_state);
754 if (ACPI_FAILURE(status2)) {
755 return_ACPI_STATUS(status2);
756 }
757
758 acpi_ut_delete_generic_state
759 (acpi_ut_pop_generic_state
760 (&walk_state->control_state));
750 } 761 }
762
751 acpi_ps_pop_scope(parser_state, &op, 763 acpi_ps_pop_scope(parser_state, &op,
752 &walk_state->arg_types, 764 &walk_state->arg_types,
753 &walk_state->arg_count); 765 &walk_state->arg_count);
diff --git a/drivers/acpi/parser/psscope.c b/drivers/acpi/parser/psscope.c
index 9233a4044d6b..424ab1c20da5 100644
--- a/drivers/acpi/parser/psscope.c
+++ b/drivers/acpi/parser/psscope.c
@@ -143,7 +143,7 @@ acpi_ps_init_scope(struct acpi_parse_state * parser_state,
143acpi_status 143acpi_status
144acpi_ps_push_scope(struct acpi_parse_state *parser_state, 144acpi_ps_push_scope(struct acpi_parse_state *parser_state,
145 union acpi_parse_object *op, 145 union acpi_parse_object *op,
146 u32 remaining_args, u8 arg_count) 146 u32 remaining_args, u32 arg_count)
147{ 147{
148 union acpi_generic_state *scope; 148 union acpi_generic_state *scope;
149 149
@@ -196,7 +196,7 @@ acpi_ps_push_scope(struct acpi_parse_state *parser_state,
196 196
197void 197void
198acpi_ps_pop_scope(struct acpi_parse_state *parser_state, 198acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
199 union acpi_parse_object **op, u32 * arg_list, u8 * arg_count) 199 union acpi_parse_object **op, u32 * arg_list, u32 * arg_count)
200{ 200{
201 union acpi_generic_state *scope = parser_state->scope; 201 union acpi_generic_state *scope = parser_state->scope;
202 202
diff --git a/drivers/acpi/resources/rslist.c b/drivers/acpi/resources/rslist.c
index 50bbb19bf4ae..1b2d1e717e74 100644
--- a/drivers/acpi/resources/rslist.c
+++ b/drivers/acpi/resources/rslist.c
@@ -64,10 +64,11 @@ ACPI_MODULE_NAME("rslist")
64acpi_status 64acpi_status
65acpi_rs_convert_aml_to_resources(u8 * aml, 65acpi_rs_convert_aml_to_resources(u8 * aml,
66 u32 length, 66 u32 length,
67 u32 offset, 67 u32 offset, u8 resource_index, void **context)
68 u8 resource_index, void **resource_ptr)
69{ 68{
70 struct acpi_resource *resource = *resource_ptr; 69 struct acpi_resource **resource_ptr =
70 ACPI_CAST_INDIRECT_PTR(struct acpi_resource, context);
71 struct acpi_resource *resource;
71 acpi_status status; 72 acpi_status status;
72 73
73 ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources"); 74 ACPI_FUNCTION_TRACE("rs_convert_aml_to_resources");
@@ -76,6 +77,7 @@ acpi_rs_convert_aml_to_resources(u8 * aml,
76 * Check that the input buffer and all subsequent pointers into it 77 * Check that the input buffer and all subsequent pointers into it
77 * are aligned on a native word boundary. Most important on IA64 78 * are aligned on a native word boundary. Most important on IA64
78 */ 79 */
80 resource = *resource_ptr;
79 if (ACPI_IS_MISALIGNED(resource)) { 81 if (ACPI_IS_MISALIGNED(resource)) {
80 ACPI_WARNING((AE_INFO, 82 ACPI_WARNING((AE_INFO,
81 "Misaligned resource pointer %p", resource)); 83 "Misaligned resource pointer %p", resource));
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index e4308c7a6743..1943bec18848 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -39,7 +39,7 @@ ACPI_MODULE_NAME("acpi_system")
39#define ACPI_SYSTEM_FILE_EVENT "event" 39#define ACPI_SYSTEM_FILE_EVENT "event"
40#define ACPI_SYSTEM_FILE_DSDT "dsdt" 40#define ACPI_SYSTEM_FILE_DSDT "dsdt"
41#define ACPI_SYSTEM_FILE_FADT "fadt" 41#define ACPI_SYSTEM_FILE_FADT "fadt"
42extern FADT_DESCRIPTOR acpi_fadt; 42extern struct fadt_descriptor acpi_fadt;
43 43
44/* -------------------------------------------------------------------------- 44/* --------------------------------------------------------------------------
45 FS Interface (/proc) 45 FS Interface (/proc)
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index 7f37c7cc5ef1..ed5e8816d83d 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -282,8 +282,8 @@ acpi_get_table_header_early(enum acpi_table_id id,
282 282
283 /* Map the DSDT header via the pointer in the FADT */ 283 /* Map the DSDT header via the pointer in the FADT */
284 if (id == ACPI_DSDT) { 284 if (id == ACPI_DSDT) {
285 struct fadt_descriptor_rev2 *fadt = 285 struct fadt_descriptor *fadt =
286 (struct fadt_descriptor_rev2 *)*header; 286 (struct fadt_descriptor *)*header;
287 287
288 if (fadt->revision == 3 && fadt->Xdsdt) { 288 if (fadt->revision == 3 && fadt->Xdsdt) {
289 *header = (void *)__acpi_map_table(fadt->Xdsdt, 289 *header = (void *)__acpi_map_table(fadt->Xdsdt,
diff --git a/drivers/acpi/tables/tbconvrt.c b/drivers/acpi/tables/tbconvrt.c
index 5155b27cf032..a913a927d321 100644
--- a/drivers/acpi/tables/tbconvrt.c
+++ b/drivers/acpi/tables/tbconvrt.c
@@ -54,12 +54,12 @@ acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
54 acpi_physical_address address); 54 acpi_physical_address address);
55 55
56static void 56static void
57acpi_tb_convert_fadt1(struct fadt_descriptor_rev2 *local_fadt, 57acpi_tb_convert_fadt1(struct fadt_descriptor *local_fadt,
58 struct fadt_descriptor_rev1 *original_fadt); 58 struct fadt_descriptor_rev1 *original_fadt);
59 59
60static void 60static void
61acpi_tb_convert_fadt2(struct fadt_descriptor_rev2 *local_fadt, 61acpi_tb_convert_fadt2(struct fadt_descriptor *local_fadt,
62 struct fadt_descriptor_rev2 *original_fadt); 62 struct fadt_descriptor *original_fadt);
63 63
64u8 acpi_fadt_is_v1; 64u8 acpi_fadt_is_v1;
65ACPI_EXPORT_SYMBOL(acpi_fadt_is_v1) 65ACPI_EXPORT_SYMBOL(acpi_fadt_is_v1)
@@ -120,7 +120,7 @@ acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info)
120{ 120{
121 acpi_size table_size; 121 acpi_size table_size;
122 u32 i; 122 u32 i;
123 XSDT_DESCRIPTOR *new_table; 123 struct xsdt_descriptor *new_table;
124 124
125 ACPI_FUNCTION_ENTRY(); 125 ACPI_FUNCTION_ENTRY();
126 126
@@ -151,12 +151,12 @@ acpi_status acpi_tb_convert_to_xsdt(struct acpi_table_desc *table_info)
151 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { 151 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
152 ACPI_STORE_ADDRESS(new_table->table_offset_entry[i], 152 ACPI_STORE_ADDRESS(new_table->table_offset_entry[i],
153 (ACPI_CAST_PTR 153 (ACPI_CAST_PTR
154 (struct rsdt_descriptor_rev1, 154 (struct rsdt_descriptor,
155 table_info->pointer))-> 155 table_info->pointer))->
156 table_offset_entry[i]); 156 table_offset_entry[i]);
157 } else { 157 } else {
158 new_table->table_offset_entry[i] = 158 new_table->table_offset_entry[i] =
159 (ACPI_CAST_PTR(XSDT_DESCRIPTOR, 159 (ACPI_CAST_PTR(struct xsdt_descriptor,
160 table_info->pointer))-> 160 table_info->pointer))->
161 table_offset_entry[i]; 161 table_offset_entry[i];
162 } 162 }
@@ -218,7 +218,7 @@ acpi_tb_init_generic_address(struct acpi_generic_address *new_gas_struct,
218 ******************************************************************************/ 218 ******************************************************************************/
219 219
220static void 220static void
221acpi_tb_convert_fadt1(struct fadt_descriptor_rev2 *local_fadt, 221acpi_tb_convert_fadt1(struct fadt_descriptor *local_fadt,
222 struct fadt_descriptor_rev1 *original_fadt) 222 struct fadt_descriptor_rev1 *original_fadt)
223{ 223{
224 224
@@ -364,14 +364,13 @@ acpi_tb_convert_fadt1(struct fadt_descriptor_rev2 *local_fadt,
364 ******************************************************************************/ 364 ******************************************************************************/
365 365
366static void 366static void
367acpi_tb_convert_fadt2(struct fadt_descriptor_rev2 *local_fadt, 367acpi_tb_convert_fadt2(struct fadt_descriptor *local_fadt,
368 struct fadt_descriptor_rev2 *original_fadt) 368 struct fadt_descriptor *original_fadt)
369{ 369{
370 370
371 /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */ 371 /* We have an ACPI 2.0 FADT but we must copy it to our local buffer */
372 372
373 ACPI_MEMCPY(local_fadt, original_fadt, 373 ACPI_MEMCPY(local_fadt, original_fadt, sizeof(struct fadt_descriptor));
374 sizeof(struct fadt_descriptor_rev2));
375 374
376 /* 375 /*
377 * "X" fields are optional extensions to the original V1.0 fields, so 376 * "X" fields are optional extensions to the original V1.0 fields, so
@@ -490,7 +489,7 @@ acpi_tb_convert_fadt2(struct fadt_descriptor_rev2 *local_fadt,
490 489
491acpi_status acpi_tb_convert_table_fadt(void) 490acpi_status acpi_tb_convert_table_fadt(void)
492{ 491{
493 struct fadt_descriptor_rev2 *local_fadt; 492 struct fadt_descriptor *local_fadt;
494 struct acpi_table_desc *table_desc; 493 struct acpi_table_desc *table_desc;
495 494
496 ACPI_FUNCTION_TRACE("tb_convert_table_fadt"); 495 ACPI_FUNCTION_TRACE("tb_convert_table_fadt");
@@ -507,13 +506,13 @@ acpi_status acpi_tb_convert_table_fadt(void)
507 506
508 /* Allocate buffer for the ACPI 2.0(+) FADT */ 507 /* Allocate buffer for the ACPI 2.0(+) FADT */
509 508
510 local_fadt = ACPI_ALLOCATE_ZEROED(sizeof(struct fadt_descriptor_rev2)); 509 local_fadt = ACPI_ALLOCATE_ZEROED(sizeof(struct fadt_descriptor));
511 if (!local_fadt) { 510 if (!local_fadt) {
512 return_ACPI_STATUS(AE_NO_MEMORY); 511 return_ACPI_STATUS(AE_NO_MEMORY);
513 } 512 }
514 513
515 if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) { 514 if (acpi_gbl_FADT->revision >= FADT2_REVISION_ID) {
516 if (acpi_gbl_FADT->length < sizeof(struct fadt_descriptor_rev2)) { 515 if (acpi_gbl_FADT->length < sizeof(struct fadt_descriptor)) {
517 516
518 /* Length is too short to be a V2.0 table */ 517 /* Length is too short to be a V2.0 table */
519 518
@@ -538,7 +537,7 @@ acpi_status acpi_tb_convert_table_fadt(void)
538 /* Global FADT pointer will point to the new common V2.0 FADT */ 537 /* Global FADT pointer will point to the new common V2.0 FADT */
539 538
540 acpi_gbl_FADT = local_fadt; 539 acpi_gbl_FADT = local_fadt;
541 acpi_gbl_FADT->length = sizeof(FADT_DESCRIPTOR); 540 acpi_gbl_FADT->length = sizeof(struct fadt_descriptor);
542 541
543 /* Free the original table */ 542 /* Free the original table */
544 543
@@ -550,7 +549,7 @@ acpi_status acpi_tb_convert_table_fadt(void)
550 table_desc->pointer = 549 table_desc->pointer =
551 ACPI_CAST_PTR(struct acpi_table_header, acpi_gbl_FADT); 550 ACPI_CAST_PTR(struct acpi_table_header, acpi_gbl_FADT);
552 table_desc->allocation = ACPI_MEM_ALLOCATED; 551 table_desc->allocation = ACPI_MEM_ALLOCATED;
553 table_desc->length = sizeof(struct fadt_descriptor_rev2); 552 table_desc->length = sizeof(struct fadt_descriptor);
554 553
555 /* Dump the entire FADT */ 554 /* Dump the entire FADT */
556 555
diff --git a/drivers/acpi/tables/tbrsdt.c b/drivers/acpi/tables/tbrsdt.c
index 946d2f2d611d..9e0ebe625ed9 100644
--- a/drivers/acpi/tables/tbrsdt.c
+++ b/drivers/acpi/tables/tbrsdt.c
@@ -280,7 +280,8 @@ acpi_status acpi_tb_get_table_rsdt(void)
280 return_ACPI_STATUS(status); 280 return_ACPI_STATUS(status);
281 } 281 }
282 282
283 acpi_gbl_XSDT = ACPI_CAST_PTR(XSDT_DESCRIPTOR, table_info.pointer); 283 acpi_gbl_XSDT =
284 ACPI_CAST_PTR(struct xsdt_descriptor, table_info.pointer);
284 285
285 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT)); 286 ACPI_DEBUG_PRINT((ACPI_DB_INFO, "XSDT located at %p\n", acpi_gbl_XSDT));
286 return_ACPI_STATUS(status); 287 return_ACPI_STATUS(status);
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c
index b463d4b88823..f8d28ae8811d 100644
--- a/drivers/acpi/tables/tbutils.c
+++ b/drivers/acpi/tables/tbutils.c
@@ -193,73 +193,119 @@ acpi_tb_validate_table_header(struct acpi_table_header *table_header)
193 193
194/******************************************************************************* 194/*******************************************************************************
195 * 195 *
196 * FUNCTION: acpi_tb_verify_table_checksum 196 * FUNCTION: acpi_tb_sum_table
197 * 197 *
198 * PARAMETERS: *table_header - ACPI table to verify 198 * PARAMETERS: Buffer - Buffer to sum
199 * Length - Size of the buffer
199 * 200 *
200 * RETURN: 8 bit checksum of table 201 * RETURN: 8 bit sum of buffer
201 * 202 *
202 * DESCRIPTION: Does an 8 bit checksum of table and returns status. A correct 203 * DESCRIPTION: Computes an 8 bit sum of the buffer(length) and returns it.
203 * table should have a checksum of 0.
204 * 204 *
205 ******************************************************************************/ 205 ******************************************************************************/
206 206
207acpi_status 207u8 acpi_tb_sum_table(void *buffer, u32 length)
208acpi_tb_verify_table_checksum(struct acpi_table_header * table_header) 208{
209 acpi_native_uint i;
210 u8 sum = 0;
211
212 if (!buffer || !length) {
213 return (0);
214 }
215
216 for (i = 0; i < length; i++) {
217 sum = (u8) (sum + ((u8 *) buffer)[i]);
218 }
219 return (sum);
220}
221
222/*******************************************************************************
223 *
224 * FUNCTION: acpi_tb_generate_checksum
225 *
226 * PARAMETERS: Table - Pointer to a valid ACPI table (with a
227 * standard ACPI header)
228 *
229 * RETURN: 8 bit checksum of buffer
230 *
231 * DESCRIPTION: Computes an 8 bit checksum of the table.
232 *
233 ******************************************************************************/
234
235u8 acpi_tb_generate_checksum(struct acpi_table_header * table)
209{ 236{
210 u8 checksum; 237 u8 checksum;
211 acpi_status status = AE_OK;
212 238
213 ACPI_FUNCTION_TRACE("tb_verify_table_checksum"); 239 /* Sum the entire table as-is */
214 240
215 /* Compute the checksum on the table */ 241 checksum = acpi_tb_sum_table(table, table->length);
216 242
217 checksum = 243 /* Subtract off the existing checksum value in the table */
218 acpi_tb_generate_checksum(table_header, table_header->length);
219 244
220 /* Return the appropriate exception */ 245 checksum = (u8) (checksum - table->checksum);
221 246
222 if (checksum) { 247 /* Compute the final checksum */
223 ACPI_WARNING((AE_INFO,
224 "Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)",
225 table_header->signature,
226 (u32) table_header->checksum, (u32) checksum));
227 248
228 status = AE_BAD_CHECKSUM; 249 checksum = (u8) (0 - checksum);
229 } 250 return (checksum);
230 return_ACPI_STATUS(status);
231} 251}
232 252
233/******************************************************************************* 253/*******************************************************************************
234 * 254 *
235 * FUNCTION: acpi_tb_generate_checksum 255 * FUNCTION: acpi_tb_set_checksum
236 * 256 *
237 * PARAMETERS: Buffer - Buffer to checksum 257 * PARAMETERS: Table - Pointer to a valid ACPI table (with a
238 * Length - Size of the buffer 258 * standard ACPI header)
239 * 259 *
240 * RETURN: 8 bit checksum of buffer 260 * RETURN: None. Sets the table checksum field
241 * 261 *
242 * DESCRIPTION: Computes an 8 bit checksum of the buffer(length) and returns it. 262 * DESCRIPTION: Computes an 8 bit checksum of the table and inserts the
263 * checksum into the table header.
243 * 264 *
244 ******************************************************************************/ 265 ******************************************************************************/
245 266
246u8 acpi_tb_generate_checksum(void *buffer, u32 length) 267void acpi_tb_set_checksum(struct acpi_table_header *table)
247{ 268{
248 u8 *end_buffer;
249 u8 *rover;
250 u8 sum = 0;
251 269
252 if (buffer && length) { 270 table->checksum = acpi_tb_generate_checksum(table);
271}
272
273/*******************************************************************************
274 *
275 * FUNCTION: acpi_tb_verify_table_checksum
276 *
277 * PARAMETERS: *table_header - ACPI table to verify
278 *
279 * RETURN: 8 bit checksum of table
280 *
281 * DESCRIPTION: Generates an 8 bit checksum of table and returns and compares
282 * it to the existing checksum value.
283 *
284 ******************************************************************************/
285
286acpi_status
287acpi_tb_verify_table_checksum(struct acpi_table_header *table_header)
288{
289 u8 checksum;
290
291 ACPI_FUNCTION_TRACE("tb_verify_table_checksum");
292
293 /* Compute the checksum on the table */
253 294
254 /* Buffer and Length are valid */ 295 checksum = acpi_tb_generate_checksum(table_header);
255 296
256 end_buffer = ACPI_ADD_PTR(u8, buffer, length); 297 /* Checksum ok? */
257 298
258 for (rover = buffer; rover < end_buffer; rover++) { 299 if (checksum == table_header->checksum) {
259 sum = (u8) (sum + *rover); 300 return_ACPI_STATUS(AE_OK);
260 }
261 } 301 }
262 return (sum); 302
303 ACPI_WARNING((AE_INFO,
304 "Incorrect checksum in table [%4.4s] - is %2.2X, should be %2.2X",
305 table_header->signature, table_header->checksum,
306 checksum));
307
308 return_ACPI_STATUS(AE_BAD_CHECKSUM);
263} 309}
264 310
265#ifdef ACPI_OBSOLETE_FUNCTIONS 311#ifdef ACPI_OBSOLETE_FUNCTIONS
@@ -278,7 +324,7 @@ u8 acpi_tb_generate_checksum(void *buffer, u32 length)
278 324
279acpi_status 325acpi_status
280acpi_tb_handle_to_object(u16 table_id, 326acpi_tb_handle_to_object(u16 table_id,
281 struct acpi_table_desc ** return_table_desc) 327 struct acpi_table_desc **return_table_desc)
282{ 328{
283 u32 i; 329 u32 i;
284 struct acpi_table_desc *table_desc; 330 struct acpi_table_desc *table_desc;
diff --git a/drivers/acpi/tables/tbxfroot.c b/drivers/acpi/tables/tbxfroot.c
index 1b6d8c510e95..550284f5d1ed 100644
--- a/drivers/acpi/tables/tbxfroot.c
+++ b/drivers/acpi/tables/tbxfroot.c
@@ -81,15 +81,14 @@ acpi_status acpi_tb_validate_rsdp(struct rsdp_descriptor *rsdp)
81 81
82 /* Check the standard checksum */ 82 /* Check the standard checksum */
83 83
84 if (acpi_tb_generate_checksum(rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) { 84 if (acpi_tb_sum_table(rsdp, ACPI_RSDP_CHECKSUM_LENGTH) != 0) {
85 return (AE_BAD_CHECKSUM); 85 return (AE_BAD_CHECKSUM);
86 } 86 }
87 87
88 /* Check extended checksum if table version >= 2 */ 88 /* Check extended checksum if table version >= 2 */
89 89
90 if ((rsdp->revision >= 2) && 90 if ((rsdp->revision >= 2) &&
91 (acpi_tb_generate_checksum(rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 91 (acpi_tb_sum_table(rsdp, ACPI_RSDP_XCHECKSUM_LENGTH) != 0)) {
92 0)) {
93 return (AE_BAD_CHECKSUM); 92 return (AE_BAD_CHECKSUM);
94 } 93 }
95 94
@@ -308,12 +307,12 @@ acpi_get_firmware_table(acpi_string signature,
308 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) { 307 if (acpi_gbl_root_table_type == ACPI_TABLE_TYPE_RSDT) {
309 address.pointer.value = 308 address.pointer.value =
310 (ACPI_CAST_PTR 309 (ACPI_CAST_PTR
311 (RSDT_DESCRIPTOR, 310 (struct rsdt_descriptor,
312 rsdt_info->pointer))->table_offset_entry[i]; 311 rsdt_info->pointer))->table_offset_entry[i];
313 } else { 312 } else {
314 address.pointer.value = 313 address.pointer.value =
315 (ACPI_CAST_PTR 314 (ACPI_CAST_PTR
316 (XSDT_DESCRIPTOR, 315 (struct xsdt_descriptor,
317 rsdt_info->pointer))->table_offset_entry[i]; 316 rsdt_info->pointer))->table_offset_entry[i];
318 } 317 }
319 318
diff --git a/drivers/acpi/utilities/utdebug.c b/drivers/acpi/utilities/utdebug.c
index a8c350643d57..5ec1cfcc611d 100644
--- a/drivers/acpi/utilities/utdebug.c
+++ b/drivers/acpi/utilities/utdebug.c
@@ -517,20 +517,13 @@ acpi_ut_ptr_exit(u32 line_number,
517 * 517 *
518 ******************************************************************************/ 518 ******************************************************************************/
519 519
520void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id) 520void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display)
521{ 521{
522 acpi_native_uint i = 0; 522 acpi_native_uint i = 0;
523 acpi_native_uint j; 523 acpi_native_uint j;
524 u32 temp32; 524 u32 temp32;
525 u8 buf_char; 525 u8 buf_char;
526 526
527 /* Only dump the buffer if tracing is enabled */
528
529 if (!((ACPI_LV_TABLES & acpi_dbg_level) &&
530 (component_id & acpi_dbg_layer))) {
531 return;
532 }
533
534 if ((count < 4) || (count & 0x01)) { 527 if ((count < 4) || (count & 0x01)) {
535 display = DB_BYTE_DISPLAY; 528 display = DB_BYTE_DISPLAY;
536 } 529 }
@@ -556,6 +549,7 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
556 } 549 }
557 550
558 switch (display) { 551 switch (display) {
552 case DB_BYTE_DISPLAY:
559 default: /* Default is BYTE display */ 553 default: /* Default is BYTE display */
560 554
561 acpi_os_printf("%02X ", buffer[i + j]); 555 acpi_os_printf("%02X ", buffer[i + j]);
@@ -613,3 +607,31 @@ void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
613 607
614 return; 608 return;
615} 609}
610
611/*******************************************************************************
612 *
613 * FUNCTION: acpi_ut_dump_buffer
614 *
615 * PARAMETERS: Buffer - Buffer to dump
616 * Count - Amount to dump, in bytes
617 * Display - BYTE, WORD, DWORD, or QWORD display
618 * component_iD - Caller's component ID
619 *
620 * RETURN: None
621 *
622 * DESCRIPTION: Generic dump buffer in both hex and ascii.
623 *
624 ******************************************************************************/
625
626void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id)
627{
628
629 /* Only dump the buffer if tracing is enabled */
630
631 if (!((ACPI_LV_TABLES & acpi_dbg_level) &&
632 (component_id & acpi_dbg_layer))) {
633 return;
634 }
635
636 acpi_ut_dump_buffer2(buffer, count, display);
637}
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index 51356e8eb999..b4e34a2f81f7 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -202,8 +202,20 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
202 if (handler_desc) { 202 if (handler_desc) {
203 if (handler_desc->address_space.handler_flags & 203 if (handler_desc->address_space.handler_flags &
204 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) { 204 ACPI_ADDR_HANDLER_DEFAULT_INSTALLED) {
205 obj_pointer = 205
206 second_desc->extra.region_context; 206 /* Deactivate region and free region context */
207
208 if (handler_desc->address_space.setup) {
209 (void)handler_desc->
210 address_space.setup(object,
211 ACPI_REGION_DEACTIVATE,
212 handler_desc->
213 address_space.
214 context,
215 &second_desc->
216 extra.
217 region_context);
218 }
207 } 219 }
208 220
209 acpi_ut_remove_reference(handler_desc); 221 acpi_ut_remove_reference(handler_desc);
diff --git a/drivers/acpi/utilities/utglobal.c b/drivers/acpi/utilities/utglobal.c
index 8a05bb5ef4fe..e8ae417c9848 100644
--- a/drivers/acpi/utilities/utglobal.c
+++ b/drivers/acpi/utilities/utglobal.c
@@ -642,7 +642,7 @@ char *acpi_ut_get_node_name(void *object)
642 /* Name must be a valid ACPI name */ 642 /* Name must be a valid ACPI name */
643 643
644 if (!acpi_ut_valid_acpi_name(node->name.integer)) { 644 if (!acpi_ut_valid_acpi_name(node->name.integer)) {
645 return ("????"); 645 node->name.integer = acpi_ut_repair_name(node->name.integer);
646 } 646 }
647 647
648 /* Return the name */ 648 /* Return the name */
diff --git a/drivers/acpi/utilities/utinit.c b/drivers/acpi/utilities/utinit.c
index 40313de6977d..7538b165b6e5 100644
--- a/drivers/acpi/utilities/utinit.c
+++ b/drivers/acpi/utilities/utinit.c
@@ -50,7 +50,7 @@ ACPI_MODULE_NAME("utinit")
50 50
51/* Local prototypes */ 51/* Local prototypes */
52static void 52static void
53acpi_ut_fadt_register_error(char *register_name, u32 value, acpi_size offset); 53acpi_ut_fadt_register_error(char *register_name, u32 value, u8 offset);
54 54
55static void acpi_ut_terminate(void); 55static void acpi_ut_terminate(void);
56 56
@@ -69,12 +69,12 @@ static void acpi_ut_terminate(void);
69 ******************************************************************************/ 69 ******************************************************************************/
70 70
71static void 71static void
72acpi_ut_fadt_register_error(char *register_name, u32 value, acpi_size offset) 72acpi_ut_fadt_register_error(char *register_name, u32 value, u8 offset)
73{ 73{
74 74
75 ACPI_WARNING((AE_INFO, 75 ACPI_WARNING((AE_INFO,
76 "Invalid FADT value %s=%X at offset %X FADT=%p", 76 "Invalid FADT value %s=%X at offset %X FADT=%p",
77 register_name, value, (u32) offset, acpi_gbl_FADT)); 77 register_name, value, offset, acpi_gbl_FADT));
78} 78}
79 79
80/****************************************************************************** 80/******************************************************************************
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index 017a87ebc40b..4623d7e215d3 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -49,6 +49,33 @@ ACPI_MODULE_NAME("utmisc")
49 49
50/******************************************************************************* 50/*******************************************************************************
51 * 51 *
52 * FUNCTION: acpi_ut_is_aml_table
53 *
54 * PARAMETERS: Table - An ACPI table
55 *
56 * RETURN: TRUE if table contains executable AML; FALSE otherwise
57 *
58 * DESCRIPTION: Check ACPI Signature for a table that contains AML code.
59 * Currently, these are DSDT,SSDT,PSDT. All other table types are
60 * data tables that do not contain AML code.
61 *
62 ******************************************************************************/
63u8 acpi_ut_is_aml_table(struct acpi_table_header *table)
64{
65
66 /* Ignore tables that contain AML */
67
68 if (ACPI_COMPARE_NAME(table->signature, DSDT_SIG) ||
69 ACPI_COMPARE_NAME(table->signature, PSDT_SIG) ||
70 ACPI_COMPARE_NAME(table->signature, SSDT_SIG)) {
71 return (TRUE);
72 }
73
74 return (FALSE);
75}
76
77/*******************************************************************************
78 *
52 * FUNCTION: acpi_ut_allocate_owner_id 79 * FUNCTION: acpi_ut_allocate_owner_id
53 * 80 *
54 * PARAMETERS: owner_id - Where the new owner ID is returned 81 * PARAMETERS: owner_id - Where the new owner ID is returned
@@ -60,6 +87,7 @@ ACPI_MODULE_NAME("utmisc")
60 * when the method exits or the table is unloaded. 87 * when the method exits or the table is unloaded.
61 * 88 *
62 ******************************************************************************/ 89 ******************************************************************************/
90
63acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id) 91acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
64{ 92{
65 acpi_native_uint i; 93 acpi_native_uint i;
@@ -469,6 +497,41 @@ acpi_ut_display_init_pathname(u8 type,
469 497
470/******************************************************************************* 498/*******************************************************************************
471 * 499 *
500 * FUNCTION: acpi_ut_valid_acpi_char
501 *
502 * PARAMETERS: Char - The character to be examined
503 *
504 * RETURN: TRUE if the character is valid, FALSE otherwise
505 *
506 * DESCRIPTION: Check for a valid ACPI character. Must be one of:
507 * 1) Upper case alpha
508 * 2) numeric
509 * 3) underscore
510 *
511 * We allow a '!' as the last character because of the ASF! table
512 *
513 ******************************************************************************/
514
515u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position)
516{
517
518 if (!((character >= 'A' && character <= 'Z') ||
519 (character >= '0' && character <= '9') || (character == '_'))) {
520
521 /* Allow a '!' in the last position */
522
523 if (character == '!' && position == 3) {
524 return (TRUE);
525 }
526
527 return (FALSE);
528 }
529
530 return (TRUE);
531}
532
533/*******************************************************************************
534 *
472 * FUNCTION: acpi_ut_valid_acpi_name 535 * FUNCTION: acpi_ut_valid_acpi_name
473 * 536 *
474 * PARAMETERS: Name - The name to be examined 537 * PARAMETERS: Name - The name to be examined
@@ -484,19 +547,13 @@ acpi_ut_display_init_pathname(u8 type,
484 547
485u8 acpi_ut_valid_acpi_name(u32 name) 548u8 acpi_ut_valid_acpi_name(u32 name)
486{ 549{
487 char *name_ptr = (char *)&name;
488 char character;
489 acpi_native_uint i; 550 acpi_native_uint i;
490 551
491 ACPI_FUNCTION_ENTRY(); 552 ACPI_FUNCTION_ENTRY();
492 553
493 for (i = 0; i < ACPI_NAME_SIZE; i++) { 554 for (i = 0; i < ACPI_NAME_SIZE; i++) {
494 character = *name_ptr; 555 if (!acpi_ut_valid_acpi_char
495 name_ptr++; 556 ((ACPI_CAST_PTR(char, &name))[i], i)) {
496
497 if (!((character == '_') ||
498 (character >= 'A' && character <= 'Z') ||
499 (character >= '0' && character <= '9'))) {
500 return (FALSE); 557 return (FALSE);
501 } 558 }
502 } 559 }
@@ -506,24 +563,37 @@ u8 acpi_ut_valid_acpi_name(u32 name)
506 563
507/******************************************************************************* 564/*******************************************************************************
508 * 565 *
509 * FUNCTION: acpi_ut_valid_acpi_character 566 * FUNCTION: acpi_ut_repair_name
510 * 567 *
511 * PARAMETERS: Character - The character to be examined 568 * PARAMETERS: Name - The ACPI name to be repaired
512 * 569 *
513 * RETURN: 1 if Character may appear in a name, else 0 570 * RETURN: Repaired version of the name
514 * 571 *
515 * DESCRIPTION: Check for a printable character 572 * DESCRIPTION: Repair an ACPI name: Change invalid characters to '*' and
573 * return the new name.
516 * 574 *
517 ******************************************************************************/ 575 ******************************************************************************/
518 576
519u8 acpi_ut_valid_acpi_character(char character) 577acpi_name acpi_ut_repair_name(acpi_name name)
520{ 578{
579 char *name_ptr = ACPI_CAST_PTR(char, &name);
580 char new_name[ACPI_NAME_SIZE];
581 acpi_native_uint i;
521 582
522 ACPI_FUNCTION_ENTRY(); 583 for (i = 0; i < ACPI_NAME_SIZE; i++) {
584 new_name[i] = name_ptr[i];
585
586 /*
587 * Replace a bad character with something printable, yet technically
588 * still invalid. This prevents any collisions with existing "good"
589 * names in the namespace.
590 */
591 if (!acpi_ut_valid_acpi_char(name_ptr[i], i)) {
592 new_name[i] = '*';
593 }
594 }
523 595
524 return ((u8) ((character == '_') || 596 return (*ACPI_CAST_PTR(u32, new_name));
525 (character >= 'A' && character <= 'Z') ||
526 (character >= '0' && character <= '9')));
527} 597}
528 598
529/******************************************************************************* 599/*******************************************************************************
diff --git a/drivers/acpi/utilities/utresrc.c b/drivers/acpi/utilities/utresrc.c
index 4c24e6d5400a..1e680794c6df 100644
--- a/drivers/acpi/utilities/utresrc.c
+++ b/drivers/acpi/utilities/utresrc.c
@@ -258,7 +258,7 @@ static const u8 acpi_gbl_resource_types[] = {
258acpi_status 258acpi_status
259acpi_ut_walk_aml_resources(u8 * aml, 259acpi_ut_walk_aml_resources(u8 * aml,
260 acpi_size aml_length, 260 acpi_size aml_length,
261 acpi_walk_aml_callback user_function, void *context) 261 acpi_walk_aml_callback user_function, void **context)
262{ 262{
263 acpi_status status; 263 acpi_status status;
264 u8 *end_aml; 264 u8 *end_aml;
@@ -319,7 +319,7 @@ acpi_ut_walk_aml_resources(u8 * aml,
319 /* Return the pointer to the end_tag if requested */ 319 /* Return the pointer to the end_tag if requested */
320 320
321 if (!user_function) { 321 if (!user_function) {
322 *(void **)context = aml; 322 *context = aml;
323 } 323 }
324 324
325 /* Normal exit */ 325 /* Normal exit */
@@ -610,7 +610,7 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object * obj_desc,
610 610
611 status = acpi_ut_walk_aml_resources(obj_desc->buffer.pointer, 611 status = acpi_ut_walk_aml_resources(obj_desc->buffer.pointer,
612 obj_desc->buffer.length, NULL, 612 obj_desc->buffer.length, NULL,
613 end_tag); 613 (void **)end_tag);
614 614
615 return_ACPI_STATUS(status); 615 return_ACPI_STATUS(status);
616} 616}
diff --git a/drivers/acpi/utilities/utstate.c b/drivers/acpi/utilities/utstate.c
index 637c5f964879..aec5034cd978 100644
--- a/drivers/acpi/utilities/utstate.c
+++ b/drivers/acpi/utilities/utstate.c
@@ -321,8 +321,8 @@ union acpi_generic_state *acpi_ut_create_control_state(void)
321 * 321 *
322 * RETURN: None 322 * RETURN: None
323 * 323 *
324 * DESCRIPTION: Put a state object back into the global state cache. The object 324 * DESCRIPTION: Release a state object to the state cache. NULL state objects
325 * is not actually freed at this time. 325 * are ignored.
326 * 326 *
327 ******************************************************************************/ 327 ******************************************************************************/
328 328
@@ -330,6 +330,10 @@ void acpi_ut_delete_generic_state(union acpi_generic_state *state)
330{ 330{
331 ACPI_FUNCTION_TRACE("ut_delete_generic_state"); 331 ACPI_FUNCTION_TRACE("ut_delete_generic_state");
332 332
333 (void)acpi_os_release_object(acpi_gbl_state_cache, state); 333 /* Ignore null state */
334
335 if (state) {
336 (void)acpi_os_release_object(acpi_gbl_state_cache, state);
337 }
334 return_VOID; 338 return_VOID;
335} 339}
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index f3acfd9249fc..b6bba7db52d9 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -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 0x20060317 66#define ACPI_CA_VERSION 0x20060331
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,
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index f004461a7753..70b52ffa969e 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -59,14 +59,52 @@ struct acpi_external_list {
59 59
60extern struct acpi_external_list *acpi_gbl_external_list; 60extern struct acpi_external_list *acpi_gbl_external_list;
61 61
62/* Strings used for decoding flags to ASL keywords */ 62typedef const struct acpi_dmtable_info {
63 u8 opcode;
64 u8 offset;
65 char *name;
63 66
64extern const char *acpi_gbl_word_decode[4]; 67} acpi_dmtable_info;
65extern const char *acpi_gbl_irq_decode[2]; 68
66extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES]; 69/*
67extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES]; 70 * Values for Opcode above.
68extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES]; 71 * Note: 0-7 must not change, used as a flag shift value
69extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS]; 72 */
73#define ACPI_DMT_FLAG0 0
74#define ACPI_DMT_FLAG1 1
75#define ACPI_DMT_FLAG2 2
76#define ACPI_DMT_FLAG3 3
77#define ACPI_DMT_FLAG4 4
78#define ACPI_DMT_FLAG5 5
79#define ACPI_DMT_FLAG6 6
80#define ACPI_DMT_FLAG7 7
81#define ACPI_DMT_FLAGS0 8
82#define ACPI_DMT_FLAGS2 9
83#define ACPI_DMT_UINT8 10
84#define ACPI_DMT_UINT16 11
85#define ACPI_DMT_UINT24 12
86#define ACPI_DMT_UINT32 13
87#define ACPI_DMT_UINT56 14
88#define ACPI_DMT_UINT64 15
89#define ACPI_DMT_STRING 16
90#define ACPI_DMT_NAME4 17
91#define ACPI_DMT_NAME6 18
92#define ACPI_DMT_NAME8 19
93#define ACPI_DMT_CHKSUM 20
94#define ACPI_DMT_SPACEID 21
95#define ACPI_DMT_GAS 22
96#define ACPI_DMT_MADT 23
97#define ACPI_DMT_SRAT 24
98#define ACPI_DMT_EXIT 25
99
100typedef
101void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table);
102
103struct acpi_dmtable_data {
104 char *signature;
105 struct acpi_dmtable_info *table_info;
106 ACPI_TABLE_HANDLER table_handler;
107};
70 108
71struct acpi_op_walk_info { 109struct acpi_op_walk_info {
72 u32 level; 110 u32 level;
@@ -84,6 +122,95 @@ struct acpi_resource_tag {
84 char *tag; 122 char *tag;
85}; 123};
86 124
125/* Strings used for decoding flags to ASL keywords */
126
127extern const char *acpi_gbl_word_decode[4];
128extern const char *acpi_gbl_irq_decode[2];
129extern const char *acpi_gbl_lock_rule[ACPI_NUM_LOCK_RULES];
130extern const char *acpi_gbl_access_types[ACPI_NUM_ACCESS_TYPES];
131extern const char *acpi_gbl_update_rules[ACPI_NUM_UPDATE_RULES];
132extern const char *acpi_gbl_match_ops[ACPI_NUM_MATCH_OPS];
133
134extern struct acpi_dmtable_info acpi_dm_table_info_asf0[];
135extern struct acpi_dmtable_info acpi_dm_table_info_asf1[];
136extern struct acpi_dmtable_info acpi_dm_table_info_asf2[];
137extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
138extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
139extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
140extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
141extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
142extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
143extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
144extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
145extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
146extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
147extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];
148extern struct acpi_dmtable_info acpi_dm_table_info_gas[];
149extern struct acpi_dmtable_info acpi_dm_table_info_header[];
150extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
151extern struct acpi_dmtable_info acpi_dm_table_info_madt[];
152extern struct acpi_dmtable_info acpi_dm_table_info_madt0[];
153extern struct acpi_dmtable_info acpi_dm_table_info_madt1[];
154extern struct acpi_dmtable_info acpi_dm_table_info_madt2[];
155extern struct acpi_dmtable_info acpi_dm_table_info_madt3[];
156extern struct acpi_dmtable_info acpi_dm_table_info_madt4[];
157extern struct acpi_dmtable_info acpi_dm_table_info_madt5[];
158extern struct acpi_dmtable_info acpi_dm_table_info_madt6[];
159extern struct acpi_dmtable_info acpi_dm_table_info_madt7[];
160extern struct acpi_dmtable_info acpi_dm_table_info_madt8[];
161extern struct acpi_dmtable_info acpi_dm_table_info_madt_hdr[];
162extern struct acpi_dmtable_info acpi_dm_table_info_mcfg[];
163extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
164extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[];
165extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[];
166extern struct acpi_dmtable_info acpi_dm_table_info_sbst[];
167extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
168extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
169extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
170extern struct acpi_dmtable_info acpi_dm_table_info_srat[];
171extern struct acpi_dmtable_info acpi_dm_table_info_srat0[];
172extern struct acpi_dmtable_info acpi_dm_table_info_srat1[];
173extern struct acpi_dmtable_info acpi_dm_table_info_tcpa[];
174extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
175
176/*
177 * dmtable
178 */
179void acpi_dm_dump_data_table(struct acpi_table_header *table);
180
181void
182acpi_dm_dump_table(u32 table_length,
183 u32 table_offset,
184 void *table,
185 u32 sub_table_length, struct acpi_dmtable_info *info);
186
187void acpi_dm_line_header(u32 offset, u32 byte_length, char *name);
188
189void acpi_dm_line_header2(u32 offset, u32 byte_length, char *name, u32 value);
190
191/*
192 * dmtbdump
193 */
194void acpi_dm_dump_asf(struct acpi_table_header *table);
195
196void acpi_dm_dump_cpep(struct acpi_table_header *table);
197
198void acpi_dm_dump_fadt(struct acpi_table_header *table);
199
200void acpi_dm_dump_srat(struct acpi_table_header *table);
201
202void acpi_dm_dump_mcfg(struct acpi_table_header *table);
203
204void acpi_dm_dump_madt(struct acpi_table_header *table);
205
206u32 acpi_dm_dump_rsdp(struct acpi_table_header *table);
207
208void acpi_dm_dump_rsdt(struct acpi_table_header *table);
209
210void acpi_dm_dump_slit(struct acpi_table_header *table);
211
212void acpi_dm_dump_xsdt(struct acpi_table_header *table);
213
87/* 214/*
88 * dmwalk 215 * dmwalk
89 */ 216 */
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index f9eb5925511f..17c5b462676e 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -107,6 +107,7 @@ ACPI_EXTERN u32 acpi_gbl_trace_flags;
107 * 3) Allow access to uninitialized locals/args (auto-init to integer 0) 107 * 3) Allow access to uninitialized locals/args (auto-init to integer 0)
108 * 4) Allow ANY object type to be a source operand for the Store() operator 108 * 4) Allow ANY object type to be a source operand for the Store() operator
109 * 5) Allow unresolved references (invalid target name) in package objects 109 * 5) Allow unresolved references (invalid target name) in package objects
110 * 6) Enable warning messages for behavior that is not ACPI spec compliant
110 */ 111 */
111ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE); 112ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_enable_interpreter_slack, FALSE);
112 113
@@ -149,10 +150,10 @@ ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_leave_wake_gpes_disabled, TRUE);
149ACPI_EXTERN u32 acpi_gbl_table_flags; 150ACPI_EXTERN u32 acpi_gbl_table_flags;
150ACPI_EXTERN u32 acpi_gbl_rsdt_table_count; 151ACPI_EXTERN u32 acpi_gbl_rsdt_table_count;
151ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP; 152ACPI_EXTERN struct rsdp_descriptor *acpi_gbl_RSDP;
152ACPI_EXTERN XSDT_DESCRIPTOR *acpi_gbl_XSDT; 153ACPI_EXTERN struct xsdt_descriptor *acpi_gbl_XSDT;
153ACPI_EXTERN FADT_DESCRIPTOR *acpi_gbl_FADT; 154ACPI_EXTERN struct fadt_descriptor *acpi_gbl_FADT;
154ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT; 155ACPI_EXTERN struct acpi_table_header *acpi_gbl_DSDT;
155ACPI_EXTERN FACS_DESCRIPTOR *acpi_gbl_FACS; 156ACPI_EXTERN struct facs_descriptor *acpi_gbl_FACS;
156ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS; 157ACPI_EXTERN struct acpi_common_facs acpi_gbl_common_fACS;
157/* 158/*
158 * Since there may be multiple SSDTs and PSDTs, a single pointer is not 159 * Since there may be multiple SSDTs and PSDTs, a single pointer is not
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 5956431784d5..99785bae59b3 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -174,22 +174,28 @@ union acpi_name_union {
174 * 174 *
175 * The node is optimized for both 32-bit and 64-bit platforms: 175 * The node is optimized for both 32-bit and 64-bit platforms:
176 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case. 176 * 20 bytes for the 32-bit case, 32 bytes for the 64-bit case.
177 *
178 * Note: The descriptor_type and Type fields must appear in the identical
179 * position in both the struct acpi_namespace_node and union acpi_operand_object
180 * structures.
177 */ 181 */
178struct acpi_namespace_node { 182struct acpi_namespace_node {
179 union acpi_operand_object *object; /* Interpreter object */ 183 union acpi_operand_object *object; /* Interpreter object */
180 u8 descriptor_type; /* Differentiate object descriptor types */ 184 u8 descriptor_type; /* Differentiate object descriptor types */
185 u8 type; /* ACPI Type associated with this name */
181 u8 flags; /* Miscellaneous flags */ 186 u8 flags; /* Miscellaneous flags */
182 acpi_owner_id owner_id; /* Node creator */ 187 acpi_owner_id owner_id; /* Node creator */
183 u8 type; /* ACPI Type associated with this name */
184 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */ 188 union acpi_name_union name; /* ACPI Name, always 4 chars per ACPI spec */
185 struct acpi_namespace_node *child; /* First child */ 189 struct acpi_namespace_node *child; /* First child */
186 struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */ 190 struct acpi_namespace_node *peer; /* Peer. Parent if ANOBJ_END_OF_PEER_LIST set */
187 191
188 /* Fields used by the ASL compiler and disassembler only: */ 192 /*
189 193 * The following fields are used by the ASL compiler and disassembler only
194 */
190#ifdef ACPI_LARGE_NAMESPACE_NODE 195#ifdef ACPI_LARGE_NAMESPACE_NODE
191 union acpi_parse_object *op; 196 union acpi_parse_object *op;
192 u32 value; 197 u32 value;
198 u32 length;
193#endif 199#endif
194}; 200};
195 201
@@ -470,7 +476,7 @@ struct acpi_scope_state {
470}; 476};
471 477
472struct acpi_pscope_state { 478struct acpi_pscope_state {
473 ACPI_STATE_COMMON u8 arg_count; /* Number of fixed arguments */ 479 ACPI_STATE_COMMON u32 arg_count; /* Number of fixed arguments */
474 union acpi_parse_object *op; /* Current op being parsed */ 480 union acpi_parse_object *op; /* Current op being parsed */
475 u8 *arg_end; /* Current argument end */ 481 u8 *arg_end; /* Current argument end */
476 u8 *pkg_end; /* Current package end */ 482 u8 *pkg_end; /* Current package end */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index c495670aa11a..60ceed4c81bf 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -130,7 +130,6 @@
130#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i) 130#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void,(void *) NULL,(acpi_native_uint) i)
131#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL) 131#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p,(void *) NULL)
132#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL) 132#define ACPI_OFFSET(d,f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f),(void *) NULL)
133#define ACPI_FADT_OFFSET(f) ACPI_OFFSET (FADT_DESCRIPTOR, f)
134 133
135#if ACPI_MACHINE_WIDTH == 16 134#if ACPI_MACHINE_WIDTH == 16
136#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s) 135#define ACPI_STORE_POINTER(d,s) ACPI_MOVE_32_TO_32(d,s)
@@ -141,6 +140,12 @@
141#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 140#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
142#endif 141#endif
143 142
143#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
144#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (u32,(a)) == *ACPI_CAST_PTR (u32,(b)))
145#else
146#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char,(a)), ACPI_CAST_PTR (char,(b)), 4))
147#endif
148
144/* 149/*
145 * Macros for moving data around to/from buffers that are possibly unaligned. 150 * Macros for moving data around to/from buffers that are possibly unaligned.
146 * If the hardware supports the transfer of unaligned data, just do the store. 151 * If the hardware supports the transfer of unaligned data, just do the store.
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 28241aa15de9..d9442d346b9b 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -65,6 +65,10 @@
65 * 65 *
66 * descriptor_type is used to differentiate between internal descriptors, and 66 * descriptor_type is used to differentiate between internal descriptors, and
67 * must be in the same place across all descriptors 67 * must be in the same place across all descriptors
68 *
69 * Note: The descriptor_type and Type fields must appear in the identical
70 * position in both the struct acpi_namespace_node and union acpi_operand_object
71 * structures.
68 */ 72 */
69#define ACPI_OBJECT_COMMON_HEADER \ 73#define ACPI_OBJECT_COMMON_HEADER \
70 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\ 74 union acpi_operand_object *next_object; /* Objects linked to parent NS node */\
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 53ac4ce8753a..de14492a5985 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -46,9 +46,9 @@
46 46
47#define OP_HAS_RETURN_VALUE 1 47#define OP_HAS_RETURN_VALUE 1
48 48
49/* variable # arguments */ 49/* Variable number of arguments. This field must be 32 bits */
50 50
51#define ACPI_VAR_ARGS ACPI_UINT8_MAX 51#define ACPI_VAR_ARGS ACPI_UINT32_MAX
52 52
53#define ACPI_PARSE_DELETE_TREE 0x0001 53#define ACPI_PARSE_DELETE_TREE 0x0001
54#define ACPI_PARSE_NO_TREE_DELETE 0x0000 54#define ACPI_PARSE_NO_TREE_DELETE 0x0000
@@ -146,12 +146,13 @@ u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state);
146 146
147void 147void
148acpi_ps_pop_scope(struct acpi_parse_state *parser_state, 148acpi_ps_pop_scope(struct acpi_parse_state *parser_state,
149 union acpi_parse_object **op, u32 * arg_list, u8 * arg_count); 149 union acpi_parse_object **op,
150 u32 * arg_list, u32 * arg_count);
150 151
151acpi_status 152acpi_status
152acpi_ps_push_scope(struct acpi_parse_state *parser_state, 153acpi_ps_push_scope(struct acpi_parse_state *parser_state,
153 union acpi_parse_object *op, 154 union acpi_parse_object *op,
154 u32 remaining_args, u8 arg_count); 155 u32 remaining_args, u32 arg_count);
155 156
156void acpi_ps_cleanup_scope(struct acpi_parse_state *state); 157void acpi_ps_cleanup_scope(struct acpi_parse_state *state);
157 158
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 6dca3d542080..43f8c2a23a24 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -59,7 +59,7 @@ 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 FADT_DESCRIPTOR acpi_fadt; 62extern struct fadt_descriptor acpi_fadt;
63 63
64enum acpi_bus_removal_type { 64enum acpi_bus_removal_type {
65 ACPI_BUS_REMOVAL_NORMAL = 0, 65 ACPI_BUS_REMOVAL_NORMAL = 0,
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 91c3cdff28bb..42307d948c1b 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -169,8 +169,6 @@ acpi_os_queue_for_execution(u32 priority,
169 169
170void acpi_os_wait_events_complete(void *context); 170void acpi_os_wait_events_complete(void *context);
171 171
172void acpi_os_wait_events_complete(void *context);
173
174void acpi_os_sleep(acpi_integer milliseconds); 172void acpi_os_sleep(acpi_integer milliseconds);
175 173
176void acpi_os_stall(u32 microseconds); 174void acpi_os_stall(u32 microseconds);
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 04e8966a377d..b8a6d6110d57 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -86,7 +86,7 @@ struct acpi_walk_state {
86 86
87 struct acpi_parse_state parser_state; /* Current state of parser */ 87 struct acpi_parse_state parser_state; /* Current state of parser */
88 u32 prev_arg_types; 88 u32 prev_arg_types;
89 u8 arg_count; /* push for fixed or var args */ 89 u32 arg_count; /* push for fixed or var args */
90 90
91 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */ 91 struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
92 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */ 92 struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 30a47542e1c8..4dbaf02fe526 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -136,7 +136,11 @@ acpi_status acpi_tb_is_table_installed(struct acpi_table_desc *new_table_desc);
136acpi_status 136acpi_status
137acpi_tb_verify_table_checksum(struct acpi_table_header *table_header); 137acpi_tb_verify_table_checksum(struct acpi_table_header *table_header);
138 138
139u8 acpi_tb_generate_checksum(void *buffer, u32 length); 139u8 acpi_tb_sum_table(void *buffer, u32 length);
140
141u8 acpi_tb_generate_checksum(struct acpi_table_header *table);
142
143void acpi_tb_set_checksum(struct acpi_table_header *table);
140 144
141acpi_status 145acpi_status
142acpi_tb_validate_table_header(struct acpi_table_header *table_header); 146acpi_tb_validate_table_header(struct acpi_table_header *table_header);
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index ed53f842dad4..e1a40135f707 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Name: actbl.h - Table data structures defined in ACPI specification 3 * Name: actbl.h - Basic ACPI Table Definitions
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -45,66 +45,45 @@
45#define __ACTBL_H__ 45#define __ACTBL_H__
46 46
47/* 47/*
48 * Note about bitfields: The u8 type is used for bitfields in ACPI tables. 48 * Values for description table header signatures. Useful because they make
49 * This is the only type that is even remotely portable. Anything else is not 49 * it more difficult to inadvertently type in the wrong signature.
50 * portable, so do not use any other bitfield types.
51 */
52
53/*
54 * Values for description table header signatures
55 */ 50 */
56#define RSDP_NAME "RSDP"
57#define RSDP_SIG "RSD PTR " /* RSDT Pointer signature */
58#define APIC_SIG "APIC" /* Multiple APIC Description Table */
59#define DSDT_SIG "DSDT" /* Differentiated System Description Table */ 51#define DSDT_SIG "DSDT" /* Differentiated System Description Table */
60#define FADT_SIG "FACP" /* Fixed ACPI Description Table */ 52#define FADT_SIG "FACP" /* Fixed ACPI Description Table */
61#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */ 53#define FACS_SIG "FACS" /* Firmware ACPI Control Structure */
62#define PSDT_SIG "PSDT" /* Persistent System Description Table */ 54#define PSDT_SIG "PSDT" /* Persistent System Description Table */
55#define RSDP_SIG "RSD PTR " /* Root System Description Pointer */
63#define RSDT_SIG "RSDT" /* Root System Description Table */ 56#define RSDT_SIG "RSDT" /* Root System Description Table */
64#define XSDT_SIG "XSDT" /* Extended System Description Table */ 57#define XSDT_SIG "XSDT" /* Extended System Description Table */
65#define SSDT_SIG "SSDT" /* Secondary System Description Table */ 58#define SSDT_SIG "SSDT" /* Secondary System Description Table */
66#define SBST_SIG "SBST" /* Smart Battery Specification Table */ 59#define RSDP_NAME "RSDP"
67#define SPIC_SIG "SPIC" /* IOSAPIC table */
68#define BOOT_SIG "BOOT" /* Boot table */
69
70#define GL_OWNED 0x02 /* Ownership of global lock is bit 1 */
71 60
72/* 61/*
73 * Common table types. The base code can remain 62 * All tables and structures must be byte-packed to match the ACPI
74 * constant if the underlying tables are changed 63 * specification, since the tables are provided by the system BIOS
75 */ 64 */
76#define RSDT_DESCRIPTOR struct rsdt_descriptor_rev2
77#define XSDT_DESCRIPTOR struct xsdt_descriptor_rev2
78#define FACS_DESCRIPTOR struct facs_descriptor_rev2
79#define FADT_DESCRIPTOR struct fadt_descriptor_rev2
80
81#pragma pack(1) 65#pragma pack(1)
82 66
83/* 67/*
84 * ACPI Version-independent tables 68 * These are the ACPI tables that are directly consumed by the subsystem.
69 *
70 * The RSDP and FACS do not use the common ACPI table header. All other ACPI
71 * tables use the header.
85 * 72 *
86 * NOTE: The tables that are specific to ACPI versions (1.0, 2.0, etc.) 73 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
87 * are in separate files. 74 * This is the only type that is even remotely portable. Anything else is not
75 * portable, so do not use any other bitfield types.
88 */ 76 */
89struct rsdp_descriptor { /* Root System Descriptor Pointer */
90 char signature[8]; /* ACPI signature, contains "RSD PTR " */
91 u8 checksum; /* ACPI 1.0 checksum */
92 char oem_id[6]; /* OEM identification */
93 u8 revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
94 u32 rsdt_physical_address; /* 32-bit physical address of the RSDT */
95 u32 length; /* XSDT Length in bytes, including header */
96 u64 xsdt_physical_address; /* 64-bit physical address of the XSDT */
97 u8 extended_checksum; /* Checksum of entire table (ACPI 2.0) */
98 char reserved[3]; /* Reserved, must be zero */
99};
100 77
101struct acpi_common_facs { /* Common FACS for internal use */ 78/*******************************************************************************
102 u32 *global_lock; 79 *
103 u64 *firmware_waking_vector; 80 * ACPI Table Header. This common header is used by all tables except the
104 u8 vector_width; 81 * RSDP and FACS. The define is used for direct inclusion of header into
105}; 82 * other ACPI tables
83 *
84 ******************************************************************************/
106 85
107#define ACPI_TABLE_HEADER_DEF /* ACPI common table header */ \ 86#define ACPI_TABLE_HEADER_DEF \
108 char signature[4]; /* ASCII table signature */\ 87 char signature[4]; /* ASCII table signature */\
109 u32 length; /* Length of table in bytes, including this header */\ 88 u32 length; /* Length of table in bytes, including this header */\
110 u8 revision; /* ACPI Specification minor version # */\ 89 u8 revision; /* ACPI Specification minor version # */\
@@ -112,154 +91,239 @@ struct acpi_common_facs { /* Common FACS for internal use */
112 char oem_id[6]; /* ASCII OEM identification */\ 91 char oem_id[6]; /* ASCII OEM identification */\
113 char oem_table_id[8]; /* ASCII OEM table identification */\ 92 char oem_table_id[8]; /* ASCII OEM table identification */\
114 u32 oem_revision; /* OEM revision number */\ 93 u32 oem_revision; /* OEM revision number */\
115 char asl_compiler_id [4]; /* ASCII ASL compiler vendor ID */\ 94 char asl_compiler_id[4]; /* ASCII ASL compiler vendor ID */\
116 u32 asl_compiler_revision; /* ASL compiler version */ 95 u32 asl_compiler_revision; /* ASL compiler version */
117 96
118struct acpi_table_header { /* ACPI common table header */ 97struct acpi_table_header {
119ACPI_TABLE_HEADER_DEF}; 98ACPI_TABLE_HEADER_DEF};
120 99
121/* 100/*
122 * MADT values and structures 101 * GAS - Generic Address Structure (ACPI 2.0+)
123 */ 102 */
103struct acpi_generic_address {
104 u8 address_space_id; /* Address space where struct or register exists */
105 u8 register_bit_width; /* Size in bits of given register */
106 u8 register_bit_offset; /* Bit offset within the register */
107 u8 access_width; /* Minimum Access size (ACPI 3.0) */
108 u64 address; /* 64-bit address of struct or register */
109};
124 110
125/* Values for MADT PCATCompat */ 111/*******************************************************************************
112 *
113 * RSDP - Root System Description Pointer (Signature is "RSD PTR ")
114 *
115 ******************************************************************************/
116
117struct rsdp_descriptor {
118 char signature[8]; /* ACPI signature, contains "RSD PTR " */
119 u8 checksum; /* ACPI 1.0 checksum */
120 char oem_id[6]; /* OEM identification */
121 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 */
123 u32 length; /* Table length in bytes, including header (ACPI 2.0+) */
124 u64 xsdt_physical_address; /* 64-bit physical address of the XSDT (ACPI 2.0+) */
125 u8 extended_checksum; /* Checksum of entire table (ACPI 2.0+) */
126 u8 reserved[3]; /* Reserved, must be zero */
127};
126 128
127#define DUAL_PIC 0 129#define ACPI_RSDP_REV0_SIZE 20 /* Size of original ACPI 1.0 RSDP */
128#define MULTIPLE_APIC 1
129 130
130/* Master MADT */ 131/*******************************************************************************
132 *
133 * RSDT/XSDT - Root System Description Tables
134 *
135 ******************************************************************************/
131 136
132struct multiple_apic_table { 137struct rsdt_descriptor {
133 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 138 ACPI_TABLE_HEADER_DEF u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
134 u32 local_apic_address; /* Physical address of local APIC */ 139};
140
141struct xsdt_descriptor {
142 ACPI_TABLE_HEADER_DEF u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
143};
144
145/*******************************************************************************
146 *
147 * FACS - Firmware ACPI Control Structure (FACS)
148 *
149 ******************************************************************************/
150
151struct facs_descriptor {
152 char signature[4]; /* ASCII table signature */
153 u32 length; /* Length of structure, in bytes */
154 u32 hardware_signature; /* Hardware configuration signature */
155 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector */
156 u32 global_lock; /* Global Lock for shared hardware resources */
135 157
136 /* Flags (32 bits) */ 158 /* Flags (32 bits) */
137 159
138 u8 PCATcompat:1; /* 00: System also has dual 8259s */ 160 u8 S4bios_f:1; /* 00: S4BIOS support is present */
139 u8:7; /* 01-07: Reserved, must be zero */ 161 u8:7; /* 01-07: Reserved, must be zero */
140 u8 reserved1[3]; /* 08-31: Reserved, must be zero */ 162 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
141};
142 163
143/* Values for Type in APIC_HEADER_DEF */ 164 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+) */
166 u8 reserved[31]; /* Reserved, must be zero */
167};
144 168
145#define APIC_PROCESSOR 0 169#define ACPI_GLOCK_PENDING 0x01 /* 00: Pending global lock ownership */
146#define APIC_IO 1 170#define ACPI_GLOCK_OWNED 0x02 /* 01: Global lock is owned */
147#define APIC_XRUPT_OVERRIDE 2
148#define APIC_NMI 3
149#define APIC_LOCAL_NMI 4
150#define APIC_ADDRESS_OVERRIDE 5
151#define APIC_IO_SAPIC 6
152#define APIC_LOCAL_SAPIC 7
153#define APIC_XRUPT_SOURCE 8
154#define APIC_RESERVED 9 /* 9 and greater are reserved */
155 171
156/* 172/*
157 * MADT sub-structures (Follow MULTIPLE_APIC_DESCRIPTION_TABLE) 173 * Common FACS - This is a version-independent FACS structure used for internal use only
158 */ 174 */
159#define APIC_HEADER_DEF /* Common APIC sub-structure header */\ 175struct acpi_common_facs {
160 u8 type; \ 176 u32 *global_lock;
161 u8 length; 177 u64 *firmware_waking_vector;
162 178 u8 vector_width;
163struct apic_header {
164APIC_HEADER_DEF};
165
166/* Values for MPS INTI flags */
167
168#define POLARITY_CONFORMS 0
169#define POLARITY_ACTIVE_HIGH 1
170#define POLARITY_RESERVED 2
171#define POLARITY_ACTIVE_LOW 3
172
173#define TRIGGER_CONFORMS 0
174#define TRIGGER_EDGE 1
175#define TRIGGER_RESERVED 2
176#define TRIGGER_LEVEL 3
177
178/* Common flag definitions (16 bits each) */
179
180#define MPS_INTI_FLAGS \
181 u8 polarity : 2; /* 00-01: Polarity of APIC I/O input signals */\
182 u8 trigger_mode : 2; /* 02-03: Trigger mode of APIC input signals */\
183 u8 : 4; /* 04-07: Reserved, must be zero */\
184 u8 reserved1; /* 08-15: Reserved, must be zero */
185
186#define LOCAL_APIC_FLAGS \
187 u8 processor_enabled: 1; /* 00: Processor is usable if set */\
188 u8 : 7; /* 01-07: Reserved, must be zero */\
189 u8 reserved2; /* 08-15: Reserved, must be zero */
190
191/* Sub-structures for MADT */
192
193struct madt_processor_apic {
194 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
195 u8 local_apic_id; /* Processor's local APIC id */
196 LOCAL_APIC_FLAGS};
197
198struct madt_io_apic {
199 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */
200 u8 reserved; /* Reserved - must be zero */
201 u32 address; /* APIC physical address */
202 u32 interrupt; /* Global system interrupt where INTI
203 * lines start */
204}; 179};
205 180
206struct madt_interrupt_override { 181/*******************************************************************************
207 APIC_HEADER_DEF u8 bus; /* 0 - ISA */ 182 *
208 u8 source; /* Interrupt source (IRQ) */ 183 * FADT - Fixed ACPI Description Table (Signature "FACP")
209 u32 interrupt; /* Global system interrupt */ 184 *
210 MPS_INTI_FLAGS}; 185 ******************************************************************************/
186
187/* Fields common to all versions of the FADT */
188
189#define ACPI_FADT_COMMON \
190 ACPI_TABLE_HEADER_DEF \
191 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \
192 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \
193 u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \
194 u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \
195 u16 sci_int; /* System vector of SCI interrupt */ \
196 u32 smi_cmd; /* Port address of SMI command port */ \
197 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 */ \
199 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \
200 u8 pstate_cnt; /* Processor performance state control*/ \
201 u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a Event Reg Blk */ \
202 u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b Event Reg Blk */ \
203 u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \
204 u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \
205 u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \
206 u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \
207 u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \
208 u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \
209 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ \
210 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ \
211 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \
212 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \
213 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \
214 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \
215 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \
216 u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \
217 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \
218 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \
219 u16 flush_size; /* Processor's memory cache line width, in bytes */ \
220 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*/ \
222 u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \
223 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \
224 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \
225 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*/ \
227 u8 reserved2; /* Reserved, must be zero */
211 228
212struct madt_nmi_source { 229/*
213 APIC_HEADER_DEF MPS_INTI_FLAGS u32 interrupt; /* Global system interrupt */ 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 */
261 u8 reserved4[3]; /* These three bytes must be zero */
262 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
263 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 */
265 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */
266 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
267 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
268 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
269 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
270 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */
271 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */
214}; 272};
215 273
216struct madt_local_apic_nmi { 274/*
217 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 275 * "Down-revved" ACPI 2.0 FADT descriptor
218 MPS_INTI_FLAGS u8 lint; /* LINTn to which NMI is connected */ 276 * Defined here to allow compiler to generate the length of the struct
277 */
278struct fadt_descriptor_rev2_minus {
279 ACPI_FADT_COMMON u32 flags;
280 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
281 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
282 u8 reserved7[3]; /* Reserved, must be zero */
219}; 283};
220 284
221struct madt_address_override { 285/*
222 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */ 286 * ACPI 1.0 FADT
223 u64 address; /* APIC physical address */ 287 * Defined here to allow compiler to generate the length of the struct
288 */
289struct fadt_descriptor_rev1 {
290 ACPI_FADT_COMMON u32 flags;
224}; 291};
225 292
226struct madt_io_sapic { 293/* FADT: Prefered Power Management Profiles */
227 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */
228 u8 reserved; /* Reserved, must be zero */
229 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
230 u64 address; /* SAPIC physical address */
231};
232 294
233struct madt_local_sapic { 295#define PM_UNSPECIFIED 0
234 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */ 296#define PM_DESKTOP 1
235 u8 local_sapic_id; /* SAPIC ID */ 297#define PM_MOBILE 2
236 u8 local_sapic_eid; /* SAPIC EID */ 298#define PM_WORKSTATION 3
237 u8 reserved[3]; /* Reserved, must be zero */ 299#define PM_ENTERPRISE_SERVER 4
238 LOCAL_APIC_FLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */ 300#define PM_SOHO_SERVER 5
239 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */ 301#define PM_APPLIANCE_PC 6
240};
241 302
242struct madt_interrupt_source { 303/* FADT: Boot Arch Flags */
243 APIC_HEADER_DEF MPS_INTI_FLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */
244 u8 processor_id; /* Processor ID */
245 u8 processor_eid; /* Processor EID */
246 u8 io_sapic_vector; /* Vector value for PMI interrupts */
247 u32 interrupt; /* Global system interrupt */
248 u32 flags; /* Interrupt Source Flags */
249};
250 304
251/* 305#define BAF_LEGACY_DEVICES 0x0001
252 * Smart Battery 306#define BAF_8042_KEYBOARD_CONTROLLER 0x0002
253 */ 307
254struct smart_battery_table { 308#define FADT2_REVISION_ID 3
255 ACPI_TABLE_HEADER_DEF u32 warning_level; 309#define FADT2_MINUS_REVISION_ID 2
256 u32 low_level; 310
257 u32 critical_level; 311/* Reset to default packing */
258};
259 312
260#pragma pack() 313#pragma pack()
261 314
262/* 315/*
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
326/*
263 * ACPI Table information. We save the table address, length, 327 * ACPI Table information. We save the table address, length,
264 * and type of memory allocation (mapped or allocated) for each 328 * and type of memory allocation (mapped or allocated) for each
265 * table for 1) when we exit, and 2) if a new table is installed 329 * table for 1) when we exit, and 2) if a new table is installed
@@ -290,27 +354,17 @@ struct acpi_table_support {
290 u8 flags; 354 u8 flags;
291}; 355};
292 356
293/*
294 * Get the ACPI version-specific tables
295 */
296#include "actbl1.h" /* Acpi 1.0 table definitions */
297#include "actbl2.h" /* Acpi 2.0 table definitions */
298
299extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1, 357extern u8 acpi_fadt_is_v1; /* is set to 1 if FADT is revision 1,
300 * needed for certain workarounds */ 358 * needed for certain workarounds */
359/* Macros used to generate offsets to specific table fields */
301 360
302#pragma pack(1) 361#define ACPI_FACS_OFFSET(f) (u8) ACPI_OFFSET (struct facs_descriptor,f)
303/* 362#define ACPI_FADT_OFFSET(f) (u8) ACPI_OFFSET (struct fadt_descriptor, f)
304 * High performance timer 363#define ACPI_GAS_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_generic_address,f)
305 */ 364#define ACPI_HDR_OFFSET(f) (u8) ACPI_OFFSET (struct acpi_table_header,f)
306struct hpet_table { 365#define ACPI_RSDP_OFFSET(f) (u8) ACPI_OFFSET (struct rsdp_descriptor,f)
307 ACPI_TABLE_HEADER_DEF u32 hardware_id;
308 struct acpi_generic_address base_address;
309 u8 hpet_number;
310 u16 clock_tick;
311 u8 attributes;
312};
313 366
314#pragma pack() 367#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct fadt_descriptor,f,o)
368#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (struct facs_descriptor,f,o)
315 369
316#endif /* __ACTBL_H__ */ 370#endif /* __ACTBL_H__ */
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index cd428d57add0..745a6445a4f9 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -1,6 +1,6 @@
1/****************************************************************************** 1/******************************************************************************
2 * 2 *
3 * Name: actbl1.h - ACPI 1.0 tables 3 * Name: actbl1.h - Additional ACPI table definitions
4 * 4 *
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
@@ -44,92 +44,599 @@
44#ifndef __ACTBL1_H__ 44#ifndef __ACTBL1_H__
45#define __ACTBL1_H__ 45#define __ACTBL1_H__
46 46
47/*******************************************************************************
48 *
49 * Additional ACPI Tables
50 *
51 * These tables are not consumed directly by the ACPICA subsystem, but are
52 * included here to support device drivers and the AML disassembler.
53 *
54 ******************************************************************************/
55
56/*
57 * Values for description table header signatures. Useful because they make
58 * it more difficult to inadvertently type in the wrong signature.
59 */
60#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
64#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_MADT "APIC" /* Multiple APIC Description Table */
67#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
68#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
69#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
70#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
71#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
72#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
73#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
74#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
75
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/*
83 * All tables must be byte-packed to match the ACPI specification, since
84 * the tables are provided by the system BIOS.
85 */
47#pragma pack(1) 86#pragma pack(1)
48 87
49/* 88/*
50 * ACPI 1.0 Root System Description Table (RSDT) 89 * Note about bitfields: The u8 type is used for bitfields in ACPI tables.
90 * This is the only type that is even remotely portable. Anything else is not
91 * portable, so do not use any other bitfield types.
51 */ 92 */
52struct rsdt_descriptor_rev1 { 93
53 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 94/*******************************************************************************
54 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */ 95 *
55}; 96 * ASF - Alert Standard Format table (Signature "ASF!")
97 *
98 ******************************************************************************/
99
100struct acpi_table_asf {
101ACPI_TABLE_HEADER_DEF};
102
103#define ACPI_ASF_HEADER_DEF \
104 u8 type; \
105 u8 reserved; \
106 u16 length;
107
108struct acpi_asf_header {
109ACPI_ASF_HEADER_DEF};
110
111/* Values for Type field */
112
113#define ASF_INFO 0
114#define ASF_ALERT 1
115#define ASF_CONTROL 2
116#define ASF_BOOT 3
117#define ASF_ADDRESS 4
118#define ASF_RESERVED 5
56 119
57/* 120/*
58 * ACPI 1.0 Firmware ACPI Control Structure (FACS) 121 * ASF subtables
59 */ 122 */
60struct facs_descriptor_rev1 { 123
61 char signature[4]; /* ASCII table signature */ 124/* 0: ASF Information */
62 u32 length; /* Length of structure in bytes */ 125
63 u32 hardware_signature; /* Hardware configuration signature */ 126struct acpi_asf_info {
64 u32 firmware_waking_vector; /* ACPI OS waking vector */ 127 ACPI_ASF_HEADER_DEF u8 min_reset_value;
65 u32 global_lock; /* Global Lock */ 128 u8 min_poll_interval;
129 u16 system_id;
130 u32 mfg_id;
131 u8 flags;
132 u8 reserved2[3];
133};
134
135/* 1: ASF Alerts */
136
137struct acpi_asf_alert {
138 ACPI_ASF_HEADER_DEF u8 assert_mask;
139 u8 deassert_mask;
140 u8 alerts;
141 u8 data_length;
142 u8 array[1];
143};
144
145/* 2: ASF Remote Control */
146
147struct acpi_asf_remote {
148 ACPI_ASF_HEADER_DEF u8 controls;
149 u8 data_length;
150 u16 reserved2;
151 u8 array[1];
152};
153
154/* 3: ASF RMCP Boot Options */
155
156struct acpi_asf_rmcp {
157 ACPI_ASF_HEADER_DEF u8 capabilities[7];
158 u8 completion_code;
159 u32 enterprise_id;
160 u8 command;
161 u16 parameter;
162 u16 boot_options;
163 u16 oem_parameters;
164};
165
166/* 4: ASF Address */
167
168struct acpi_asf_address {
169 ACPI_ASF_HEADER_DEF u8 eprom_address;
170 u8 devices;
171 u8 smbus_addresses[1];
172};
173
174/*******************************************************************************
175 *
176 * BOOT - Simple Boot Flag Table
177 *
178 ******************************************************************************/
179
180struct acpi_table_boot {
181 ACPI_TABLE_HEADER_DEF u8 cmos_index; /* Index in CMOS RAM for the boot register */
182 u8 reserved[3];
183};
184
185/*******************************************************************************
186 *
187 * CPEP - Corrected Platform Error Polling table
188 *
189 ******************************************************************************/
190
191struct acpi_table_cpep {
192 ACPI_TABLE_HEADER_DEF u64 reserved;
193};
194
195/* Subtable */
196
197struct acpi_cpep_polling {
198 u8 type;
199 u8 length;
200 u8 processor_id; /* Processor ID */
201 u8 processor_eid; /* Processor EID */
202 u32 polling_interval; /* Polling interval (msec) */
203};
204
205/*******************************************************************************
206 *
207 * DBGP - Debug Port table
208 *
209 ******************************************************************************/
210
211struct acpi_table_dbgp {
212 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
213 u8 reserved[3];
214 struct acpi_generic_address debug_port;
215};
216
217/*******************************************************************************
218 *
219 * ECDT - Embedded Controller Boot Resources Table
220 *
221 ******************************************************************************/
222
223struct ec_boot_resources {
224 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */
225 struct acpi_generic_address ec_data; /* Address of EC data register */
226 u32 uid; /* Unique ID - must be same as the EC _UID method */
227 u8 gpe_bit; /* The GPE for the EC */
228 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */
229};
230
231/*******************************************************************************
232 *
233 * HPET - High Precision Event Timer table
234 *
235 ******************************************************************************/
236
237struct acpi_hpet_table {
238 ACPI_TABLE_HEADER_DEF u32 hardware_id; /* Hardware ID of event timer block */
239 struct acpi_generic_address base_address; /* Address of event timer block */
240 u8 hpet_number; /* HPET sequence number */
241 u16 clock_tick; /* Main counter min tick, periodic mode */
242 u8 attributes;
243};
244
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/*******************************************************************************
255 *
256 * MADT - Multiple APIC Description Table
257 *
258 ******************************************************************************/
259
260struct multiple_apic_table {
261 ACPI_TABLE_HEADER_DEF u32 local_apic_address; /* Physical address of local APIC */
66 262
67 /* Flags (32 bits) */ 263 /* Flags (32 bits) */
68 264
69 u8 S4bios_f:1; /* 00: S4BIOS support is present */ 265 u8 PCATcompat:1; /* 00: System also has dual 8259s */
70 u8:7; /* 01-07: Reserved, must be zero */ 266 u8:7; /* 01-07: Reserved, must be zero */
71 u8 reserved1[3]; /* 08-31: Reserved, must be zero */ 267 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
72
73 u8 reserved2[40]; /* Reserved, must be zero */
74}; 268};
75 269
270/* Values for MADT PCATCompat */
271
272#define DUAL_PIC 0
273#define MULTIPLE_APIC 1
274
275/* Common MADT Sub-table header */
276
277#define APIC_HEADER_DEF \
278 u8 type; \
279 u8 length;
280
281struct apic_header {
282APIC_HEADER_DEF};
283
284/* Values for Type in struct apic_header */
285
286#define APIC_PROCESSOR 0
287#define APIC_IO 1
288#define APIC_XRUPT_OVERRIDE 2
289#define APIC_NMI 3
290#define APIC_LOCAL_NMI 4
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
297/* Flag definitions for MADT sub-tables */
298
299#define ACPI_MADT_IFLAGS /* INTI flags (16 bits) */ \
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
305#define ACPI_MADT_LFLAGS /* Local Sapic flags (32 bits) */ \
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
310/* Values for MPS INTI flags */
311
312#define POLARITY_CONFORMS 0
313#define POLARITY_ACTIVE_HIGH 1
314#define POLARITY_RESERVED 2
315#define POLARITY_ACTIVE_LOW 3
316
317#define TRIGGER_CONFORMS 0
318#define TRIGGER_EDGE 1
319#define TRIGGER_RESERVED 2
320#define TRIGGER_LEVEL 3
321
76/* 322/*
77 * ACPI 1.0 Fixed ACPI Description Table (FADT) 323 * MADT Sub-tables, correspond to Type in struct apic_header
78 */ 324 */
79struct fadt_descriptor_rev1 { 325
80 ACPI_TABLE_HEADER_DEF /* ACPI common table header */ 326/* 0: processor APIC */
81 u32 firmware_ctrl; /* Physical address of FACS */ 327
82 u32 dsdt; /* Physical address of DSDT */ 328struct madt_processor_apic {
83 u8 model; /* System Interrupt Model */ 329 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
84 u8 reserved1; /* Reserved, must be zero */ 330 u8 local_apic_id; /* Processor's local APIC id */
85 u16 sci_int; /* System vector of SCI interrupt */ 331 ACPI_MADT_LFLAGS};
86 u32 smi_cmd; /* Port address of SMI command port */ 332
87 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ 333/* 1: IO APIC */
88 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ 334
89 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ 335struct madt_io_apic {
90 u8 reserved2; /* Reserved, must be zero */ 336 APIC_HEADER_DEF u8 io_apic_id; /* I/O APIC ID */
91 u32 pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ 337 u8 reserved; /* Reserved - must be zero */
92 u32 pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ 338 u32 address; /* APIC physical address */
93 u32 pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ 339 u32 interrupt; /* Global system interrupt where INTI lines start */
94 u32 pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ 340};
95 u32 pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ 341
96 u32 pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ 342/* 2: Interrupt Override */
97 u32 gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ 343
98 u32 gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ 344struct madt_interrupt_override {
99 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ 345 APIC_HEADER_DEF u8 bus; /* 0 - ISA */
100 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ 346 u8 source; /* Interrupt source (IRQ) */
101 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ 347 u32 interrupt; /* Global system interrupt */
102 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ 348 ACPI_MADT_IFLAGS};
103 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ 349
104 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ 350/* 3: NMI Sources */
105 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ 351
106 u8 reserved3; /* Reserved, must be zero */ 352struct madt_nmi_source {
107 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ 353 APIC_HEADER_DEF ACPI_MADT_IFLAGS u32 interrupt; /* Global system interrupt */
108 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ 354};
109 u16 flush_size; /* Size of area read to flush caches */ 355
110 u16 flush_stride; /* Stride used in flushing caches */ 356/* 4: Local APIC NMI */
111 u8 duty_offset; /* Bit location of duty cycle field in p_cnt reg */ 357
112 u8 duty_width; /* Bit width of duty cycle field in p_cnt reg */ 358struct madt_local_apic_nmi {
113 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ 359 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
114 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ 360 ACPI_MADT_IFLAGS u8 lint; /* LINTn to which NMI is connected */
115 u8 century; /* Index to century in RTC CMOS RAM */ 361};
116 u8 reserved4[3]; /* Reserved, must be zero */ 362
363/* 5: Address Override */
364
365struct madt_address_override {
366 APIC_HEADER_DEF u16 reserved; /* Reserved, must be zero */
367 u64 address; /* APIC physical address */
368};
369
370/* 6: I/O Sapic */
371
372struct madt_io_sapic {
373 APIC_HEADER_DEF u8 io_sapic_id; /* I/O SAPIC ID */
374 u8 reserved; /* Reserved, must be zero */
375 u32 interrupt_base; /* Glocal interrupt for SAPIC start */
376 u64 address; /* SAPIC physical address */
377};
378
379/* 7: Local Sapic */
380
381struct madt_local_sapic {
382 APIC_HEADER_DEF u8 processor_id; /* ACPI processor id */
383 u8 local_sapic_id; /* SAPIC ID */
384 u8 local_sapic_eid; /* SAPIC EID */
385 u8 reserved[3]; /* Reserved, must be zero */
386 ACPI_MADT_LFLAGS u32 processor_uID; /* Numeric UID - ACPI 3.0 */
387 char processor_uIDstring[1]; /* String UID - ACPI 3.0 */
388};
389
390/* 8: Platform Interrupt Source */
391
392struct madt_interrupt_source {
393 APIC_HEADER_DEF ACPI_MADT_IFLAGS u8 interrupt_type; /* 1=PMI, 2=INIT, 3=corrected */
394 u8 processor_id; /* Processor ID */
395 u8 processor_eid; /* Processor EID */
396 u8 io_sapic_vector; /* Vector value for PMI interrupts */
397 u32 interrupt; /* Global system interrupt */
398 u32 flags; /* Interrupt Source Flags */
399};
400
401#ifdef DUPLICATE_DEFINITION_WITH_LINUX_ACPI_H
402/*******************************************************************************
403 *
404 * MCFG - PCI Memory Mapped Configuration table and sub-table
405 *
406 ******************************************************************************/
407
408struct acpi_table_mcfg {
409 ACPI_TABLE_HEADER_DEF u8 reserved[8];
410};
411
412struct acpi_mcfg_allocation {
413 u64 base_address; /* Base address, processor-relative */
414 u16 pci_segment; /* PCI segment group number */
415 u8 start_bus_number; /* Starting PCI Bus number */
416 u8 end_bus_number; /* Final PCI Bus number */
417 u32 reserved;
418};
419#endif
420
421/*******************************************************************************
422 *
423 * SBST - Smart Battery Specification Table
424 *
425 ******************************************************************************/
426
427struct smart_battery_table {
428 ACPI_TABLE_HEADER_DEF u32 warning_level;
429 u32 low_level;
430 u32 critical_level;
431};
432
433/*******************************************************************************
434 *
435 * SLIT - System Locality Distance Information Table
436 *
437 ******************************************************************************/
438
439struct system_locality_info {
440 ACPI_TABLE_HEADER_DEF u64 locality_count;
441 u8 entry[1][1];
442};
443
444/*******************************************************************************
445 *
446 * SPCR - Serial Port Console Redirection table
447 *
448 ******************************************************************************/
449
450struct acpi_table_spcr {
451 ACPI_TABLE_HEADER_DEF u8 interface_type; /* 0=full 16550, 1=subset of 16550 */
452 u8 reserved[3];
453 struct acpi_generic_address serial_port;
454 u8 interrupt_type;
455 u8 pc_interrupt;
456 u32 interrupt;
457 u8 baud_rate;
458 u8 parity;
459 u8 stop_bits;
460 u8 flow_control;
461 u8 terminal_type;
462 u8 reserved2;
463 u16 pci_device_id;
464 u16 pci_vendor_id;
465 u8 pci_bus;
466 u8 pci_device;
467 u8 pci_function;
468 u32 pci_flags;
469 u8 pci_segment;
470 u32 reserved3;
471};
472
473/*******************************************************************************
474 *
475 * SPMI - Server Platform Management Interface table
476 *
477 ******************************************************************************/
478
479struct acpi_table_spmi {
480 ACPI_TABLE_HEADER_DEF u8 reserved;
481 u8 interface_type;
482 u16 spec_revision; /* Version of IPMI */
483 u8 interrupt_type;
484 u8 gpe_number; /* GPE assigned */
485 u8 reserved2;
486 u8 pci_device_flag;
487 u32 interrupt;
488 struct acpi_generic_address ipmi_register;
489 u8 pci_segment;
490 u8 pci_bus;
491 u8 pci_device;
492 u8 pci_function;
493};
494
495/*******************************************************************************
496 *
497 * SRAT - System Resource Affinity Table
498 *
499 ******************************************************************************/
500
501struct system_resource_affinity {
502 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */
503 u64 reserved2; /* Reserved, must be zero */
504};
505
506/* SRAT common sub-table header */
507
508#define SRAT_SUBTABLE_HEADER \
509 u8 type; \
510 u8 length;
511
512/* Values for Type above */
513
514#define SRAT_CPU_AFFINITY 0
515#define SRAT_MEMORY_AFFINITY 1
516#define SRAT_RESERVED 2
517
518/* SRAT sub-tables */
519
520struct static_resource_alloc {
521 SRAT_SUBTABLE_HEADER u8 proximity_domain_lo;
522 u8 apic_id;
523
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;
531 u8 proximity_domain_hi[3];
532 u32 reserved4; /* Reserved, must be zero */
533};
534
535struct memory_affinity {
536 SRAT_SUBTABLE_HEADER u32 proximity_domain;
537 u16 reserved3;
538 u64 base_address;
539 u64 address_length;
540 u32 reserved4;
117 541
118 /* Flags (32 bits) */ 542 /* Flags (32 bits) */
119 543
120 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */ 544 u8 enabled:1; /* 00: Use affinity structure */
121 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */ 545 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
122 u8 proc_c1:1; /* 02: All processors support C1 state */ 546 u8 non_volatile:1; /* 02: Memory is non-volatile */
123 u8 plvl2_up:1; /* 03: C2 state works on MP system */ 547 u8:5; /* 03-07: Reserved, must be zero */
124 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */ 548 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
125 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */ 549
126 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */ 550 u64 reserved6; /* Reserved, must be zero */
127 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */ 551};
128 u8 tmr_val_ext:1; /* 08: tmr_val width is 32 bits (0 = 24 bits) */ 552
129 u8:7; /* 09-15: Reserved, must be zero */ 553/*******************************************************************************
130 u8 reserved5[2]; /* 16-31: Reserved, must be zero */ 554 *
555 * TCPA - Trusted Computing Platform Alliance table
556 *
557 ******************************************************************************/
558
559struct acpi_table_tcpa {
560 ACPI_TABLE_HEADER_DEF u16 reserved;
561 u32 max_log_length; /* Maximum length for the event log area */
562 u64 log_address; /* Address of the event log area */
131}; 563};
132 564
565/*******************************************************************************
566 *
567 * WDRT - Watchdog Resource Table
568 *
569 ******************************************************************************/
570
571struct acpi_table_wdrt {
572 ACPI_TABLE_HEADER_DEF u32 header_length; /* Watchdog Header Length */
573 u8 pci_segment; /* PCI Segment number */
574 u8 pci_bus; /* PCI Bus number */
575 u8 pci_device; /* PCI Device number */
576 u8 pci_function; /* PCI Function number */
577 u32 timer_period; /* Period of one timer count (msec) */
578 u32 max_count; /* Maximum counter value supported */
579 u32 min_count; /* Minimum counter value */
580 u8 flags;
581 u8 reserved[3];
582 u32 entries; /* Number of watchdog entries that follow */
583};
584
585#if 0 /* Flags, will be converted to macros */
586u8 enabled:1; /* 00: Timer enabled */
587u8:6; /* 01-06: Reserved */
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
638/* Reset to default packing */
639
133#pragma pack() 640#pragma pack()
134 641
135#endif /* __ACTBL1_H__ */ 642#endif /* __ACTBL1_H__ */
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index dfc7ac1094bb..67efe6cad27b 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -44,234 +44,6 @@
44#ifndef __ACTBL2_H__ 44#ifndef __ACTBL2_H__
45#define __ACTBL2_H__ 45#define __ACTBL2_H__
46 46
47/* 47/* Code moved to both actbl.h and actbl1.h */
48 * Prefered Power Management Profiles
49 */
50#define PM_UNSPECIFIED 0
51#define PM_DESKTOP 1
52#define PM_MOBILE 2
53#define PM_WORKSTATION 3
54#define PM_ENTERPRISE_SERVER 4
55#define PM_SOHO_SERVER 5
56#define PM_APPLIANCE_PC 6
57
58/*
59 * ACPI Boot Arch Flags
60 */
61#define BAF_LEGACY_DEVICES 0x0001
62#define BAF_8042_KEYBOARD_CONTROLLER 0x0002
63
64#define FADT2_REVISION_ID 3
65#define FADT2_MINUS_REVISION_ID 2
66
67#pragma pack(1)
68
69/*
70 * ACPI 2.0 Root System Description Table (RSDT)
71 */
72struct rsdt_descriptor_rev2 {
73 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
74 u32 table_offset_entry[1]; /* Array of pointers to ACPI tables */
75};
76
77/*
78 * ACPI 2.0 Extended System Description Table (XSDT)
79 */
80struct xsdt_descriptor_rev2 {
81 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
82 u64 table_offset_entry[1]; /* Array of pointers to ACPI tables */
83};
84
85/*
86 * ACPI 2.0 Firmware ACPI Control Structure (FACS)
87 */
88struct facs_descriptor_rev2 {
89 char signature[4]; /* ASCII table signature */
90 u32 length; /* Length of structure, in bytes */
91 u32 hardware_signature; /* Hardware configuration signature */
92 u32 firmware_waking_vector; /* 32-bit physical address of the Firmware Waking Vector. */
93 u32 global_lock; /* Global Lock used to synchronize access to shared hardware resources */
94
95 /* Flags (32 bits) */
96
97 u8 S4bios_f:1; /* 00: S4BIOS support is present */
98 u8:7; /* 01-07: Reserved, must be zero */
99 u8 reserved1[3]; /* 08-31: Reserved, must be zero */
100
101 u64 xfirmware_waking_vector; /* 64-bit physical address of the Firmware Waking Vector. */
102 u8 version; /* Version of this table */
103 u8 reserved3[31]; /* Reserved, must be zero */
104};
105
106/*
107 * ACPI 2.0+ Generic Address Structure (GAS)
108 */
109struct acpi_generic_address {
110 u8 address_space_id; /* Address space where struct or register exists. */
111 u8 register_bit_width; /* Size in bits of given register */
112 u8 register_bit_offset; /* Bit offset within the register */
113 u8 access_width; /* Minimum Access size (ACPI 3.0) */
114 u64 address; /* 64-bit address of struct or register */
115};
116
117#define FADT_REV2_COMMON \
118 u32 V1_firmware_ctrl; /* 32-bit physical address of FACS */ \
119 u32 V1_dsdt; /* 32-bit physical address of DSDT */ \
120 u8 reserved1; /* System Interrupt Model isn't used in ACPI 2.0*/ \
121 u8 prefer_PM_profile; /* Conveys preferred power management profile to OSPM. */ \
122 u16 sci_int; /* System vector of SCI interrupt */ \
123 u32 smi_cmd; /* Port address of SMI command port */ \
124 u8 acpi_enable; /* Value to write to smi_cmd to enable ACPI */ \
125 u8 acpi_disable; /* Value to write to smi_cmd to disable ACPI */ \
126 u8 S4bios_req; /* Value to write to SMI CMD to enter S4BIOS state */ \
127 u8 pstate_cnt; /* Processor performance state control*/ \
128 u32 V1_pm1a_evt_blk; /* Port address of Power Mgt 1a acpi_event Reg Blk */ \
129 u32 V1_pm1b_evt_blk; /* Port address of Power Mgt 1b acpi_event Reg Blk */ \
130 u32 V1_pm1a_cnt_blk; /* Port address of Power Mgt 1a Control Reg Blk */ \
131 u32 V1_pm1b_cnt_blk; /* Port address of Power Mgt 1b Control Reg Blk */ \
132 u32 V1_pm2_cnt_blk; /* Port address of Power Mgt 2 Control Reg Blk */ \
133 u32 V1_pm_tmr_blk; /* Port address of Power Mgt Timer Ctrl Reg Blk */ \
134 u32 V1_gpe0_blk; /* Port addr of General Purpose acpi_event 0 Reg Blk */ \
135 u32 V1_gpe1_blk; /* Port addr of General Purpose acpi_event 1 Reg Blk */ \
136 u8 pm1_evt_len; /* Byte length of ports at pm1_x_evt_blk */ \
137 u8 pm1_cnt_len; /* Byte length of ports at pm1_x_cnt_blk */ \
138 u8 pm2_cnt_len; /* Byte Length of ports at pm2_cnt_blk */ \
139 u8 pm_tm_len; /* Byte Length of ports at pm_tm_blk */ \
140 u8 gpe0_blk_len; /* Byte Length of ports at gpe0_blk */ \
141 u8 gpe1_blk_len; /* Byte Length of ports at gpe1_blk */ \
142 u8 gpe1_base; /* Offset in gpe model where gpe1 events start */ \
143 u8 cst_cnt; /* Support for the _CST object and C States change notification.*/ \
144 u16 plvl2_lat; /* Worst case HW latency to enter/exit C2 state */ \
145 u16 plvl3_lat; /* Worst case HW latency to enter/exit C3 state */ \
146 u16 flush_size; /* Number of flush strides that need to be read */ \
147 u16 flush_stride; /* Processor's memory cache line width, in bytes */ \
148 u8 duty_offset; /* Processor's duty cycle index in processor's P_CNT reg*/ \
149 u8 duty_width; /* Processor's duty cycle value bit width in P_CNT register.*/ \
150 u8 day_alrm; /* Index to day-of-month alarm in RTC CMOS RAM */ \
151 u8 mon_alrm; /* Index to month-of-year alarm in RTC CMOS RAM */ \
152 u8 century; /* Index to century in RTC CMOS RAM */ \
153 u16 iapc_boot_arch; /* IA-PC Boot Architecture Flags. See Table 5-10 for description*/
154
155/*
156 * ACPI 2.0+ Fixed ACPI Description Table (FADT)
157 */
158struct fadt_descriptor_rev2 {
159 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
160 FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */
161
162 /* Flags (32 bits) */
163
164 u8 wb_invd:1; /* 00: The wbinvd instruction works properly */
165 u8 wb_invd_flush:1; /* 01: The wbinvd flushes but does not invalidate */
166 u8 proc_c1:1; /* 02: All processors support C1 state */
167 u8 plvl2_up:1; /* 03: C2 state works on MP system */
168 u8 pwr_button:1; /* 04: Power button is handled as a generic feature */
169 u8 sleep_button:1; /* 05: Sleep button is handled as a generic feature, or not present */
170 u8 fixed_rTC:1; /* 06: RTC wakeup stat not in fixed register space */
171 u8 rtcs4:1; /* 07: RTC wakeup stat not possible from S4 */
172 u8 tmr_val_ext:1; /* 08: tmr_val is 32 bits 0=24-bits */
173 u8 dock_cap:1; /* 09: Docking supported */
174 u8 reset_reg_sup:1; /* 10: System reset via the FADT RESET_REG supported */
175 u8 sealed_case:1; /* 11: No internal expansion capabilities and case is sealed */
176 u8 headless:1; /* 12: No local video capabilities or local input devices */
177 u8 cpu_sw_sleep:1; /* 13: Must execute native instruction after writing SLP_TYPx register */
178
179 u8 pci_exp_wak:1; /* 14: System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
180 u8 use_platform_clock:1; /* 15: OSPM should use platform-provided timer (ACPI 3.0) */
181 u8 S4rtc_sts_valid:1; /* 16: Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
182 u8 remote_power_on_capable:1; /* 17: System is compatible with remote power on (ACPI 3.0) */
183 u8 force_apic_cluster_model:1; /* 18: All local APICs must use cluster model (ACPI 3.0) */
184 u8 force_apic_physical_destination_mode:1; /* 19: all local x_aPICs must use physical dest mode (ACPI 3.0) */
185 u8:4; /* 20-23: Reserved, must be zero */
186 u8 reserved3; /* 24-31: Reserved, must be zero */
187
188 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
189 u8 reset_value; /* Value to write to the reset_register port to reset the system */
190 u8 reserved4[3]; /* These three bytes must be zero */
191 u64 xfirmware_ctrl; /* 64-bit physical address of FACS */
192 u64 Xdsdt; /* 64-bit physical address of DSDT */
193 struct acpi_generic_address xpm1a_evt_blk; /* Extended Power Mgt 1a acpi_event Reg Blk address */
194 struct acpi_generic_address xpm1b_evt_blk; /* Extended Power Mgt 1b acpi_event Reg Blk address */
195 struct acpi_generic_address xpm1a_cnt_blk; /* Extended Power Mgt 1a Control Reg Blk address */
196 struct acpi_generic_address xpm1b_cnt_blk; /* Extended Power Mgt 1b Control Reg Blk address */
197 struct acpi_generic_address xpm2_cnt_blk; /* Extended Power Mgt 2 Control Reg Blk address */
198 struct acpi_generic_address xpm_tmr_blk; /* Extended Power Mgt Timer Ctrl Reg Blk address */
199 struct acpi_generic_address xgpe0_blk; /* Extended General Purpose acpi_event 0 Reg Blk address */
200 struct acpi_generic_address xgpe1_blk; /* Extended General Purpose acpi_event 1 Reg Blk address */
201};
202
203/* "Down-revved" ACPI 2.0 FADT descriptor */
204
205struct fadt_descriptor_rev2_minus {
206 ACPI_TABLE_HEADER_DEF /* ACPI common table header */
207 FADT_REV2_COMMON u8 reserved2; /* Reserved, must be zero */
208 u32 flags;
209 struct acpi_generic_address reset_register; /* Reset register address in GAS format */
210 u8 reset_value; /* Value to write to the reset_register port to reset the system. */
211 u8 reserved7[3]; /* Reserved, must be zero */
212};
213
214/* ECDT - Embedded Controller Boot Resources Table */
215
216struct ec_boot_resources {
217 ACPI_TABLE_HEADER_DEF struct acpi_generic_address ec_control; /* Address of EC command/status register */
218 struct acpi_generic_address ec_data; /* Address of EC data register */
219 u32 uid; /* Unique ID - must be same as the EC _UID method */
220 u8 gpe_bit; /* The GPE for the EC */
221 u8 ec_id[1]; /* Full namepath of the EC in the ACPI namespace */
222};
223
224/* SRAT - System Resource Affinity Table */
225
226struct static_resource_alloc {
227 u8 type;
228 u8 length;
229 u8 proximity_domain_lo;
230 u8 apic_id;
231
232 /* Flags (32 bits) */
233
234 u8 enabled:1; /* 00: Use affinity structure */
235 u8:7; /* 01-07: Reserved, must be zero */
236 u8 reserved3[3]; /* 08-31: Reserved, must be zero */
237
238 u8 local_sapic_eid;
239 u8 proximity_domain_hi[3];
240 u32 reserved4; /* Reserved, must be zero */
241};
242
243struct memory_affinity {
244 u8 type;
245 u8 length;
246 u32 proximity_domain;
247 u16 reserved3;
248 u64 base_address;
249 u64 address_length;
250 u32 reserved4;
251
252 /* Flags (32 bits) */
253
254 u8 enabled:1; /* 00: Use affinity structure */
255 u8 hot_pluggable:1; /* 01: Memory region is hot pluggable */
256 u8 non_volatile:1; /* 02: Memory is non-volatile */
257 u8:5; /* 03-07: Reserved, must be zero */
258 u8 reserved5[3]; /* 08-31: Reserved, must be zero */
259
260 u64 reserved6; /* Reserved, must be zero */
261};
262
263struct system_resource_affinity {
264 ACPI_TABLE_HEADER_DEF u32 reserved1; /* Must be value '1' */
265 u64 reserved2; /* Reserved, must be zero */
266};
267
268/* SLIT - System Locality Distance Information Table */
269
270struct system_locality_info {
271 ACPI_TABLE_HEADER_DEF u64 locality_count;
272 u8 entry[1][1];
273};
274
275#pragma pack()
276 48
277#endif /* __ACTBL2_H__ */ 49#endif /* __ACTBL2_H__ */
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index 5e69a80c7850..115b0cbc370f 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -283,6 +283,8 @@ acpi_ut_ptr_exit(u32 line_number,
283 283
284void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id); 284void acpi_ut_dump_buffer(u8 * buffer, u32 count, u32 display, u32 component_id);
285 285
286void acpi_ut_dump_buffer2(u8 * buffer, u32 count, u32 display);
287
286void acpi_ut_report_error(char *module_name, u32 line_number); 288void acpi_ut_report_error(char *module_name, u32 line_number);
287 289
288void acpi_ut_report_info(char *module_name, u32 line_number); 290void acpi_ut_report_info(char *module_name, u32 line_number);
@@ -451,6 +453,8 @@ acpi_ut_short_divide(acpi_integer in_dividend,
451/* 453/*
452 * utmisc 454 * utmisc
453 */ 455 */
456u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
457
454acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id); 458acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id);
455 459
456void acpi_ut_release_owner_id(acpi_owner_id * owner_id); 460void acpi_ut_release_owner_id(acpi_owner_id * owner_id);
@@ -466,7 +470,9 @@ void acpi_ut_print_string(char *string, u8 max_length);
466 470
467u8 acpi_ut_valid_acpi_name(u32 name); 471u8 acpi_ut_valid_acpi_name(u32 name);
468 472
469u8 acpi_ut_valid_acpi_character(char character); 473acpi_name acpi_ut_repair_name(acpi_name name);
474
475u8 acpi_ut_valid_acpi_char(char character, acpi_native_uint position);
470 476
471acpi_status 477acpi_status
472acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer); 478acpi_ut_strtoul64(char *string, u32 base, acpi_integer * ret_integer);
@@ -492,7 +498,7 @@ acpi_ut_display_init_pathname(u8 type,
492acpi_status 498acpi_status
493acpi_ut_walk_aml_resources(u8 * aml, 499acpi_ut_walk_aml_resources(u8 * aml,
494 acpi_size aml_length, 500 acpi_size aml_length,
495 acpi_walk_aml_callback user_function, void *context); 501 acpi_walk_aml_callback user_function, void **context);
496 502
497acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index); 503acpi_status acpi_ut_validate_resource(void *aml, u8 * return_index);
498 504
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index 2270bdd5e530..fd189d425c78 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -60,6 +60,7 @@
60#define ACPI_DISASSEMBLER 60#define ACPI_DISASSEMBLER
61#define ACPI_NO_METHOD_EXECUTION 61#define ACPI_NO_METHOD_EXECUTION
62#define ACPI_LARGE_NAMESPACE_NODE 62#define ACPI_LARGE_NAMESPACE_NODE
63#define ACPI_DATA_TABLE_DISASSEMBLY
63#endif 64#endif
64 65
65#ifdef ACPI_EXEC_APP 66#ifdef ACPI_EXEC_APP
@@ -79,6 +80,7 @@
79#define ACPI_DISASSEMBLER 80#define ACPI_DISASSEMBLER
80#define ACPI_CONSTANT_EVAL_ONLY 81#define ACPI_CONSTANT_EVAL_ONLY
81#define ACPI_LARGE_NAMESPACE_NODE 82#define ACPI_LARGE_NAMESPACE_NODE
83#define ACPI_DATA_TABLE_DISASSEMBLY
82#endif 84#endif
83 85
84#ifdef ACPI_APPLICATION 86#ifdef ACPI_APPLICATION
@@ -140,7 +142,7 @@
140#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ 142#elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */
141#include "acdos16.h" 143#include "acdos16.h"
142 144
143#elif defined(__FreeBSD__) 145#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
144#include "acfreebsd.h" 146#include "acfreebsd.h"
145 147
146#elif defined(__NetBSD__) 148#elif defined(__NetBSD__)