aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 14:52:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 14:52:52 -0400
commit08acd4f8af42affd8cbed81cc1b69fa12ddb213f (patch)
tree988d15db6233b20db6a500cd5f590c6d2041462d /include
parentccf2779544eecfcc5447e2028d1029b6d4ff7bb6 (diff)
parent008238b54ac2350babf195084ecedbcf7851a202 (diff)
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (179 commits) ACPI: Fix acpi_processor_idle and idle= boot parameters interaction acpi: fix section mismatch warning in pnpacpi intel_menlo: fix build warning ACPI: Cleanup: Remove unneeded, multiple local dummy variables ACPI: video - fix permissions on some proc entries ACPI: video - properly handle errors when registering proc elements ACPI: video - do not store invalid entries in attached_array list ACPI: re-name acpi_pm_ops to acpi_suspend_ops ACER_WMI/ASUS_LAPTOP: fix build bug thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed ACPI: check a return value correctly in acpi_power_get_context() #if 0 acpi/bay.c:eject_removable_drive() eeepc-laptop: add hwmon fan control eeepc-laptop: add backlight eeepc-laptop: add base driver ACPI: thinkpad-acpi: bump up version to 0.20 ACPI: thinkpad-acpi: fix selects in Kconfig ACPI: thinkpad-acpi: use a private workqueue ACPI: thinkpad-acpi: fluff really minor fix ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation ... Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c manually.
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h15
-rw-r--r--include/acpi/acdebug.h2
-rw-r--r--include/acpi/acdisasm.h38
-rw-r--r--include/acpi/acdispat.h31
-rw-r--r--include/acpi/acevents.h2
-rw-r--r--include/acpi/acexcep.h2
-rw-r--r--include/acpi/acglobal.h38
-rw-r--r--include/acpi/achware.h2
-rw-r--r--include/acpi/acinterp.h15
-rw-r--r--include/acpi/aclocal.h10
-rw-r--r--include/acpi/acmacros.h71
-rw-r--r--include/acpi/acnames.h2
-rw-r--r--include/acpi/acnamesp.h5
-rw-r--r--include/acpi/acobject.h5
-rw-r--r--include/acpi/acopcode.h6
-rw-r--r--include/acpi/acoutput.h2
-rw-r--r--include/acpi/acparser.h4
-rw-r--r--include/acpi/acpi.h2
-rw-r--r--include/acpi/acpiosxf.h2
-rw-r--r--include/acpi/acpixf.h7
-rw-r--r--include/acpi/acresrc.h3
-rw-r--r--include/acpi/acstruct.h5
-rw-r--r--include/acpi/actables.h2
-rw-r--r--include/acpi/actbl.h2
-rw-r--r--include/acpi/actbl1.h561
-rw-r--r--include/acpi/actypes.h93
-rw-r--r--include/acpi/acutils.h4
-rw-r--r--include/acpi/amlcode.h2
-rw-r--r--include/acpi/amlresrc.h2
-rw-r--r--include/acpi/platform/acenv.h2
-rw-r--r--include/acpi/platform/acgcc.h2
-rw-r--r--include/acpi/platform/aclinux.h2
-rw-r--r--include/linux/isapnp.h10
-rw-r--r--include/linux/pnp.h208
-rw-r--r--include/linux/pnpbios.h151
-rw-r--r--include/linux/thermal.h39
36 files changed, 919 insertions, 430 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 422f29c06c77..28fe8bae1037 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,7 @@
63 63
64/* Current ACPICA subsystem version in YYYYMMDD format */ 64/* Current ACPICA subsystem version in YYYYMMDD format */
65 65
66#define ACPI_CA_VERSION 0x20070126 66#define ACPI_CA_VERSION 0x20080321
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,
@@ -150,6 +150,17 @@
150#define ACPI_OBJ_NUM_OPERANDS 8 150#define ACPI_OBJ_NUM_OPERANDS 8
151#define ACPI_OBJ_MAX_OPERAND 7 151#define ACPI_OBJ_MAX_OPERAND 7
152 152
153/* Number of elements in the Result Stack frame, can be an arbitrary value */
154
155#define ACPI_RESULTS_FRAME_OBJ_NUM 8
156
157/*
158 * Maximal number of elements the Result Stack can contain,
159 * it may be an arbitray value not exceeding the types of
160 * result_size and result_count (now u8).
161 */
162#define ACPI_RESULTS_OBJ_NUM_MAX 255
163
153/* Names within the namespace are 4 bytes long */ 164/* Names within the namespace are 4 bytes long */
154 165
155#define ACPI_NAME_SIZE 4 166#define ACPI_NAME_SIZE 4
diff --git a/include/acpi/acdebug.h b/include/acpi/acdebug.h
index d626bb1d2973..c5a1b50d8d94 100644
--- a/include/acpi/acdebug.h
+++ b/include/acpi/acdebug.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acdisasm.h b/include/acpi/acdisasm.h
index 389d772c7d5b..788f88782012 100644
--- a/include/acpi/acdisasm.h
+++ b/include/acpi/acdisasm.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -97,19 +97,23 @@ typedef const struct acpi_dmtable_info {
97#define ACPI_DMT_CHKSUM 20 97#define ACPI_DMT_CHKSUM 20
98#define ACPI_DMT_SPACEID 21 98#define ACPI_DMT_SPACEID 21
99#define ACPI_DMT_GAS 22 99#define ACPI_DMT_GAS 22
100#define ACPI_DMT_DMAR 23 100#define ACPI_DMT_ASF 23
101#define ACPI_DMT_MADT 24 101#define ACPI_DMT_DMAR 24
102#define ACPI_DMT_SRAT 25 102#define ACPI_DMT_HEST 25
103#define ACPI_DMT_EXIT 26 103#define ACPI_DMT_HESTNTFY 26
104#define ACPI_DMT_SIG 27 104#define ACPI_DMT_HESTNTYP 27
105#define ACPI_DMT_MADT 28
106#define ACPI_DMT_SRAT 29
107#define ACPI_DMT_EXIT 30
108#define ACPI_DMT_SIG 31
105 109
106typedef 110typedef
107void (*ACPI_TABLE_HANDLER) (struct acpi_table_header * table); 111void (*acpi_dmtable_handler) (struct acpi_table_header * table);
108 112
109struct acpi_dmtable_data { 113struct acpi_dmtable_data {
110 char *signature; 114 char *signature;
111 struct acpi_dmtable_info *table_info; 115 struct acpi_dmtable_info *table_info;
112 ACPI_TABLE_HANDLER table_handler; 116 acpi_dmtable_handler table_handler;
113 char *name; 117 char *name;
114}; 118};
115 119
@@ -149,6 +153,7 @@ extern struct acpi_dmtable_info acpi_dm_table_info_asf3[];
149extern struct acpi_dmtable_info acpi_dm_table_info_asf4[]; 153extern struct acpi_dmtable_info acpi_dm_table_info_asf4[];
150extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[]; 154extern struct acpi_dmtable_info acpi_dm_table_info_asf_hdr[];
151extern struct acpi_dmtable_info acpi_dm_table_info_boot[]; 155extern struct acpi_dmtable_info acpi_dm_table_info_boot[];
156extern struct acpi_dmtable_info acpi_dm_table_info_bert[];
152extern struct acpi_dmtable_info acpi_dm_table_info_cpep[]; 157extern struct acpi_dmtable_info acpi_dm_table_info_cpep[];
153extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[]; 158extern struct acpi_dmtable_info acpi_dm_table_info_cpep0[];
154extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[]; 159extern struct acpi_dmtable_info acpi_dm_table_info_dbgp[];
@@ -158,11 +163,17 @@ extern struct acpi_dmtable_info acpi_dm_table_info_dmar_scope[];
158extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[]; 163extern struct acpi_dmtable_info acpi_dm_table_info_dmar0[];
159extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[]; 164extern struct acpi_dmtable_info acpi_dm_table_info_dmar1[];
160extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[]; 165extern struct acpi_dmtable_info acpi_dm_table_info_ecdt[];
166extern struct acpi_dmtable_info acpi_dm_table_info_einj[];
167extern struct acpi_dmtable_info acpi_dm_table_info_einj0[];
168extern struct acpi_dmtable_info acpi_dm_table_info_erst[];
161extern struct acpi_dmtable_info acpi_dm_table_info_facs[]; 169extern struct acpi_dmtable_info acpi_dm_table_info_facs[];
162extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[]; 170extern struct acpi_dmtable_info acpi_dm_table_info_fadt1[];
163extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[]; 171extern struct acpi_dmtable_info acpi_dm_table_info_fadt2[];
164extern struct acpi_dmtable_info acpi_dm_table_info_gas[]; 172extern struct acpi_dmtable_info acpi_dm_table_info_gas[];
165extern struct acpi_dmtable_info acpi_dm_table_info_header[]; 173extern struct acpi_dmtable_info acpi_dm_table_info_header[];
174extern struct acpi_dmtable_info acpi_dm_table_info_hest[];
175extern struct acpi_dmtable_info acpi_dm_table_info_hest9[];
176extern struct acpi_dmtable_info acpi_dm_table_info_hest_notify[];
166extern struct acpi_dmtable_info acpi_dm_table_info_hpet[]; 177extern struct acpi_dmtable_info acpi_dm_table_info_hpet[];
167extern struct acpi_dmtable_info acpi_dm_table_info_madt[]; 178extern struct acpi_dmtable_info acpi_dm_table_info_madt[];
168extern struct acpi_dmtable_info acpi_dm_table_info_madt0[]; 179extern struct acpi_dmtable_info acpi_dm_table_info_madt0[];
@@ -180,6 +191,7 @@ extern struct acpi_dmtable_info acpi_dm_table_info_mcfg0[];
180extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[]; 191extern struct acpi_dmtable_info acpi_dm_table_info_rsdp1[];
181extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[]; 192extern struct acpi_dmtable_info acpi_dm_table_info_rsdp2[];
182extern struct acpi_dmtable_info acpi_dm_table_info_sbst[]; 193extern struct acpi_dmtable_info acpi_dm_table_info_sbst[];
194extern struct acpi_dmtable_info acpi_dm_table_info_slic[];
183extern struct acpi_dmtable_info acpi_dm_table_info_slit[]; 195extern struct acpi_dmtable_info acpi_dm_table_info_slit[];
184extern struct acpi_dmtable_info acpi_dm_table_info_spcr[]; 196extern struct acpi_dmtable_info acpi_dm_table_info_spcr[];
185extern struct acpi_dmtable_info acpi_dm_table_info_spmi[]; 197extern struct acpi_dmtable_info acpi_dm_table_info_spmi[];
@@ -194,7 +206,7 @@ extern struct acpi_dmtable_info acpi_dm_table_info_wdrt[];
194 */ 206 */
195void acpi_dm_dump_data_table(struct acpi_table_header *table); 207void acpi_dm_dump_data_table(struct acpi_table_header *table);
196 208
197void 209acpi_status
198acpi_dm_dump_table(u32 table_length, 210acpi_dm_dump_table(u32 table_length,
199 u32 table_offset, 211 u32 table_offset,
200 void *table, 212 void *table,
@@ -213,9 +225,13 @@ void acpi_dm_dump_cpep(struct acpi_table_header *table);
213 225
214void acpi_dm_dump_dmar(struct acpi_table_header *table); 226void acpi_dm_dump_dmar(struct acpi_table_header *table);
215 227
228void acpi_dm_dump_einj(struct acpi_table_header *table);
229
230void acpi_dm_dump_erst(struct acpi_table_header *table);
231
216void acpi_dm_dump_fadt(struct acpi_table_header *table); 232void acpi_dm_dump_fadt(struct acpi_table_header *table);
217 233
218void acpi_dm_dump_srat(struct acpi_table_header *table); 234void acpi_dm_dump_hest(struct acpi_table_header *table);
219 235
220void acpi_dm_dump_mcfg(struct acpi_table_header *table); 236void acpi_dm_dump_mcfg(struct acpi_table_header *table);
221 237
@@ -227,6 +243,8 @@ void acpi_dm_dump_rsdt(struct acpi_table_header *table);
227 243
228void acpi_dm_dump_slit(struct acpi_table_header *table); 244void acpi_dm_dump_slit(struct acpi_table_header *table);
229 245
246void acpi_dm_dump_srat(struct acpi_table_header *table);
247
230void acpi_dm_dump_xsdt(struct acpi_table_header *table); 248void acpi_dm_dump_xsdt(struct acpi_table_header *table);
231 249
232/* 250/*
diff --git a/include/acpi/acdispat.h b/include/acpi/acdispat.h
index 7f690bb0f02f..910f018d92c7 100644
--- a/include/acpi/acdispat.h
+++ b/include/acpi/acdispat.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -53,6 +53,9 @@
53acpi_status 53acpi_status
54acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc); 54acpi_ds_get_buffer_field_arguments(union acpi_operand_object *obj_desc);
55 55
56acpi_status
57acpi_ds_get_bank_field_arguments(union acpi_operand_object *obj_desc);
58
56acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *rgn_desc); 59acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *rgn_desc);
57 60
58acpi_status acpi_ds_get_buffer_arguments(union acpi_operand_object *obj_desc); 61acpi_status acpi_ds_get_buffer_arguments(union acpi_operand_object *obj_desc);
@@ -68,10 +71,18 @@ acpi_ds_eval_region_operands(struct acpi_walk_state *walk_state,
68 union acpi_parse_object *op); 71 union acpi_parse_object *op);
69 72
70acpi_status 73acpi_status
74acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
75 union acpi_parse_object *op);
76
77acpi_status
71acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state, 78acpi_ds_eval_data_object_operands(struct acpi_walk_state *walk_state,
72 union acpi_parse_object *op, 79 union acpi_parse_object *op,
73 union acpi_operand_object *obj_desc); 80 union acpi_operand_object *obj_desc);
74 81
82acpi_status
83acpi_ds_eval_bank_field_operands(struct acpi_walk_state *walk_state,
84 union acpi_parse_object *op);
85
75acpi_status acpi_ds_initialize_region(acpi_handle obj_handle); 86acpi_status acpi_ds_initialize_region(acpi_handle obj_handle);
76 87
77/* 88/*
@@ -269,6 +280,8 @@ acpi_status acpi_ds_resolve_operands(struct acpi_walk_state *walk_state);
269 280
270void acpi_ds_clear_operands(struct acpi_walk_state *walk_state); 281void acpi_ds_clear_operands(struct acpi_walk_state *walk_state);
271 282
283acpi_status acpi_ds_evaluate_name_path(struct acpi_walk_state *walk_state);
284
272/* 285/*
273 * dswscope - Scope Stack manipulation 286 * dswscope - Scope Stack manipulation
274 */ 287 */
@@ -303,7 +316,7 @@ acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
303 u32 aml_length, 316 u32 aml_length,
304 struct acpi_evaluate_info *info, u8 pass_number); 317 struct acpi_evaluate_info *info, u8 pass_number);
305 318
306acpi_status 319void
307acpi_ds_obj_stack_pop_and_delete(u32 pop_count, 320acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
308 struct acpi_walk_state *walk_state); 321 struct acpi_walk_state *walk_state);
309 322
@@ -316,21 +329,11 @@ void
316acpi_ds_push_walk_state(struct acpi_walk_state *walk_state, 329acpi_ds_push_walk_state(struct acpi_walk_state *walk_state,
317 struct acpi_thread_state *thread); 330 struct acpi_thread_state *thread);
318 331
319acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state);
320
321acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state);
322
323acpi_status acpi_ds_result_stack_clear(struct acpi_walk_state *walk_state); 332acpi_status acpi_ds_result_stack_clear(struct acpi_walk_state *walk_state);
324 333
325struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state 334struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state
326 *thread); 335 *thread);
327 336
328#ifdef ACPI_FUTURE_USAGE
329acpi_status
330acpi_ds_result_remove(union acpi_operand_object **object,
331 u32 index, struct acpi_walk_state *walk_state);
332#endif
333
334acpi_status 337acpi_status
335acpi_ds_result_pop(union acpi_operand_object **object, 338acpi_ds_result_pop(union acpi_operand_object **object,
336 struct acpi_walk_state *walk_state); 339 struct acpi_walk_state *walk_state);
@@ -339,8 +342,4 @@ acpi_status
339acpi_ds_result_push(union acpi_operand_object *object, 342acpi_ds_result_push(union acpi_operand_object *object,
340 struct acpi_walk_state *walk_state); 343 struct acpi_walk_state *walk_state);
341 344
342acpi_status
343acpi_ds_result_pop_from_bottom(union acpi_operand_object **object,
344 struct acpi_walk_state *walk_state);
345
346#endif /* _ACDISPAT_H_ */ 345#endif /* _ACDISPAT_H_ */
diff --git a/include/acpi/acevents.h b/include/acpi/acevents.h
index d23cdf326808..d5d099bf349c 100644
--- a/include/acpi/acevents.h
+++ b/include/acpi/acevents.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h
index b73f18a48785..1f591171bf31 100644
--- a/include/acpi/acexcep.h
+++ b/include/acpi/acexcep.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acglobal.h b/include/acpi/acglobal.h
index 47a1fd8f2d8a..74ad971241db 100644
--- a/include/acpi/acglobal.h
+++ b/include/acpi/acglobal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -170,10 +170,14 @@ ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;
170ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX]; 170ACPI_EXTERN struct acpi_mutex_info acpi_gbl_mutex_info[ACPI_NUM_MUTEX];
171 171
172/* 172/*
173 * Global lock semaphore works in conjunction with the actual HW global lock 173 * Global lock mutex is an actual AML mutex object
174 * Global lock semaphore works in conjunction with the HW global lock
174 */ 175 */
175ACPI_EXTERN acpi_mutex acpi_gbl_global_lock_mutex; 176ACPI_EXTERN union acpi_operand_object *acpi_gbl_global_lock_mutex;
176ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore; 177ACPI_EXTERN acpi_semaphore acpi_gbl_global_lock_semaphore;
178ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
179ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
180ACPI_EXTERN u8 acpi_gbl_global_lock_present;
177 181
178/* 182/*
179 * Spinlocks are used for interfaces that can be possibly called at 183 * Spinlocks are used for interfaces that can be possibly called at
@@ -213,27 +217,33 @@ ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_device_notify;
213ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify; 217ACPI_EXTERN struct acpi_object_notify_handler acpi_gbl_system_notify;
214ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler; 218ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
215ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler; 219ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
220ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler;
221ACPI_EXTERN void *acpi_gbl_table_handler_context;
216ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk; 222ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
217 223
224/* Owner ID support */
225
226ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
227ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
228ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
229
218/* Misc */ 230/* Misc */
219 231
220ACPI_EXTERN u32 acpi_gbl_original_mode; 232ACPI_EXTERN u32 acpi_gbl_original_mode;
221ACPI_EXTERN u32 acpi_gbl_rsdp_original_location; 233ACPI_EXTERN u32 acpi_gbl_rsdp_original_location;
222ACPI_EXTERN u32 acpi_gbl_ns_lookup_count; 234ACPI_EXTERN u32 acpi_gbl_ns_lookup_count;
223ACPI_EXTERN u32 acpi_gbl_ps_find_count; 235ACPI_EXTERN u32 acpi_gbl_ps_find_count;
224ACPI_EXTERN u32 acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS];
225ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save; 236ACPI_EXTERN u16 acpi_gbl_pm1_enable_register_save;
226ACPI_EXTERN u16 acpi_gbl_global_lock_handle;
227ACPI_EXTERN u8 acpi_gbl_last_owner_id_index;
228ACPI_EXTERN u8 acpi_gbl_next_owner_id_offset;
229ACPI_EXTERN u8 acpi_gbl_debugger_configuration; 237ACPI_EXTERN u8 acpi_gbl_debugger_configuration;
230ACPI_EXTERN u8 acpi_gbl_global_lock_acquired;
231ACPI_EXTERN u8 acpi_gbl_step_to_next_call; 238ACPI_EXTERN u8 acpi_gbl_step_to_next_call;
232ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present; 239ACPI_EXTERN u8 acpi_gbl_acpi_hardware_present;
233ACPI_EXTERN u8 acpi_gbl_global_lock_present;
234ACPI_EXTERN u8 acpi_gbl_events_initialized; 240ACPI_EXTERN u8 acpi_gbl_events_initialized;
235ACPI_EXTERN u8 acpi_gbl_system_awake_and_running; 241ACPI_EXTERN u8 acpi_gbl_system_awake_and_running;
236 242
243#ifndef DEFINE_ACPI_GLOBALS
244
245/* Other miscellaneous */
246
237extern u8 acpi_gbl_shutdown; 247extern u8 acpi_gbl_shutdown;
238extern u32 acpi_gbl_startup_flags; 248extern u32 acpi_gbl_startup_flags;
239extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT]; 249extern const char *acpi_gbl_sleep_state_names[ACPI_S_STATE_COUNT];
@@ -241,6 +251,8 @@ extern const char *acpi_gbl_highest_dstate_names[4];
241extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES]; 251extern const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES];
242extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS]; 252extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
243 253
254#endif
255
244/* Exception codes */ 256/* Exception codes */
245 257
246extern char const *acpi_gbl_exception_names_env[]; 258extern char const *acpi_gbl_exception_names_env[];
@@ -255,8 +267,6 @@ extern char const *acpi_gbl_exception_names_ctrl[];
255 * 267 *
256 ****************************************************************************/ 268 ****************************************************************************/
257 269
258#define NUM_NS_TYPES ACPI_TYPE_INVALID+1
259
260#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY) 270#if !defined (ACPI_NO_METHOD_EXECUTION) || defined (ACPI_CONSTANT_EVAL_ONLY)
261#define NUM_PREDEFINED_NAMES 10 271#define NUM_PREDEFINED_NAMES 10
262#else 272#else
@@ -267,7 +277,7 @@ ACPI_EXTERN struct acpi_namespace_node acpi_gbl_root_node_struct;
267ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node; 277ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_root_node;
268ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device; 278ACPI_EXTERN struct acpi_namespace_node *acpi_gbl_fadt_gpe_device;
269 279
270extern const u8 acpi_gbl_ns_properties[NUM_NS_TYPES]; 280extern const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES];
271extern const struct acpi_predefined_names 281extern const struct acpi_predefined_names
272 acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES]; 282 acpi_gbl_pre_defined_names[NUM_PREDEFINED_NAMES];
273 283
@@ -275,8 +285,8 @@ extern const struct acpi_predefined_names
275ACPI_EXTERN u32 acpi_gbl_current_node_count; 285ACPI_EXTERN u32 acpi_gbl_current_node_count;
276ACPI_EXTERN u32 acpi_gbl_current_node_size; 286ACPI_EXTERN u32 acpi_gbl_current_node_size;
277ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count; 287ACPI_EXTERN u32 acpi_gbl_max_concurrent_node_count;
278ACPI_EXTERN acpi_size acpi_gbl_entry_stack_pointer; 288ACPI_EXTERN acpi_size *acpi_gbl_entry_stack_pointer;
279ACPI_EXTERN acpi_size acpi_gbl_lowest_stack_pointer; 289ACPI_EXTERN acpi_size *acpi_gbl_lowest_stack_pointer;
280ACPI_EXTERN u32 acpi_gbl_deepest_nesting; 290ACPI_EXTERN u32 acpi_gbl_deepest_nesting;
281#endif 291#endif
282 292
diff --git a/include/acpi/achware.h b/include/acpi/achware.h
index 4053df943453..d4fb9bbc903c 100644
--- a/include/acpi/achware.h
+++ b/include/acpi/achware.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acinterp.h b/include/acpi/acinterp.h
index ce7c9d653910..e249ce5d3300 100644
--- a/include/acpi/acinterp.h
+++ b/include/acpi/acinterp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -215,8 +215,6 @@ acpi_ex_create_region(u8 * aml_start,
215 u32 aml_length, 215 u32 aml_length,
216 u8 region_space, struct acpi_walk_state *walk_state); 216 u8 region_space, struct acpi_walk_state *walk_state);
217 217
218acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state);
219
220acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state); 218acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state);
221 219
222acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state); 220acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state);
@@ -248,9 +246,16 @@ acpi_ex_acquire_mutex(union acpi_operand_object *time_desc,
248 struct acpi_walk_state *walk_state); 246 struct acpi_walk_state *walk_state);
249 247
250acpi_status 248acpi_status
249acpi_ex_acquire_mutex_object(u16 timeout,
250 union acpi_operand_object *obj_desc,
251 acpi_thread_id thread_id);
252
253acpi_status
251acpi_ex_release_mutex(union acpi_operand_object *obj_desc, 254acpi_ex_release_mutex(union acpi_operand_object *obj_desc,
252 struct acpi_walk_state *walk_state); 255 struct acpi_walk_state *walk_state);
253 256
257acpi_status acpi_ex_release_mutex_object(union acpi_operand_object *obj_desc);
258
254void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread); 259void acpi_ex_release_all_mutexes(struct acpi_thread_state *thread);
255 260
256void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc); 261void acpi_ex_unlink_mutex(union acpi_operand_object *obj_desc);
@@ -455,9 +460,9 @@ void acpi_ex_relinquish_interpreter(void);
455 460
456void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc); 461void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
457 462
458u8 acpi_ex_acquire_global_lock(u32 rule); 463void acpi_ex_acquire_global_lock(u32 rule);
459 464
460void acpi_ex_release_global_lock(u8 locked); 465void acpi_ex_release_global_lock(u32 rule);
461 466
462void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string); 467void acpi_ex_eisa_id_to_string(u32 numeric_id, char *out_string);
463 468
diff --git a/include/acpi/aclocal.h b/include/acpi/aclocal.h
index 202cd4242ba1..c5cdc32ac2f8 100644
--- a/include/acpi/aclocal.h
+++ b/include/acpi/aclocal.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -522,9 +522,8 @@ struct acpi_thread_state {
522 * AML arguments 522 * AML arguments
523 */ 523 */
524struct acpi_result_values { 524struct acpi_result_values {
525 ACPI_STATE_COMMON u8 num_results; 525 ACPI_STATE_COMMON
526 u8 last_insert; 526 union acpi_operand_object *obj_desc[ACPI_RESULTS_FRAME_OBJ_NUM];
527 union acpi_operand_object *obj_desc[ACPI_OBJ_NUM_OPERANDS];
528}; 527};
529 528
530typedef 529typedef
@@ -604,6 +603,7 @@ union acpi_parse_value {
604 union acpi_parse_object *next; /* Next op */\ 603 union acpi_parse_object *next; /* Next op */\
605 struct acpi_namespace_node *node; /* For use by interpreter */\ 604 struct acpi_namespace_node *node; /* For use by interpreter */\
606 union acpi_parse_value value; /* Value or args associated with the opcode */\ 605 union acpi_parse_value value; /* Value or args associated with the opcode */\
606 u8 arg_list_length; /* Number of elements in the arg list */\
607 ACPI_DISASM_ONLY_MEMBERS (\ 607 ACPI_DISASM_ONLY_MEMBERS (\
608 u8 disasm_flags; /* Used during AML disassembly */\ 608 u8 disasm_flags; /* Used during AML disassembly */\
609 u8 disasm_opcode; /* Subtype used for disassembly */\ 609 u8 disasm_opcode; /* Subtype used for disassembly */\
@@ -696,6 +696,8 @@ struct acpi_parse_state {
696#define ACPI_PARSEOP_NAMED 0x02 696#define ACPI_PARSEOP_NAMED 0x02
697#define ACPI_PARSEOP_DEFERRED 0x04 697#define ACPI_PARSEOP_DEFERRED 0x04
698#define ACPI_PARSEOP_BYTELIST 0x08 698#define ACPI_PARSEOP_BYTELIST 0x08
699#define ACPI_PARSEOP_IN_STACK 0x10
700#define ACPI_PARSEOP_TARGET 0x20
699#define ACPI_PARSEOP_IN_CACHE 0x80 701#define ACPI_PARSEOP_IN_CACHE 0x80
700 702
701/* Parse object disasm_flags */ 703/* Parse object disasm_flags */
diff --git a/include/acpi/acmacros.h b/include/acpi/acmacros.h
index 99d171c87c84..fb41a3b802fc 100644
--- a/include/acpi/acmacros.h
+++ b/include/acpi/acmacros.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -61,30 +61,6 @@
61 61
62#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0])) 62#define ACPI_ARRAY_LENGTH(x) (sizeof(x) / sizeof((x)[0]))
63 63
64#ifdef ACPI_NO_INTEGER64_SUPPORT
65/*
66 * acpi_integer is 32-bits, no 64-bit support on this platform
67 */
68#define ACPI_LODWORD(l) ((u32)(l))
69#define ACPI_HIDWORD(l) ((u32)(0))
70
71#else
72
73/*
74 * Full 64-bit address/integer on both 32-bit and 64-bit platforms
75 */
76#define ACPI_LODWORD(l) ((u32)(u64)(l))
77#define ACPI_HIDWORD(l) ((u32)(((*(struct uint64_struct *)(void *)(&l))).hi))
78#endif
79
80/*
81 * printf() format helpers
82 */
83
84/* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */
85
86#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i)
87
88/* 64/*
89 * Extract data using a pointer. Any more than a byte and we 65 * Extract data using a pointer. Any more than a byte and we
90 * get into potential aligment issues -- see the STORE macros below. 66 * get into potential aligment issues -- see the STORE macros below.
@@ -122,6 +98,31 @@
122#endif 98#endif
123 99
124/* 100/*
101 * Full 64-bit integer must be available on both 32-bit and 64-bit platforms
102 */
103struct acpi_integer_overlay {
104 u32 lo_dword;
105 u32 hi_dword;
106};
107
108#define ACPI_LODWORD(integer) (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->lo_dword)
109#define ACPI_HIDWORD(integer) (ACPI_CAST_PTR (struct acpi_integer_overlay, &integer)->hi_dword)
110
111/*
112 * printf() format helpers
113 */
114
115/* Split 64-bit integer into two 32-bit values. Use with %8.8_x%8.8_x */
116
117#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i),ACPI_LODWORD(i)
118
119#if ACPI_MACHINE_WIDTH == 64
120#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
121#else
122#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i)
123#endif
124
125/*
125 * Macros for moving data around to/from buffers that are possibly unaligned. 126 * Macros for moving data around to/from buffers that are possibly unaligned.
126 * If the hardware supports the transfer of unaligned data, just do the store. 127 * If the hardware supports the transfer of unaligned data, just do the store.
127 * Otherwise, we have to move one byte at a time. 128 * Otherwise, we have to move one byte at a time.
@@ -137,29 +138,29 @@
137 138
138/* These macros reverse the bytes during the move, converting little-endian to big endian */ 139/* These macros reverse the bytes during the move, converting little-endian to big endian */
139 140
140 /* Big Endian <== Little Endian */ 141 /* Big Endian <== Little Endian */
141 /* Hi...Lo Lo...Hi */ 142 /* Hi...Lo Lo...Hi */
142/* 16-bit source, 16/32/64 destination */ 143/* 16-bit source, 16/32/64 destination */
143 144
144#define ACPI_MOVE_16_TO_16(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[1];\ 145#define ACPI_MOVE_16_TO_16(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[1];\
145 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[0];} 146 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[0];}
146 147
147#define ACPI_MOVE_16_TO_32(d,s) {(*(u32 *)(void *)(d))=0;\ 148#define ACPI_MOVE_16_TO_32(d,s) {(*(u32 *)(void *)(d))=0;\
148 ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\ 149 ((u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
149 ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];} 150 ((u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
150 151
151#define ACPI_MOVE_16_TO_64(d,s) {(*(u64 *)(void *)(d))=0;\ 152#define ACPI_MOVE_16_TO_64(d,s) {(*(u64 *)(void *)(d))=0;\
152 ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\ 153 ((u8 *)(void *)(d))[6] = ((u8 *)(void *)(s))[1];\
153 ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];} 154 ((u8 *)(void *)(d))[7] = ((u8 *)(void *)(s))[0];}
154 155
155/* 32-bit source, 16/32/64 destination */ 156/* 32-bit source, 16/32/64 destination */
156 157
157#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */ 158#define ACPI_MOVE_32_TO_16(d,s) ACPI_MOVE_16_TO_16(d,s) /* Truncate to 16 */
158 159
159#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\ 160#define ACPI_MOVE_32_TO_32(d,s) {(( u8 *)(void *)(d))[0] = ((u8 *)(void *)(s))[3];\
160 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\ 161 (( u8 *)(void *)(d))[1] = ((u8 *)(void *)(s))[2];\
161 (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\ 162 (( u8 *)(void *)(d))[2] = ((u8 *)(void *)(s))[1];\
162 (( u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];} 163 (( u8 *)(void *)(d))[3] = ((u8 *)(void *)(s))[0];}
163 164
164#define ACPI_MOVE_32_TO_64(d,s) {(*(u64 *)(void *)(d))=0;\ 165#define ACPI_MOVE_32_TO_64(d,s) {(*(u64 *)(void *)(d))=0;\
165 ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[3];\ 166 ((u8 *)(void *)(d))[4] = ((u8 *)(void *)(s))[3];\
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 34bfae8a05f3..c1343a9265fa 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acnamesp.h b/include/acpi/acnamesp.h
index 5ef38a6c8a61..713b30903fe5 100644
--- a/include/acpi/acnamesp.h
+++ b/include/acpi/acnamesp.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -113,7 +113,8 @@ acpi_ns_parse_table(acpi_native_uint table_index,
113 113
114acpi_status 114acpi_status
115acpi_ns_one_complete_parse(acpi_native_uint pass_number, 115acpi_ns_one_complete_parse(acpi_native_uint pass_number,
116 acpi_native_uint table_index); 116 acpi_native_uint table_index,
117 struct acpi_namespace_node *start_node);
117 118
118/* 119/*
119 * nsaccess - Top-level namespace access 120 * nsaccess - Top-level namespace access
diff --git a/include/acpi/acobject.h b/include/acpi/acobject.h
index 7e1211a8b8fa..e9657dac69b7 100644
--- a/include/acpi/acobject.h
+++ b/include/acpi/acobject.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2007, R. Byron Moore 9 * Copyright (C) 2000 - 2008, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -155,8 +155,9 @@ struct acpi_object_event {
155struct acpi_object_mutex { 155struct acpi_object_mutex {
156 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */ 156 ACPI_OBJECT_COMMON_HEADER u8 sync_level; /* 0-15, specified in Mutex() call */
157 u16 acquisition_depth; /* Allow multiple Acquires, same thread */ 157 u16 acquisition_depth; /* Allow multiple Acquires, same thread */
158 struct acpi_thread_state *owner_thread; /* Current owner of the mutex */
159 acpi_mutex os_mutex; /* Actual OS synchronization object */ 158 acpi_mutex os_mutex; /* Actual OS synchronization object */
159 acpi_thread_id thread_id; /* Current owner of the mutex */
160 struct acpi_thread_state *owner_thread; /* Current owner of the mutex */
160 union acpi_operand_object *prev; /* Link for list of acquired mutexes */ 161 union acpi_operand_object *prev; /* Link for list of acquired mutexes */
161 union acpi_operand_object *next; /* Link for list of acquired mutexes */ 162 union acpi_operand_object *next; /* Link for list of acquired mutexes */
162 struct acpi_namespace_node *node; /* Containing namespace node */ 163 struct acpi_namespace_node *node; /* Containing namespace node */
diff --git a/include/acpi/acopcode.h b/include/acpi/acopcode.h
index e6f76a280a94..dfdf63327885 100644
--- a/include/acpi/acopcode.h
+++ b/include/acpi/acopcode.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -233,7 +233,7 @@
233#define ARGI_CREATE_WORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE) 233#define ARGI_CREATE_WORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
234#define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING) 234#define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING)
235#define ARGI_DEBUG_OP ARG_NONE 235#define ARGI_DEBUG_OP ARG_NONE
236#define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF) 236#define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_TARGETREF)
237#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REF_OR_STRING) 237#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REF_OR_STRING)
238#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE 238#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE
239#define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF) 239#define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF)
@@ -246,7 +246,7 @@
246#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF) 246#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
247#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET) 247#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
248#define ARGI_IF_OP ARGI_INVALID_OPCODE 248#define ARGI_IF_OP ARGI_INVALID_OPCODE
249#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_INTEGER_REF) 249#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_TARGETREF)
250#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE 250#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
251#define ARGI_INDEX_OP ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER, ARGI_TARGETREF) 251#define ARGI_INDEX_OP ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER, ARGI_TARGETREF)
252#define ARGI_LAND_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER) 252#define ARGI_LAND_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
diff --git a/include/acpi/acoutput.h b/include/acpi/acoutput.h
index c090a8b0bc99..e17873defcec 100644
--- a/include/acpi/acoutput.h
+++ b/include/acpi/acoutput.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h
index 85c358e21014..23ee0fbf5619 100644
--- a/include/acpi/acparser.h
+++ b/include/acpi/acparser.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -109,6 +109,8 @@ const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode);
109 109
110char *acpi_ps_get_opcode_name(u16 opcode); 110char *acpi_ps_get_opcode_name(u16 opcode);
111 111
112u8 acpi_ps_get_argument_count(u32 op_type);
113
112/* 114/*
113 * psparse - top level parsing routines 115 * psparse - top level parsing routines
114 */ 116 */
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h
index 2e5f00d3ea0d..c515ef6cc89e 100644
--- a/include/acpi/acpi.h
+++ b/include/acpi/acpi.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index 4839f2af94c3..d4a560d2deb6 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -8,7 +8,7 @@
8 *****************************************************************************/ 8 *****************************************************************************/
9 9
10/* 10/*
11 * Copyright (C) 2000 - 2007, R. Byron Moore 11 * Copyright (C) 2000 - 2008, Intel Corp.
12 * All rights reserved. 12 * All rights reserved.
13 * 13 *
14 * Redistribution and use in source and binary forms, with or without 14 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index d970f7f99549..2c3806e6546f 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2007, R. Byron Moore 9 * Copyright (C) 2000 - 2008, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
@@ -119,6 +119,11 @@ acpi_status
119acpi_get_table_by_index(acpi_native_uint table_index, 119acpi_get_table_by_index(acpi_native_uint table_index,
120 struct acpi_table_header **out_table); 120 struct acpi_table_header **out_table);
121 121
122acpi_status
123acpi_install_table_handler(acpi_tbl_handler handler, void *context);
124
125acpi_status acpi_remove_table_handler(acpi_tbl_handler handler);
126
122/* 127/*
123 * Namespace and name interfaces 128 * Namespace and name interfaces
124 */ 129 */
diff --git a/include/acpi/acresrc.h b/include/acpi/acresrc.h
index 9486ab266a5e..eef5bd7a59fa 100644
--- a/include/acpi/acresrc.h
+++ b/include/acpi/acresrc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -94,6 +94,7 @@ typedef const struct acpi_rsconvert_info {
94#define ACPI_RSC_BITMASK16 18 94#define ACPI_RSC_BITMASK16 18
95#define ACPI_RSC_EXIT_NE 19 95#define ACPI_RSC_EXIT_NE 19
96#define ACPI_RSC_EXIT_LE 20 96#define ACPI_RSC_EXIT_LE 20
97#define ACPI_RSC_EXIT_EQ 21
97 98
98/* Resource Conversion sub-opcodes */ 99/* Resource Conversion sub-opcodes */
99 100
diff --git a/include/acpi/acstruct.h b/include/acpi/acstruct.h
index 88482655407f..a907c67d651e 100644
--- a/include/acpi/acstruct.h
+++ b/include/acpi/acstruct.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -80,12 +80,15 @@ struct acpi_walk_state {
80 u16 opcode; /* Current AML opcode */ 80 u16 opcode; /* Current AML opcode */
81 u8 next_op_info; /* Info about next_op */ 81 u8 next_op_info; /* Info about next_op */
82 u8 num_operands; /* Stack pointer for Operands[] array */ 82 u8 num_operands; /* Stack pointer for Operands[] array */
83 u8 operand_index; /* Index into operand stack, to be used by acpi_ds_obj_stack_push */
83 acpi_owner_id owner_id; /* Owner of objects created during the walk */ 84 acpi_owner_id owner_id; /* Owner of objects created during the walk */
84 u8 last_predicate; /* Result of last predicate */ 85 u8 last_predicate; /* Result of last predicate */
85 u8 current_result; 86 u8 current_result;
86 u8 return_used; 87 u8 return_used;
87 u8 scope_depth; 88 u8 scope_depth;
88 u8 pass_number; /* Parse pass during table load */ 89 u8 pass_number; /* Parse pass during table load */
90 u8 result_size; /* Total elements for the result stack */
91 u8 result_count; /* Current number of occupied elements of result stack */
89 u32 aml_offset; 92 u32 aml_offset;
90 u32 arg_types; 93 u32 arg_types;
91 u32 method_breakpoint; /* For single stepping */ 94 u32 method_breakpoint; /* For single stepping */
diff --git a/include/acpi/actables.h b/include/acpi/actables.h
index 2b9f46f9da4d..4b36a55b0b3b 100644
--- a/include/acpi/actables.h
+++ b/include/acpi/actables.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 955adfb8d64c..1ebbe883f786 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index a1b1b2ee3e51..9af239bd1153 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -58,20 +58,28 @@
58 * it more difficult to inadvertently type in the wrong signature. 58 * it more difficult to inadvertently type in the wrong signature.
59 */ 59 */
60#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */ 60#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
61#define ACPI_SIG_BERT "BERT" /* Boot Error Record Table */
61#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */ 62#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
62#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */ 63#define ACPI_SIG_CPEP "CPEP" /* Corrected Platform Error Polling table */
63#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */ 64#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
64#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */ 65#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
65#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */ 66#define ACPI_SIG_ECDT "ECDT" /* Embedded Controller Boot Resources Table */
67#define ACPI_SIG_EINJ "EINJ" /* Error Injection table */
68#define ACPI_SIG_ERST "ERST" /* Error Record Serialization Table */
69#define ACPI_SIG_HEST "HEST" /* Hardware Error Source Table */
66#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */ 70#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
71#define ACPI_SIG_IBFT "IBFT" /* i_sCSI Boot Firmware Table */
67#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */ 72#define ACPI_SIG_MADT "APIC" /* Multiple APIC Description Table */
68#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */ 73#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
69#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */ 74#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
75#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
70#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */ 76#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
71#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */ 77#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
72#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */ 78#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
73#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */ 79#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
74#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */ 80#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
81#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
82#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
75#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */ 83#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
76 84
77/* 85/*
@@ -86,13 +94,25 @@
86 * portable, so do not use any other bitfield types. 94 * portable, so do not use any other bitfield types.
87 */ 95 */
88 96
89/* Common Sub-table header (used in MADT, SRAT, etc.) */ 97/* Common Subtable header (used in MADT, SRAT, etc.) */
90 98
91struct acpi_subtable_header { 99struct acpi_subtable_header {
92 u8 type; 100 u8 type;
93 u8 length; 101 u8 length;
94}; 102};
95 103
104/* Common Subtable header for WHEA tables (EINJ, ERST, WDAT) */
105
106struct acpi_whea_header {
107 u8 action;
108 u8 instruction;
109 u8 flags;
110 u8 reserved;
111 struct acpi_generic_address register_region;
112 u64 value; /* Value used with Read/Write register */
113 u64 mask; /* Bitmask required for this register instruction */
114};
115
96/******************************************************************************* 116/*******************************************************************************
97 * 117 *
98 * ASF - Alert Standard Format table (Signature "ASF!") 118 * ASF - Alert Standard Format table (Signature "ASF!")
@@ -204,6 +224,35 @@ struct acpi_asf_address {
204 224
205/******************************************************************************* 225/*******************************************************************************
206 * 226 *
227 * BERT - Boot Error Record Table
228 *
229 ******************************************************************************/
230
231struct acpi_table_bert {
232 struct acpi_table_header header; /* Common ACPI table header */
233 u32 region_length; /* Length of the boot error region */
234 u64 address; /* Physical addresss of the error region */
235};
236
237/* Boot Error Region */
238
239struct acpi_bert_region {
240 u32 block_status;
241 u32 raw_data_offset;
242 u32 raw_data_length;
243 u32 data_length;
244 u32 error_severity;
245};
246
247/* block_status Flags */
248
249#define ACPI_BERT_UNCORRECTABLE (1)
250#define ACPI_BERT_CORRECTABLE (2)
251#define ACPI_BERT_MULTIPLE_UNCORRECTABLE (4)
252#define ACPI_BERT_MULTIPLE_CORRECTABLE (8)
253
254/*******************************************************************************
255 *
207 * BOOT - Simple Boot Flag Table 256 * BOOT - Simple Boot Flag Table
208 * 257 *
209 ******************************************************************************/ 258 ******************************************************************************/
@@ -350,6 +399,352 @@ struct acpi_table_ecdt {
350 399
351/******************************************************************************* 400/*******************************************************************************
352 * 401 *
402 * EINJ - Error Injection Table
403 *
404 ******************************************************************************/
405
406struct acpi_table_einj {
407 struct acpi_table_header header; /* Common ACPI table header */
408 u32 header_length;
409 u32 reserved;
410 u32 entries;
411};
412
413/* EINJ Injection Instruction Entries (actions) */
414
415struct acpi_einj_entry {
416 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
417};
418
419/* Values for Action field above */
420
421enum acpi_einj_actions {
422 ACPI_EINJ_BEGIN_OPERATION = 0,
423 ACPI_EINJ_GET_TRIGGER_TABLE = 1,
424 ACPI_EINJ_SET_ERROR_TYPE = 2,
425 ACPI_EINJ_GET_ERROR_TYPE = 3,
426 ACPI_EINJ_END_OPERATION = 4,
427 ACPI_EINJ_EXECUTE_OPERATION = 5,
428 ACPI_EINJ_CHECK_BUSY_STATUS = 6,
429 ACPI_EINJ_GET_COMMAND_STATUS = 7,
430 ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */
431 ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
432};
433
434/* Values for Instruction field above */
435
436enum acpi_einj_instructions {
437 ACPI_EINJ_READ_REGISTER = 0,
438 ACPI_EINJ_READ_REGISTER_VALUE = 1,
439 ACPI_EINJ_WRITE_REGISTER = 2,
440 ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
441 ACPI_EINJ_NOOP = 4,
442 ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */
443};
444
445/* EINJ Trigger Error Action Table */
446
447struct acpi_einj_trigger {
448 u32 header_size;
449 u32 revision;
450 u32 table_size;
451 u32 entry_count;
452};
453
454/*******************************************************************************
455 *
456 * ERST - Error Record Serialization Table
457 *
458 ******************************************************************************/
459
460struct acpi_table_erst {
461 struct acpi_table_header header; /* Common ACPI table header */
462 u32 header_length;
463 u32 reserved;
464 u32 entries;
465};
466
467/* ERST Serialization Entries (actions) */
468
469struct acpi_erst_entry {
470 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
471};
472
473/* Values for Action field above */
474
475enum acpi_erst_actions {
476 ACPI_ERST_BEGIN_WRITE_OPERATION = 0,
477 ACPI_ERST_BEGIN_READ_OPERATION = 1,
478 ACPI_ERST_BETGIN_CLEAR_OPERATION = 2,
479 ACPI_ERST_END_OPERATION = 3,
480 ACPI_ERST_SET_RECORD_OFFSET = 4,
481 ACPI_ERST_EXECUTE_OPERATION = 5,
482 ACPI_ERST_CHECK_BUSY_STATUS = 6,
483 ACPI_ERST_GET_COMMAND_STATUS = 7,
484 ACPI_ERST_GET_RECORD_IDENTIFIER = 8,
485 ACPI_ERST_SET_RECORD_IDENTIFIER = 9,
486 ACPI_ERST_GET_RECORD_COUNT = 10,
487 ACPI_ERST_BEGIN_DUMMY_WRIITE = 11,
488 ACPI_ERST_NOT_USED = 12,
489 ACPI_ERST_GET_ERROR_RANGE = 13,
490 ACPI_ERST_GET_ERROR_LENGTH = 14,
491 ACPI_ERST_GET_ERROR_ATTRIBUTES = 15,
492 ACPI_ERST_ACTION_RESERVED = 16 /* 16 and greater are reserved */
493};
494
495/* Values for Instruction field above */
496
497enum acpi_erst_instructions {
498 ACPI_ERST_READ_REGISTER = 0,
499 ACPI_ERST_READ_REGISTER_VALUE = 1,
500 ACPI_ERST_WRITE_REGISTER = 2,
501 ACPI_ERST_WRITE_REGISTER_VALUE = 3,
502 ACPI_ERST_NOOP = 4,
503 ACPI_ERST_LOAD_VAR1 = 5,
504 ACPI_ERST_LOAD_VAR2 = 6,
505 ACPI_ERST_STORE_VAR1 = 7,
506 ACPI_ERST_ADD = 8,
507 ACPI_ERST_SUBTRACT = 9,
508 ACPI_ERST_ADD_VALUE = 10,
509 ACPI_ERST_SUBTRACT_VALUE = 11,
510 ACPI_ERST_STALL = 12,
511 ACPI_ERST_STALL_WHILE_TRUE = 13,
512 ACPI_ERST_SKIP_NEXT_IF_TRUE = 14,
513 ACPI_ERST_GOTO = 15,
514 ACPI_ERST_SET_SRC_ADDRESS_BASE = 16,
515 ACPI_ERST_SET_DST_ADDRESS_BASE = 17,
516 ACPI_ERST_MOVE_DATA = 18,
517 ACPI_ERST_INSTRUCTION_RESERVED = 19 /* 19 and greater are reserved */
518};
519
520/*******************************************************************************
521 *
522 * HEST - Hardware Error Source Table
523 *
524 ******************************************************************************/
525
526struct acpi_table_hest {
527 struct acpi_table_header header; /* Common ACPI table header */
528 u32 error_source_count;
529};
530
531/* HEST subtable header */
532
533struct acpi_hest_header {
534 u16 type;
535};
536
537/* Values for Type field above for subtables */
538
539enum acpi_hest_types {
540 ACPI_HEST_TYPE_XPF_MACHINE_CHECK = 0,
541 ACPI_HEST_TYPE_XPF_CORRECTED_MACHINE_CHECK = 1,
542 ACPI_HEST_TYPE_XPF_UNUSED = 2,
543 ACPI_HEST_TYPE_XPF_NON_MASKABLE_INTERRUPT = 3,
544 ACPI_HEST_TYPE_IPF_CORRECTED_MACHINE_CHECK = 4,
545 ACPI_HEST_TYPE_IPF_CORRECTED_PLATFORM_ERROR = 5,
546 ACPI_HEST_TYPE_AER_ROOT_PORT = 6,
547 ACPI_HEST_TYPE_AER_ENDPOINT = 7,
548 ACPI_HEST_TYPE_AER_BRIDGE = 8,
549 ACPI_HEST_TYPE_GENERIC_HARDWARE_ERROR_SOURCE = 9,
550 ACPI_HEST_TYPE_RESERVED = 10 /* 10 and greater are reserved */
551};
552
553/*
554 * HEST Sub-subtables
555 */
556
557/* XPF Machine Check Error Bank */
558
559struct acpi_hest_xpf_error_bank {
560 u8 bank_number;
561 u8 clear_status_on_init;
562 u8 status_format;
563 u8 config_write_enable;
564 u32 control_register;
565 u64 control_init_data;
566 u32 status_register;
567 u32 address_register;
568 u32 misc_register;
569};
570
571/* Generic Error Status */
572
573struct acpi_hest_generic_status {
574 u32 block_status;
575 u32 raw_data_offset;
576 u32 raw_data_length;
577 u32 data_length;
578 u32 error_severity;
579};
580
581/* Generic Error Data */
582
583struct acpi_hest_generic_data {
584 u8 section_type[16];
585 u32 error_severity;
586 u16 revision;
587 u8 validation_bits;
588 u8 flags;
589 u32 error_data_length;
590 u8 fru_id[16];
591 u8 fru_text[20];
592};
593
594/* Common HEST structure for PCI/AER types below (6,7,8) */
595
596struct acpi_hest_aer_common {
597 u16 source_id;
598 u16 config_write_enable;
599 u8 flags;
600 u8 enabled;
601 u32 records_to_pre_allocate;
602 u32 max_sections_per_record;
603 u32 bus;
604 u16 device;
605 u16 function;
606 u16 device_control;
607 u16 reserved;
608 u32 uncorrectable_error_mask;
609 u32 uncorrectable_error_severity;
610 u32 correctable_error_mask;
611 u32 advanced_error_cababilities;
612};
613
614/* Hardware Error Notification */
615
616struct acpi_hest_notify {
617 u8 type;
618 u8 length;
619 u16 config_write_enable;
620 u32 poll_interval;
621 u32 vector;
622 u32 polling_threshold_value;
623 u32 polling_threshold_window;
624 u32 error_threshold_value;
625 u32 error_threshold_window;
626};
627
628/* Values for Notify Type field above */
629
630enum acpi_hest_notify_types {
631 ACPI_HEST_NOTIFY_POLLED = 0,
632 ACPI_HEST_NOTIFY_EXTERNAL = 1,
633 ACPI_HEST_NOTIFY_LOCAL = 2,
634 ACPI_HEST_NOTIFY_SCI = 3,
635 ACPI_HEST_NOTIFY_NMI = 4,
636 ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */
637};
638
639/*
640 * HEST subtables
641 *
642 * From WHEA Design Document, 16 May 2007.
643 * Note: There is no subtable type 2 in this version of the document,
644 * and there are two different subtable type 3s.
645 */
646
647 /* 0: XPF Machine Check Exception */
648
649struct acpi_hest_xpf_machine_check {
650 struct acpi_hest_header header;
651 u16 source_id;
652 u16 config_write_enable;
653 u8 flags;
654 u8 reserved1;
655 u32 records_to_pre_allocate;
656 u32 max_sections_per_record;
657 u64 global_capability_data;
658 u64 global_control_data;
659 u8 num_hardware_banks;
660 u8 reserved2[7];
661};
662
663/* 1: XPF Corrected Machine Check */
664
665struct acpi_table_hest_xpf_corrected {
666 struct acpi_hest_header header;
667 u16 source_id;
668 u16 config_write_enable;
669 u8 flags;
670 u8 enabled;
671 u32 records_to_pre_allocate;
672 u32 max_sections_per_record;
673 struct acpi_hest_notify notify;
674 u8 num_hardware_banks;
675 u8 reserved[3];
676};
677
678/* 3: XPF Non-Maskable Interrupt */
679
680struct acpi_hest_xpf_nmi {
681 struct acpi_hest_header header;
682 u16 source_id;
683 u32 reserved;
684 u32 records_to_pre_allocate;
685 u32 max_sections_per_record;
686 u32 max_raw_data_length;
687};
688
689/* 4: IPF Corrected Machine Check */
690
691struct acpi_hest_ipf_corrected {
692 struct acpi_hest_header header;
693 u8 enabled;
694 u8 reserved;
695};
696
697/* 5: IPF Corrected Platform Error */
698
699struct acpi_hest_ipf_corrected_platform {
700 struct acpi_hest_header header;
701 u8 enabled;
702 u8 reserved;
703};
704
705/* 6: PCI Express Root Port AER */
706
707struct acpi_hest_aer_root {
708 struct acpi_hest_header header;
709 struct acpi_hest_aer_common aer;
710 u32 root_error_command;
711};
712
713/* 7: PCI Express AER (AER Endpoint) */
714
715struct acpi_hest_aer {
716 struct acpi_hest_header header;
717 struct acpi_hest_aer_common aer;
718};
719
720/* 8: PCI Express/PCI-X Bridge AER */
721
722struct acpi_hest_aer_bridge {
723 struct acpi_hest_header header;
724 struct acpi_hest_aer_common aer;
725 u32 secondary_uncorrectable_error_mask;
726 u32 secondary_uncorrectable_error_severity;
727 u32 secondary_advanced_capabilities;
728};
729
730/* 9: Generic Hardware Error Source */
731
732struct acpi_hest_generic {
733 struct acpi_hest_header header;
734 u16 source_id;
735 u16 related_source_id;
736 u8 config_write_enable;
737 u8 enabled;
738 u32 records_to_pre_allocate;
739 u32 max_sections_per_record;
740 u32 max_raw_data_length;
741 struct acpi_generic_address error_status_address;
742 struct acpi_hest_notify notify;
743 u32 error_status_block_length;
744};
745
746/*******************************************************************************
747 *
353 * HPET - High Precision Event Timer table 748 * HPET - High Precision Event Timer table
354 * 749 *
355 ******************************************************************************/ 750 ******************************************************************************/
@@ -373,6 +768,96 @@ struct acpi_table_hpet {
373 768
374/******************************************************************************* 769/*******************************************************************************
375 * 770 *
771 * IBFT - Boot Firmware Table
772 *
773 ******************************************************************************/
774
775struct acpi_table_ibft {
776 struct acpi_table_header header; /* Common ACPI table header */
777 u8 reserved[12];
778};
779
780/* IBFT common subtable header */
781
782struct acpi_ibft_header {
783 u8 type;
784 u8 version;
785 u16 length;
786 u8 index;
787 u8 flags;
788};
789
790/* Values for Type field above */
791
792enum acpi_ibft_type {
793 ACPI_IBFT_TYPE_NOT_USED = 0,
794 ACPI_IBFT_TYPE_CONTROL = 1,
795 ACPI_IBFT_TYPE_INITIATOR = 2,
796 ACPI_IBFT_TYPE_NIC = 3,
797 ACPI_IBFT_TYPE_TARGET = 4,
798 ACPI_IBFT_TYPE_EXTENSIONS = 5,
799 ACPI_IBFT_TYPE_RESERVED = 6 /* 6 and greater are reserved */
800};
801
802/* IBFT subtables */
803
804struct acpi_ibft_control {
805 struct acpi_ibft_header header;
806 u16 extensions;
807 u16 initiator_offset;
808 u16 nic0_offset;
809 u16 target0_offset;
810 u16 nic1_offset;
811 u16 target1_offset;
812};
813
814struct acpi_ibft_initiator {
815 struct acpi_ibft_header header;
816 u8 sns_server[16];
817 u8 slp_server[16];
818 u8 primary_server[16];
819 u8 secondary_server[16];
820 u16 name_length;
821 u16 name_offset;
822};
823
824struct acpi_ibft_nic {
825 struct acpi_ibft_header header;
826 u8 ip_address[16];
827 u8 subnet_mask_prefix;
828 u8 origin;
829 u8 gateway[16];
830 u8 primary_dns[16];
831 u8 secondary_dns[16];
832 u8 dhcp[16];
833 u16 vlan;
834 u8 mac_address[6];
835 u16 pci_address;
836 u16 name_length;
837 u16 name_offset;
838};
839
840struct acpi_ibft_target {
841 struct acpi_ibft_header header;
842 u8 target_ip_address[16];
843 u16 target_ip_socket;
844 u8 target_boot_lun[8];
845 u8 chap_type;
846 u8 nic_association;
847 u16 target_name_length;
848 u16 target_name_offset;
849 u16 chap_name_length;
850 u16 chap_name_offset;
851 u16 chap_secret_length;
852 u16 chap_secret_offset;
853 u16 reverse_chap_name_length;
854 u16 reverse_chap_name_offset;
855 u16 reverse_chap_secret_length;
856 u16 reverse_chap_secret_offset;
857};
858
859/*******************************************************************************
860 *
376 * MADT - Multiple APIC Description Table 861 * MADT - Multiple APIC Description Table
377 * 862 *
378 ******************************************************************************/ 863 ******************************************************************************/
@@ -697,6 +1182,78 @@ struct acpi_table_tcpa {
697 1182
698/******************************************************************************* 1183/*******************************************************************************
699 * 1184 *
1185 * UEFI - UEFI Boot optimization Table
1186 *
1187 ******************************************************************************/
1188
1189struct acpi_table_uefi {
1190 struct acpi_table_header header; /* Common ACPI table header */
1191 u8 identifier[16]; /* UUID identifier */
1192 u16 data_offset; /* Offset of remaining data in table */
1193 u8 data;
1194};
1195
1196/*******************************************************************************
1197 *
1198 * WDAT - Watchdog Action Table
1199 *
1200 ******************************************************************************/
1201
1202struct acpi_table_wdat {
1203 struct acpi_table_header header; /* Common ACPI table header */
1204 u32 header_length; /* Watchdog Header Length */
1205 u16 pci_segment; /* PCI Segment number */
1206 u8 pci_bus; /* PCI Bus number */
1207 u8 pci_device; /* PCI Device number */
1208 u8 pci_function; /* PCI Function number */
1209 u8 reserved[3];
1210 u32 timer_period; /* Period of one timer count (msec) */
1211 u32 max_count; /* Maximum counter value supported */
1212 u32 min_count; /* Minimum counter value */
1213 u8 flags;
1214 u8 reserved2[3];
1215 u32 entries; /* Number of watchdog entries that follow */
1216};
1217
1218/* WDAT Instruction Entries (actions) */
1219
1220struct acpi_wdat_entry {
1221 struct acpi_whea_header whea_header; /* Common header for WHEA tables */
1222};
1223
1224/* Values for Action field above */
1225
1226enum acpi_wdat_actions {
1227 ACPI_WDAT_RESET = 1,
1228 ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
1229 ACPI_WDAT_GET_COUNTDOWN = 5,
1230 ACPI_WDAT_SET_COUNTDOWN = 6,
1231 ACPI_WDAT_GET_RUNNING_STATE = 8,
1232 ACPI_WDAT_SET_RUNNING_STATE = 9,
1233 ACPI_WDAT_GET_STOPPED_STATE = 10,
1234 ACPI_WDAT_SET_STOPPED_STATE = 11,
1235 ACPI_WDAT_GET_REBOOT = 16,
1236 ACPI_WDAT_SET_REBOOT = 17,
1237 ACPI_WDAT_GET_SHUTDOWN = 18,
1238 ACPI_WDAT_SET_SHUTDOWN = 19,
1239 ACPI_WDAT_GET_STATUS = 32,
1240 ACPI_WDAT_SET_STATUS = 33,
1241 ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
1242};
1243
1244/* Values for Instruction field above */
1245
1246enum acpi_wdat_instructions {
1247 ACPI_WDAT_READ_VALUE = 0,
1248 ACPI_WDAT_READ_COUNTDOWN = 1,
1249 ACPI_WDAT_WRITE_VALUE = 2,
1250 ACPI_WDAT_WRITE_COUNTDOWN = 3,
1251 ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
1252 ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
1253};
1254
1255/*******************************************************************************
1256 *
700 * WDRT - Watchdog Resource Table 1257 * WDRT - Watchdog Resource Table
701 * 1258 *
702 ******************************************************************************/ 1259 ******************************************************************************/
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index e73a38939120..dfea2d440488 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -323,27 +323,11 @@ struct uint32_struct {
323#define acpi_semaphore void * 323#define acpi_semaphore void *
324 324
325/* 325/*
326 * Acpi integer width. In ACPI version 1, integers are 326 * Acpi integer width. In ACPI version 1, integers are 32 bits. In ACPI
327 * 32 bits. In ACPI version 2, integers are 64 bits. 327 * version 2, integers are 64 bits. Note that this pertains to the ACPI integer
328 * Note that this pertains to the ACPI integer type only, not 328 * type only, not other integers used in the implementation of the ACPI CA
329 * other integers used in the implementation of the ACPI CA
330 * subsystem. 329 * subsystem.
331 */ 330 */
332#ifdef ACPI_NO_INTEGER64_SUPPORT
333
334/* 32-bit integers only, no 64-bit support */
335
336typedef u32 acpi_integer;
337#define ACPI_INTEGER_MAX ACPI_UINT32_MAX
338#define ACPI_INTEGER_BIT_SIZE 32
339#define ACPI_MAX_DECIMAL_DIGITS 10 /* 2^32 = 4,294,967,296 */
340
341#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 32-bit divide */
342
343#else
344
345/* 64-bit integers */
346
347typedef unsigned long long acpi_integer; 331typedef unsigned long long acpi_integer;
348#define ACPI_INTEGER_MAX ACPI_UINT64_MAX 332#define ACPI_INTEGER_MAX ACPI_UINT64_MAX
349#define ACPI_INTEGER_BIT_SIZE 64 333#define ACPI_INTEGER_BIT_SIZE 64
@@ -352,7 +336,6 @@ typedef unsigned long long acpi_integer;
352#if ACPI_MACHINE_WIDTH == 64 336#if ACPI_MACHINE_WIDTH == 64
353#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */ 337#define ACPI_USE_NATIVE_DIVIDE /* Use compiler native 64-bit divide */
354#endif 338#endif
355#endif
356 339
357#define ACPI_MAX64_DECIMAL_DIGITS 20 340#define ACPI_MAX64_DECIMAL_DIGITS 20
358#define ACPI_MAX32_DECIMAL_DIGITS 10 341#define ACPI_MAX32_DECIMAL_DIGITS 10
@@ -419,14 +402,20 @@ typedef unsigned long long acpi_integer;
419/* 402/*
420 * Standard notify values 403 * Standard notify values
421 */ 404 */
422#define ACPI_NOTIFY_BUS_CHECK (u8) 0 405#define ACPI_NOTIFY_BUS_CHECK (u8) 0x00
423#define ACPI_NOTIFY_DEVICE_CHECK (u8) 1 406#define ACPI_NOTIFY_DEVICE_CHECK (u8) 0x01
424#define ACPI_NOTIFY_DEVICE_WAKE (u8) 2 407#define ACPI_NOTIFY_DEVICE_WAKE (u8) 0x02
425#define ACPI_NOTIFY_EJECT_REQUEST (u8) 3 408#define ACPI_NOTIFY_EJECT_REQUEST (u8) 0x03
426#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (u8) 4 409#define ACPI_NOTIFY_DEVICE_CHECK_LIGHT (u8) 0x04
427#define ACPI_NOTIFY_FREQUENCY_MISMATCH (u8) 5 410#define ACPI_NOTIFY_FREQUENCY_MISMATCH (u8) 0x05
428#define ACPI_NOTIFY_BUS_MODE_MISMATCH (u8) 6 411#define ACPI_NOTIFY_BUS_MODE_MISMATCH (u8) 0x06
429#define ACPI_NOTIFY_POWER_FAULT (u8) 7 412#define ACPI_NOTIFY_POWER_FAULT (u8) 0x07
413#define ACPI_NOTIFY_CAPABILITIES_CHECK (u8) 0x08
414#define ACPI_NOTIFY_DEVICE_PLD_CHECK (u8) 0x09
415#define ACPI_NOTIFY_RESERVED (u8) 0x0A
416#define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B
417
418#define ACPI_NOTIFY_MAX 0x0B
430 419
431/* 420/*
432 * Types associated with ACPI names and objects. The first group of 421 * Types associated with ACPI names and objects. The first group of
@@ -494,6 +483,8 @@ typedef u32 acpi_object_type;
494#define ACPI_TYPE_INVALID 0x1E 483#define ACPI_TYPE_INVALID 0x1E
495#define ACPI_TYPE_NOT_FOUND 0xFF 484#define ACPI_TYPE_NOT_FOUND 0xFF
496 485
486#define ACPI_NUM_NS_TYPES (ACPI_TYPE_INVALID + 1)
487
497/* 488/*
498 * All I/O 489 * All I/O
499 */ 490 */
@@ -599,7 +590,7 @@ typedef u32 acpi_event_status;
599 590
600#define ACPI_SYSTEM_NOTIFY 0x1 591#define ACPI_SYSTEM_NOTIFY 0x1
601#define ACPI_DEVICE_NOTIFY 0x2 592#define ACPI_DEVICE_NOTIFY 0x2
602#define ACPI_ALL_NOTIFY 0x3 593#define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY)
603#define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3 594#define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3
604 595
605#define ACPI_MAX_SYS_NOTIFY 0x7f 596#define ACPI_MAX_SYS_NOTIFY 0x7f
@@ -654,46 +645,51 @@ typedef u8 acpi_adr_space_type;
654/* 645/*
655 * External ACPI object definition 646 * External ACPI object definition
656 */ 647 */
648
649/*
650 * Note: Type == ACPI_TYPE_ANY (0) is used to indicate a NULL package element
651 * or an unresolved named reference.
652 */
657union acpi_object { 653union acpi_object {
658 acpi_object_type type; /* See definition of acpi_ns_type for values */ 654 acpi_object_type type; /* See definition of acpi_ns_type for values */
659 struct { 655 struct {
660 acpi_object_type type; 656 acpi_object_type type; /* ACPI_TYPE_INTEGER */
661 acpi_integer value; /* The actual number */ 657 acpi_integer value; /* The actual number */
662 } integer; 658 } integer;
663 659
664 struct { 660 struct {
665 acpi_object_type type; 661 acpi_object_type type; /* ACPI_TYPE_STRING */
666 u32 length; /* # of bytes in string, excluding trailing null */ 662 u32 length; /* # of bytes in string, excluding trailing null */
667 char *pointer; /* points to the string value */ 663 char *pointer; /* points to the string value */
668 } string; 664 } string;
669 665
670 struct { 666 struct {
671 acpi_object_type type; 667 acpi_object_type type; /* ACPI_TYPE_BUFFER */
672 u32 length; /* # of bytes in buffer */ 668 u32 length; /* # of bytes in buffer */
673 u8 *pointer; /* points to the buffer */ 669 u8 *pointer; /* points to the buffer */
674 } buffer; 670 } buffer;
675 671
676 struct { 672 struct {
677 acpi_object_type type; 673 acpi_object_type type; /* ACPI_TYPE_PACKAGE */
678 u32 fill1;
679 acpi_handle handle; /* object reference */
680 } reference;
681
682 struct {
683 acpi_object_type type;
684 u32 count; /* # of elements in package */ 674 u32 count; /* # of elements in package */
685 union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */ 675 union acpi_object *elements; /* Pointer to an array of ACPI_OBJECTs */
686 } package; 676 } package;
687 677
688 struct { 678 struct {
689 acpi_object_type type; 679 acpi_object_type type; /* ACPI_TYPE_LOCAL_REFERENCE */
680 acpi_object_type actual_type; /* Type associated with the Handle */
681 acpi_handle handle; /* object reference */
682 } reference;
683
684 struct {
685 acpi_object_type type; /* ACPI_TYPE_PROCESSOR */
690 u32 proc_id; 686 u32 proc_id;
691 acpi_io_address pblk_address; 687 acpi_io_address pblk_address;
692 u32 pblk_length; 688 u32 pblk_length;
693 } processor; 689 } processor;
694 690
695 struct { 691 struct {
696 acpi_object_type type; 692 acpi_object_type type; /* ACPI_TYPE_POWER */
697 u32 system_level; 693 u32 system_level;
698 u32 resource_order; 694 u32 resource_order;
699 } power_resource; 695 } power_resource;
@@ -747,6 +743,12 @@ struct acpi_system_info {
747 u32 debug_layer; 743 u32 debug_layer;
748}; 744};
749 745
746/* Table Event Types */
747
748#define ACPI_TABLE_EVENT_LOAD 0x0
749#define ACPI_TABLE_EVENT_UNLOAD 0x1
750#define ACPI_NUM_TABLE_EVENTS 2
751
750/* 752/*
751 * Types specific to the OS service interfaces 753 * Types specific to the OS service interfaces
752 */ 754 */
@@ -776,6 +778,11 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status,
776 u16 opcode, 778 u16 opcode,
777 u32 aml_offset, void *context); 779 u32 aml_offset, void *context);
778 780
781/* Table Event handler (Load, load_table etc) and types */
782
783typedef
784acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context);
785
779/* Address Spaces (For Operation Regions) */ 786/* Address Spaces (For Operation Regions) */
780 787
781typedef 788typedef
@@ -990,6 +997,7 @@ struct acpi_vendor_uuid {
990 * Structures used to describe device resources 997 * Structures used to describe device resources
991 */ 998 */
992struct acpi_resource_irq { 999struct acpi_resource_irq {
1000 u8 descriptor_length;
993 u8 triggering; 1001 u8 triggering;
994 u8 polarity; 1002 u8 polarity;
995 u8 sharable; 1003 u8 sharable;
@@ -1006,6 +1014,7 @@ struct acpi_resource_dma {
1006}; 1014};
1007 1015
1008struct acpi_resource_start_dependent { 1016struct acpi_resource_start_dependent {
1017 u8 descriptor_length;
1009 u8 compatibility_priority; 1018 u8 compatibility_priority;
1010 u8 performance_robustness; 1019 u8 performance_robustness;
1011}; 1020};
diff --git a/include/acpi/acutils.h b/include/acpi/acutils.h
index a2918547c73f..b42cadf07302 100644
--- a/include/acpi/acutils.h
+++ b/include/acpi/acutils.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
@@ -116,6 +116,8 @@ void acpi_ut_init_globals(void);
116 116
117char *acpi_ut_get_mutex_name(u32 mutex_id); 117char *acpi_ut_get_mutex_name(u32 mutex_id);
118 118
119const char *acpi_ut_get_notify_name(u32 notify_value);
120
119#endif 121#endif
120 122
121char *acpi_ut_get_type_name(acpi_object_type type); 123char *acpi_ut_get_type_name(acpi_object_type type);
diff --git a/include/acpi/amlcode.h b/include/acpi/amlcode.h
index da53a4ef287a..ff851c5df698 100644
--- a/include/acpi/amlcode.h
+++ b/include/acpi/amlcode.h
@@ -7,7 +7,7 @@
7 *****************************************************************************/ 7 *****************************************************************************/
8 8
9/* 9/*
10 * Copyright (C) 2000 - 2007, R. Byron Moore 10 * Copyright (C) 2000 - 2008, Intel Corp.
11 * All rights reserved. 11 * All rights reserved.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/amlresrc.h b/include/acpi/amlresrc.h
index f7d541239da4..7b070e42b7c5 100644
--- a/include/acpi/amlresrc.h
+++ b/include/acpi/amlresrc.h
@@ -6,7 +6,7 @@
6 *****************************************************************************/ 6 *****************************************************************************/
7 7
8/* 8/*
9 * Copyright (C) 2000 - 2007, R. Byron Moore 9 * Copyright (C) 2000 - 2008, Intel Corp.
10 * All rights reserved. 10 * All rights reserved.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index c785485e62a6..fcd2572e428c 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h
index 3bb50494a38a..8996dba90cd9 100644
--- a/include/acpi/platform/acgcc.h
+++ b/include/acpi/platform/acgcc.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 6ed15a0978eb..9af464598682 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -5,7 +5,7 @@
5 *****************************************************************************/ 5 *****************************************************************************/
6 6
7/* 7/*
8 * Copyright (C) 2000 - 2007, R. Byron Moore 8 * Copyright (C) 2000 - 2008, Intel Corp.
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index 1e8728a9ee8a..cd5a269fdb5e 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -26,16 +26,6 @@
26#include <linux/pnp.h> 26#include <linux/pnp.h>
27 27
28/* 28/*
29 * Configuration registers (TODO: change by specification)
30 */
31
32#define ISAPNP_CFG_ACTIVATE 0x30 /* byte */
33#define ISAPNP_CFG_MEM 0x40 /* 4 * dword */
34#define ISAPNP_CFG_PORT 0x60 /* 8 * word */
35#define ISAPNP_CFG_IRQ 0x70 /* 2 * word */
36#define ISAPNP_CFG_DMA 0x74 /* 2 * byte */
37
38/*
39 * 29 *
40 */ 30 */
41 31
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 2f3bcf73052c..63b128d512fb 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -11,59 +11,122 @@
11#include <linux/errno.h> 11#include <linux/errno.h>
12#include <linux/mod_devicetable.h> 12#include <linux/mod_devicetable.h>
13 13
14#define PNP_MAX_PORT 40
15#define PNP_MAX_MEM 24
16#define PNP_MAX_IRQ 2
17#define PNP_MAX_DMA 2
18#define PNP_NAME_LEN 50 14#define PNP_NAME_LEN 50
19 15
20struct pnp_protocol; 16struct pnp_protocol;
21struct pnp_dev; 17struct pnp_dev;
18struct pnp_resource_table;
22 19
23/* 20/*
24 * Resource Management 21 * Resource Management
25 */ 22 */
23struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int);
24
25static inline int pnp_resource_valid(struct resource *res)
26{
27 if (res && !(res->flags & IORESOURCE_UNSET))
28 return 1;
29 return 0;
30}
31
32static inline resource_size_t pnp_resource_len(struct resource *res)
33{
34 if (res->start == 0 && res->end == 0)
35 return 0;
36 return res->end - res->start + 1;
37}
38
39
40static inline resource_size_t pnp_port_start(struct pnp_dev *dev,
41 unsigned int bar)
42{
43 return pnp_get_resource(dev, IORESOURCE_IO, bar)->start;
44}
45
46static inline resource_size_t pnp_port_end(struct pnp_dev *dev,
47 unsigned int bar)
48{
49 return pnp_get_resource(dev, IORESOURCE_IO, bar)->end;
50}
51
52static inline unsigned long pnp_port_flags(struct pnp_dev *dev,
53 unsigned int bar)
54{
55 return pnp_get_resource(dev, IORESOURCE_IO, bar)->flags;
56}
57
58static inline int pnp_port_valid(struct pnp_dev *dev, unsigned int bar)
59{
60 return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_IO, bar));
61}
62
63static inline resource_size_t pnp_port_len(struct pnp_dev *dev,
64 unsigned int bar)
65{
66 return pnp_resource_len(pnp_get_resource(dev, IORESOURCE_IO, bar));
67}
68
69
70static inline resource_size_t pnp_mem_start(struct pnp_dev *dev,
71 unsigned int bar)
72{
73 return pnp_get_resource(dev, IORESOURCE_MEM, bar)->start;
74}
75
76static inline resource_size_t pnp_mem_end(struct pnp_dev *dev,
77 unsigned int bar)
78{
79 return pnp_get_resource(dev, IORESOURCE_MEM, bar)->end;
80}
81
82static inline unsigned long pnp_mem_flags(struct pnp_dev *dev, unsigned int bar)
83{
84 return pnp_get_resource(dev, IORESOURCE_MEM, bar)->flags;
85}
86
87static inline int pnp_mem_valid(struct pnp_dev *dev, unsigned int bar)
88{
89 return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_MEM, bar));
90}
91
92static inline resource_size_t pnp_mem_len(struct pnp_dev *dev,
93 unsigned int bar)
94{
95 return pnp_resource_len(pnp_get_resource(dev, IORESOURCE_MEM, bar));
96}
97
98
99static inline resource_size_t pnp_irq(struct pnp_dev *dev, unsigned int bar)
100{
101 return pnp_get_resource(dev, IORESOURCE_IRQ, bar)->start;
102}
103
104static inline unsigned long pnp_irq_flags(struct pnp_dev *dev, unsigned int bar)
105{
106 return pnp_get_resource(dev, IORESOURCE_IRQ, bar)->flags;
107}
108
109static inline int pnp_irq_valid(struct pnp_dev *dev, unsigned int bar)
110{
111 return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_IRQ, bar));
112}
113
114
115static inline resource_size_t pnp_dma(struct pnp_dev *dev, unsigned int bar)
116{
117 return pnp_get_resource(dev, IORESOURCE_DMA, bar)->start;
118}
119
120static inline unsigned long pnp_dma_flags(struct pnp_dev *dev, unsigned int bar)
121{
122 return pnp_get_resource(dev, IORESOURCE_DMA, bar)->flags;
123}
124
125static inline int pnp_dma_valid(struct pnp_dev *dev, unsigned int bar)
126{
127 return pnp_resource_valid(pnp_get_resource(dev, IORESOURCE_DMA, bar));
128}
26 129
27/* Use these instead of directly reading pnp_dev to get resource information */
28#define pnp_port_start(dev,bar) ((dev)->res.port_resource[(bar)].start)
29#define pnp_port_end(dev,bar) ((dev)->res.port_resource[(bar)].end)
30#define pnp_port_flags(dev,bar) ((dev)->res.port_resource[(bar)].flags)
31#define pnp_port_valid(dev,bar) \
32 ((pnp_port_flags((dev),(bar)) & (IORESOURCE_IO | IORESOURCE_UNSET)) \
33 == IORESOURCE_IO)
34#define pnp_port_len(dev,bar) \
35 ((pnp_port_start((dev),(bar)) == 0 && \
36 pnp_port_end((dev),(bar)) == \
37 pnp_port_start((dev),(bar))) ? 0 : \
38 \
39 (pnp_port_end((dev),(bar)) - \
40 pnp_port_start((dev),(bar)) + 1))
41
42#define pnp_mem_start(dev,bar) ((dev)->res.mem_resource[(bar)].start)
43#define pnp_mem_end(dev,bar) ((dev)->res.mem_resource[(bar)].end)
44#define pnp_mem_flags(dev,bar) ((dev)->res.mem_resource[(bar)].flags)
45#define pnp_mem_valid(dev,bar) \
46 ((pnp_mem_flags((dev),(bar)) & (IORESOURCE_MEM | IORESOURCE_UNSET)) \
47 == IORESOURCE_MEM)
48#define pnp_mem_len(dev,bar) \
49 ((pnp_mem_start((dev),(bar)) == 0 && \
50 pnp_mem_end((dev),(bar)) == \
51 pnp_mem_start((dev),(bar))) ? 0 : \
52 \
53 (pnp_mem_end((dev),(bar)) - \
54 pnp_mem_start((dev),(bar)) + 1))
55
56#define pnp_irq(dev,bar) ((dev)->res.irq_resource[(bar)].start)
57#define pnp_irq_flags(dev,bar) ((dev)->res.irq_resource[(bar)].flags)
58#define pnp_irq_valid(dev,bar) \
59 ((pnp_irq_flags((dev),(bar)) & (IORESOURCE_IRQ | IORESOURCE_UNSET)) \
60 == IORESOURCE_IRQ)
61
62#define pnp_dma(dev,bar) ((dev)->res.dma_resource[(bar)].start)
63#define pnp_dma_flags(dev,bar) ((dev)->res.dma_resource[(bar)].flags)
64#define pnp_dma_valid(dev,bar) \
65 ((pnp_dma_flags((dev),(bar)) & (IORESOURCE_DMA | IORESOURCE_UNSET)) \
66 == IORESOURCE_DMA)
67 130
68#define PNP_PORT_FLAG_16BITADDR (1<<0) 131#define PNP_PORT_FLAG_16BITADDR (1<<0)
69#define PNP_PORT_FLAG_FIXED (1<<1) 132#define PNP_PORT_FLAG_FIXED (1<<1)
@@ -116,13 +179,6 @@ struct pnp_option {
116 struct pnp_option *next; /* used to chain dependent resources */ 179 struct pnp_option *next; /* used to chain dependent resources */
117}; 180};
118 181
119struct pnp_resource_table {
120 struct resource port_resource[PNP_MAX_PORT];
121 struct resource mem_resource[PNP_MAX_MEM];
122 struct resource dma_resource[PNP_MAX_DMA];
123 struct resource irq_resource[PNP_MAX_IRQ];
124};
125
126/* 182/*
127 * Device Management 183 * Device Management
128 */ 184 */
@@ -192,10 +248,9 @@ struct pnp_dev {
192 int capabilities; 248 int capabilities;
193 struct pnp_option *independent; 249 struct pnp_option *independent;
194 struct pnp_option *dependent; 250 struct pnp_option *dependent;
195 struct pnp_resource_table res; 251 struct pnp_resource_table *res;
196 252
197 char name[PNP_NAME_LEN]; /* contains a human-readable name */ 253 char name[PNP_NAME_LEN]; /* contains a human-readable name */
198 unsigned short regs; /* ISAPnP: supported registers */
199 int flags; /* used by protocols */ 254 int flags; /* used by protocols */
200 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */ 255 struct proc_dir_entry *procent; /* device entry in /proc/bus/isapnp */
201 void *data; 256 void *data;
@@ -326,8 +381,8 @@ struct pnp_protocol {
326 char *name; 381 char *name;
327 382
328 /* resource control functions */ 383 /* resource control functions */
329 int (*get) (struct pnp_dev *dev, struct pnp_resource_table *res); 384 int (*get) (struct pnp_dev *dev);
330 int (*set) (struct pnp_dev *dev, struct pnp_resource_table *res); 385 int (*set) (struct pnp_dev *dev);
331 int (*disable) (struct pnp_dev *dev); 386 int (*disable) (struct pnp_dev *dev);
332 387
333 /* protocol specific suspend/resume */ 388 /* protocol specific suspend/resume */
@@ -356,20 +411,12 @@ extern struct bus_type pnp_bus_type;
356#if defined(CONFIG_PNP) 411#if defined(CONFIG_PNP)
357 412
358/* device management */ 413/* device management */
359int pnp_register_protocol(struct pnp_protocol *protocol);
360void pnp_unregister_protocol(struct pnp_protocol *protocol);
361int pnp_add_device(struct pnp_dev *dev);
362int pnp_device_attach(struct pnp_dev *pnp_dev); 414int pnp_device_attach(struct pnp_dev *pnp_dev);
363void pnp_device_detach(struct pnp_dev *pnp_dev); 415void pnp_device_detach(struct pnp_dev *pnp_dev);
364extern struct list_head pnp_global; 416extern struct list_head pnp_global;
365extern int pnp_platform_devices; 417extern int pnp_platform_devices;
366 418
367/* multidevice card support */ 419/* multidevice card support */
368int pnp_add_card(struct pnp_card *card);
369void pnp_remove_card(struct pnp_card *card);
370int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev);
371void pnp_remove_card_device(struct pnp_dev *dev);
372int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card);
373struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, 420struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink,
374 const char *id, struct pnp_dev *from); 421 const char *id, struct pnp_dev *from);
375void pnp_release_card_device(struct pnp_dev *dev); 422void pnp_release_card_device(struct pnp_dev *dev);
@@ -378,77 +425,42 @@ void pnp_unregister_card_driver(struct pnp_card_driver *drv);
378extern struct list_head pnp_cards; 425extern struct list_head pnp_cards;
379 426
380/* resource management */ 427/* resource management */
381struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev);
382struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev,
383 int priority);
384int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data);
385int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data);
386int pnp_register_port_resource(struct pnp_option *option,
387 struct pnp_port *data);
388int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data);
389void pnp_init_resource_table(struct pnp_resource_table *table);
390int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res,
391 int mode);
392int pnp_auto_config_dev(struct pnp_dev *dev); 428int pnp_auto_config_dev(struct pnp_dev *dev);
393int pnp_validate_config(struct pnp_dev *dev);
394int pnp_start_dev(struct pnp_dev *dev); 429int pnp_start_dev(struct pnp_dev *dev);
395int pnp_stop_dev(struct pnp_dev *dev); 430int pnp_stop_dev(struct pnp_dev *dev);
396int pnp_activate_dev(struct pnp_dev *dev); 431int pnp_activate_dev(struct pnp_dev *dev);
397int pnp_disable_dev(struct pnp_dev *dev); 432int pnp_disable_dev(struct pnp_dev *dev);
398void pnp_resource_change(struct resource *resource, resource_size_t start,
399 resource_size_t size);
400 433
401/* protocol helpers */ 434/* protocol helpers */
402int pnp_is_active(struct pnp_dev *dev); 435int pnp_is_active(struct pnp_dev *dev);
403int compare_pnp_id(struct pnp_id *pos, const char *id); 436int compare_pnp_id(struct pnp_id *pos, const char *id);
404int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev);
405int pnp_register_driver(struct pnp_driver *drv); 437int pnp_register_driver(struct pnp_driver *drv);
406void pnp_unregister_driver(struct pnp_driver *drv); 438void pnp_unregister_driver(struct pnp_driver *drv);
407 439
408#else 440#else
409 441
410/* device management */ 442/* device management */
411static inline int pnp_register_protocol(struct pnp_protocol *protocol) { return -ENODEV; }
412static inline void pnp_unregister_protocol(struct pnp_protocol *protocol) { }
413static inline int pnp_init_device(struct pnp_dev *dev) { return -ENODEV; }
414static inline int pnp_add_device(struct pnp_dev *dev) { return -ENODEV; }
415static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; } 443static inline int pnp_device_attach(struct pnp_dev *pnp_dev) { return -ENODEV; }
416static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { } 444static inline void pnp_device_detach(struct pnp_dev *pnp_dev) { }
417 445
418#define pnp_platform_devices 0 446#define pnp_platform_devices 0
419 447
420/* multidevice card support */ 448/* multidevice card support */
421static inline int pnp_add_card(struct pnp_card *card) { return -ENODEV; }
422static inline void pnp_remove_card(struct pnp_card *card) { }
423static inline int pnp_add_card_device(struct pnp_card *card, struct pnp_dev *dev) { return -ENODEV; }
424static inline void pnp_remove_card_device(struct pnp_dev *dev) { }
425static inline int pnp_add_card_id(struct pnp_id *id, struct pnp_card *card) { return -ENODEV; }
426static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; } 449static inline struct pnp_dev *pnp_request_card_device(struct pnp_card_link *clink, const char *id, struct pnp_dev *from) { return NULL; }
427static inline void pnp_release_card_device(struct pnp_dev *dev) { } 450static inline void pnp_release_card_device(struct pnp_dev *dev) { }
428static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; } 451static inline int pnp_register_card_driver(struct pnp_card_driver *drv) { return -ENODEV; }
429static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { } 452static inline void pnp_unregister_card_driver(struct pnp_card_driver *drv) { }
430 453
431/* resource management */ 454/* resource management */
432static inline struct pnp_option *pnp_register_independent_option(struct pnp_dev *dev) { return NULL; }
433static inline struct pnp_option *pnp_register_dependent_option(struct pnp_dev *dev, int priority) { return NULL; }
434static inline int pnp_register_irq_resource(struct pnp_option *option, struct pnp_irq *data) { return -ENODEV; }
435static inline int pnp_register_dma_resource(struct pnp_option *option, struct pnp_dma *data) { return -ENODEV; }
436static inline int pnp_register_port_resource(struct pnp_option *option, struct pnp_port *data) { return -ENODEV; }
437static inline int pnp_register_mem_resource(struct pnp_option *option, struct pnp_mem *data) { return -ENODEV; }
438static inline void pnp_init_resource_table(struct pnp_resource_table *table) { }
439static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; }
440static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } 455static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
441static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; }
442static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } 456static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
443static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } 457static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
444static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 458static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
445static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 459static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
446static inline void pnp_resource_change(struct resource *resource, resource_size_t start, resource_size_t size) { }
447 460
448/* protocol helpers */ 461/* protocol helpers */
449static inline int pnp_is_active(struct pnp_dev *dev) { return 0; } 462static inline int pnp_is_active(struct pnp_dev *dev) { return 0; }
450static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; } 463static inline int compare_pnp_id(struct pnp_id *pos, const char *id) { return -ENODEV; }
451static inline int pnp_add_id(struct pnp_id *id, struct pnp_dev *dev) { return -ENODEV; }
452static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; } 464static inline int pnp_register_driver(struct pnp_driver *drv) { return -ENODEV; }
453static inline void pnp_unregister_driver(struct pnp_driver *drv) { } 465static inline void pnp_unregister_driver(struct pnp_driver *drv) { }
454 466
diff --git a/include/linux/pnpbios.h b/include/linux/pnpbios.h
deleted file mode 100644
index 329192adc9dd..000000000000
--- a/include/linux/pnpbios.h
+++ /dev/null
@@ -1,151 +0,0 @@
1/*
2 * Include file for the interface to a PnP BIOS
3 *
4 * Original BIOS code (C) 1998 Christian Schmidt (chr.schmidt@tu-bs.de)
5 * PnP handler parts (c) 1998 Tom Lees <tom@lpsg.demon.co.uk>
6 * Minor reorganizations by David Hinds <dahinds@users.sourceforge.net>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2, or (at your option) any
11 * later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef _LINUX_PNPBIOS_H
24#define _LINUX_PNPBIOS_H
25
26#ifdef __KERNEL__
27
28#include <linux/types.h>
29#include <linux/pnp.h>
30
31/*
32 * Return codes
33 */
34#define PNP_SUCCESS 0x00
35#define PNP_NOT_SET_STATICALLY 0x7f
36#define PNP_UNKNOWN_FUNCTION 0x81
37#define PNP_FUNCTION_NOT_SUPPORTED 0x82
38#define PNP_INVALID_HANDLE 0x83
39#define PNP_BAD_PARAMETER 0x84
40#define PNP_SET_FAILED 0x85
41#define PNP_EVENTS_NOT_PENDING 0x86
42#define PNP_SYSTEM_NOT_DOCKED 0x87
43#define PNP_NO_ISA_PNP_CARDS 0x88
44#define PNP_UNABLE_TO_DETERMINE_DOCK_CAPABILITIES 0x89
45#define PNP_CONFIG_CHANGE_FAILED_NO_BATTERY 0x8a
46#define PNP_CONFIG_CHANGE_FAILED_RESOURCE_CONFLICT 0x8b
47#define PNP_BUFFER_TOO_SMALL 0x8c
48#define PNP_USE_ESCD_SUPPORT 0x8d
49#define PNP_MESSAGE_NOT_SUPPORTED 0x8e
50#define PNP_HARDWARE_ERROR 0x8f
51
52#define ESCD_SUCCESS 0x00
53#define ESCD_IO_ERROR_READING 0x55
54#define ESCD_INVALID 0x56
55#define ESCD_BUFFER_TOO_SMALL 0x59
56#define ESCD_NVRAM_TOO_SMALL 0x5a
57#define ESCD_FUNCTION_NOT_SUPPORTED 0x81
58
59/*
60 * Events that can be received by "get event"
61 */
62#define PNPEV_ABOUT_TO_CHANGE_CONFIG 0x0001
63#define PNPEV_DOCK_CHANGED 0x0002
64#define PNPEV_SYSTEM_DEVICE_CHANGED 0x0003
65#define PNPEV_CONFIG_CHANGED_FAILED 0x0004
66#define PNPEV_UNKNOWN_SYSTEM_EVENT 0xffff
67/* 0x8000 through 0xfffe are OEM defined */
68
69/*
70 * Messages that should be sent through "send message"
71 */
72#define PNPMSG_OK 0x00
73#define PNPMSG_ABORT 0x01
74#define PNPMSG_UNDOCK_DEFAULT_ACTION 0x40
75#define PNPMSG_POWER_OFF 0x41
76#define PNPMSG_PNP_OS_ACTIVE 0x42
77#define PNPMSG_PNP_OS_INACTIVE 0x43
78
79/*
80 * Plug and Play BIOS flags
81 */
82#define PNPBIOS_NO_DISABLE 0x0001
83#define PNPBIOS_NO_CONFIG 0x0002
84#define PNPBIOS_OUTPUT 0x0004
85#define PNPBIOS_INPUT 0x0008
86#define PNPBIOS_BOOTABLE 0x0010
87#define PNPBIOS_DOCK 0x0020
88#define PNPBIOS_REMOVABLE 0x0040
89#define pnpbios_is_static(x) (((x)->flags & 0x0100) == 0x0000)
90#define pnpbios_is_dynamic(x) ((x)->flags & 0x0080)
91
92/*
93 * Function Parameters
94 */
95#define PNPMODE_STATIC 1
96#define PNPMODE_DYNAMIC 0
97
98/* 0x8000 through 0xffff are OEM defined */
99
100#pragma pack(1)
101struct pnp_dev_node_info {
102 __u16 no_nodes;
103 __u16 max_node_size;
104};
105struct pnp_docking_station_info {
106 __u32 location_id;
107 __u32 serial;
108 __u16 capabilities;
109};
110struct pnp_isa_config_struc {
111 __u8 revision;
112 __u8 no_csns;
113 __u16 isa_rd_data_port;
114 __u16 reserved;
115};
116struct escd_info_struc {
117 __u16 min_escd_write_size;
118 __u16 escd_size;
119 __u32 nv_storage_base;
120};
121struct pnp_bios_node {
122 __u16 size;
123 __u8 handle;
124 __u32 eisa_id;
125 __u8 type_code[3];
126 __u16 flags;
127 __u8 data[0];
128};
129#pragma pack()
130
131#ifdef CONFIG_PNPBIOS
132
133/* non-exported */
134extern struct pnp_dev_node_info node_info;
135
136extern int pnp_bios_dev_node_info(struct pnp_dev_node_info *data);
137extern int pnp_bios_get_dev_node(u8 *nodenum, char config,
138 struct pnp_bios_node *data);
139extern int pnp_bios_set_dev_node(u8 nodenum, char config,
140 struct pnp_bios_node *data);
141extern int pnp_bios_get_stat_res(char *info);
142extern int pnp_bios_isapnp_config(struct pnp_isa_config_struc *data);
143extern int pnp_bios_escd_info(struct escd_info_struc *data);
144extern int pnp_bios_read_escd(char *data, u32 nvram_base);
145extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data);
146
147#endif /* CONFIG_PNPBIOS */
148
149#endif /* __KERNEL__ */
150
151#endif /* _LINUX_PNPBIOS_H */
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index 90c1c191ea69..06d3e6eb9ca8 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -41,6 +41,7 @@ struct thermal_zone_device_ops {
41 int (*set_mode) (struct thermal_zone_device *, const char *); 41 int (*set_mode) (struct thermal_zone_device *, const char *);
42 int (*get_trip_type) (struct thermal_zone_device *, int, char *); 42 int (*get_trip_type) (struct thermal_zone_device *, int, char *);
43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *); 43 int (*get_trip_temp) (struct thermal_zone_device *, int, char *);
44 int (*get_crit_temp) (struct thermal_zone_device *, unsigned long *);
44}; 45};
45 46
46struct thermal_cooling_device_ops { 47struct thermal_cooling_device_ops {
@@ -65,6 +66,23 @@ struct thermal_cooling_device {
65 ((long)t-2732+5)/10 : ((long)t-2732-5)/10) 66 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
66#define CELSIUS_TO_KELVIN(t) ((t)*10+2732) 67#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
67 68
69#if defined(CONFIG_HWMON) || \
70 (defined(CONFIG_HWMON_MODULE) && defined(CONFIG_THERMAL_MODULE))
71/* thermal zone devices with the same type share one hwmon device */
72struct thermal_hwmon_device {
73 char type[THERMAL_NAME_LENGTH];
74 struct device *device;
75 int count;
76 struct list_head tz_list;
77 struct list_head node;
78};
79
80struct thermal_hwmon_attr {
81 struct device_attribute attr;
82 char name[16];
83};
84#endif
85
68struct thermal_zone_device { 86struct thermal_zone_device {
69 int id; 87 int id;
70 char type[THERMAL_NAME_LENGTH]; 88 char type[THERMAL_NAME_LENGTH];
@@ -76,6 +94,13 @@ struct thermal_zone_device {
76 struct idr idr; 94 struct idr idr;
77 struct mutex lock; /* protect cooling devices list */ 95 struct mutex lock; /* protect cooling devices list */
78 struct list_head node; 96 struct list_head node;
97#if defined(CONFIG_HWMON) || \
98 (defined(CONFIG_HWMON_MODULE) && defined(CONFIG_THERMAL_MODULE))
99 struct list_head hwmon_node;
100 struct thermal_hwmon_device *hwmon;
101 struct thermal_hwmon_attr temp_input; /* hwmon sys attr */
102 struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */
103#endif
79}; 104};
80 105
81struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, 106struct thermal_zone_device *thermal_zone_device_register(char *, int, void *,
@@ -88,24 +113,10 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int,
88 struct thermal_cooling_device *); 113 struct thermal_cooling_device *);
89int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, 114int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int,
90 struct thermal_cooling_device *); 115 struct thermal_cooling_device *);
91
92#ifdef CONFIG_THERMAL
93struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, 116struct thermal_cooling_device *thermal_cooling_device_register(char *, void *,
94 struct 117 struct
95 thermal_cooling_device_ops 118 thermal_cooling_device_ops
96 *); 119 *);
97void thermal_cooling_device_unregister(struct thermal_cooling_device *); 120void thermal_cooling_device_unregister(struct thermal_cooling_device *);
98#else
99static inline struct thermal_cooling_device
100*thermal_cooling_device_register(char *c, void *v,
101 struct thermal_cooling_device_ops *t)
102{
103 return NULL;
104}
105static inline
106 void thermal_cooling_device_unregister(struct thermal_cooling_device *t)
107{
108};
109#endif
110 121
111#endif /* __THERMAL_H__ */ 122#endif /* __THERMAL_H__ */