diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 14:26:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-02-20 14:26:56 -0500 |
commit | 8793422fd9ac5037f5047f80473007301df3689f (patch) | |
tree | f5aa3b3a564f053e1b5604c45db80193abc734a4 /include | |
parent | b3cdda2b4f541439ca4205793040aa2e1c852e3b (diff) | |
parent | 10baf04e95fbf7eb6089410220a547211dd2ffa7 (diff) |
Merge tag 'pm+acpi-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael Wysocki:
- Rework of the ACPI namespace scanning code from Rafael J. Wysocki
with contributions from Bjorn Helgaas, Jiang Liu, Mika Westerberg,
Toshi Kani, and Yinghai Lu.
- ACPI power resources handling and ACPI device PM update from Rafael
J Wysocki.
- ACPICA update to version 20130117 from Bob Moore and Lv Zheng with
contributions from Aaron Lu, Chao Guan, Jesper Juhl, and Tim Gardner.
- Support for Intel Lynxpoint LPSS from Mika Westerberg.
- cpuidle update from Len Brown including Intel Haswell support, C1
state for intel_idle, removal of global pm_idle.
- cpuidle fixes and cleanups from Daniel Lezcano.
- cpufreq fixes and cleanups from Viresh Kumar and Fabio Baltieri with
contributions from Stratos Karafotis and Rickard Andersson.
- Intel P-states driver for Sandy Bridge processors from Dirk
Brandewie.
- cpufreq driver for Marvell Kirkwood SoCs from Andrew Lunn.
- cpufreq fixes related to ordering issues between acpi-cpufreq and
powernow-k8 from Borislav Petkov and Matthew Garrett.
- cpufreq support for Calxeda Highbank processors from Mark Langsdorf
and Rob Herring.
- cpufreq driver for the Freescale i.MX6Q SoC and cpufreq-cpu0 update
from Shawn Guo.
- cpufreq Exynos fixes and cleanups from Jonghwan Choi, Sachin Kamat,
and Inderpal Singh.
- Support for "lightweight suspend" from Zhang Rui.
- Removal of the deprecated power trace API from Paul Gortmaker.
- Assorted updates from Andreas Fleig, Colin Ian King, Davidlohr Bueso,
Joseph Salisbury, Kees Cook, Li Fei, Nishanth Menon, ShuoX Liu,
Srinivas Pandruvada, Tejun Heo, Thomas Renninger, and Yasuaki
Ishimatsu.
* tag 'pm+acpi-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (267 commits)
PM idle: remove global declaration of pm_idle
unicore32 idle: delete stray pm_idle comment
openrisc idle: delete pm_idle
mn10300 idle: delete pm_idle
microblaze idle: delete pm_idle
m32r idle: delete pm_idle, and other dead idle code
ia64 idle: delete pm_idle
cris idle: delete idle and pm_idle
ARM64 idle: delete pm_idle
ARM idle: delete pm_idle
blackfin idle: delete pm_idle
sparc idle: rename pm_idle to sparc_idle
sh idle: rename global pm_idle to static sh_idle
x86 idle: rename global pm_idle to static x86_idle
APM idle: register apm_cpu_idle via cpuidle
cpufreq / intel_pstate: Add kernel command line option disable intel_pstate.
cpufreq / intel_pstate: Change to disallow module build
tools/power turbostat: display SMI count by default
intel_idle: export both C1 and C1E
ACPI / hotplug: Fix concurrency issues and memory leaks
...
Diffstat (limited to 'include')
29 files changed, 646 insertions, 425 deletions
diff --git a/include/acpi/acbuffer.h b/include/acpi/acbuffer.h index a1e45cdd729a..c927a0b1de78 100644 --- a/include/acpi/acbuffer.h +++ b/include/acpi/acbuffer.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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/acconfig.h b/include/acpi/acconfig.h index 0943457e0fa5..14ceff788c40 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -138,7 +138,7 @@ | |||
138 | 138 | ||
139 | /* Maximum sleep allowed via Sleep() operator */ | 139 | /* Maximum sleep allowed via Sleep() operator */ |
140 | 140 | ||
141 | #define ACPI_MAX_SLEEP 2000 /* Two seconds */ | 141 | #define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */ |
142 | 142 | ||
143 | /* Address Range lists are per-space_id (Memory and I/O only) */ | 143 | /* Address Range lists are per-space_id (Memory and I/O only) */ |
144 | 144 | ||
@@ -150,11 +150,6 @@ | |||
150 | * | 150 | * |
151 | *****************************************************************************/ | 151 | *****************************************************************************/ |
152 | 152 | ||
153 | /* Number of distinct GPE register blocks and register width */ | ||
154 | |||
155 | #define ACPI_MAX_GPE_BLOCKS 2 | ||
156 | #define ACPI_GPE_REGISTER_WIDTH 8 | ||
157 | |||
158 | /* Method info (in WALK_STATE), containing local variables and argumetns */ | 153 | /* Method info (in WALK_STATE), containing local variables and argumetns */ |
159 | 154 | ||
160 | #define ACPI_METHOD_NUM_LOCALS 8 | 155 | #define ACPI_METHOD_NUM_LOCALS 8 |
@@ -163,12 +158,6 @@ | |||
163 | #define ACPI_METHOD_NUM_ARGS 7 | 158 | #define ACPI_METHOD_NUM_ARGS 7 |
164 | #define ACPI_METHOD_MAX_ARG 6 | 159 | #define ACPI_METHOD_MAX_ARG 6 |
165 | 160 | ||
166 | /* Length of _HID, _UID, _CID, and UUID values */ | ||
167 | |||
168 | #define ACPI_DEVICE_ID_LENGTH 0x09 | ||
169 | #define ACPI_MAX_CID_LENGTH 48 | ||
170 | #define ACPI_UUID_LENGTH 16 | ||
171 | |||
172 | /* | 161 | /* |
173 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG | 162 | * Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG |
174 | */ | 163 | */ |
@@ -186,17 +175,6 @@ | |||
186 | */ | 175 | */ |
187 | #define ACPI_RESULTS_OBJ_NUM_MAX 255 | 176 | #define ACPI_RESULTS_OBJ_NUM_MAX 255 |
188 | 177 | ||
189 | /* Names within the namespace are 4 bytes long */ | ||
190 | |||
191 | #define ACPI_NAME_SIZE 4 | ||
192 | #define ACPI_PATH_SEGMENT_LENGTH 5 /* 4 chars for name + 1 char for separator */ | ||
193 | #define ACPI_PATH_SEPARATOR '.' | ||
194 | |||
195 | /* Sizes for ACPI table headers */ | ||
196 | |||
197 | #define ACPI_OEM_ID_SIZE 6 | ||
198 | #define ACPI_OEM_TABLE_ID_SIZE 8 | ||
199 | |||
200 | /* Constants used in searching for the RSDP in low memory */ | 178 | /* Constants used in searching for the RSDP in low memory */ |
201 | 179 | ||
202 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ | 180 | #define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */ |
@@ -213,6 +191,7 @@ | |||
213 | /* Maximum space_ids for Operation Regions */ | 191 | /* Maximum space_ids for Operation Regions */ |
214 | 192 | ||
215 | #define ACPI_MAX_ADDRESS_SPACE 255 | 193 | #define ACPI_MAX_ADDRESS_SPACE 255 |
194 | #define ACPI_NUM_DEFAULT_SPACES 4 | ||
216 | 195 | ||
217 | /* Array sizes. Used for range checking also */ | 196 | /* Array sizes. Used for range checking also */ |
218 | 197 | ||
diff --git a/include/acpi/acexcep.h b/include/acpi/acexcep.h index 6c3890e02140..9bf59d0e8aaa 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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/acnames.h b/include/acpi/acnames.h index 7665df663284..ce08ef7d969c 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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/acoutput.h b/include/acpi/acoutput.h index 2457ac849655..9885276178e0 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -72,6 +72,7 @@ | |||
72 | #define ACPI_EXAMPLE 0x00004000 | 72 | #define ACPI_EXAMPLE 0x00004000 |
73 | #define ACPI_DRIVER 0x00008000 | 73 | #define ACPI_DRIVER 0x00008000 |
74 | #define DT_COMPILER 0x00010000 | 74 | #define DT_COMPILER 0x00010000 |
75 | #define ASL_PREPROCESSOR 0x00020000 | ||
75 | 76 | ||
76 | #define ACPI_ALL_COMPONENTS 0x0001FFFF | 77 | #define ACPI_ALL_COMPONENTS 0x0001FFFF |
77 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) | 78 | #define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS) |
@@ -262,18 +263,140 @@ | |||
262 | * Common parameters used for debug output functions: | 263 | * Common parameters used for debug output functions: |
263 | * line number, function name, module(file) name, component ID | 264 | * line number, function name, module(file) name, component ID |
264 | */ | 265 | */ |
265 | #define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | 266 | #define ACPI_DEBUG_PARAMETERS \ |
267 | __LINE__, ACPI_GET_FUNCTION_NAME, _acpi_module_name, _COMPONENT | ||
268 | |||
269 | /* Check if debug output is currently dynamically enabled */ | ||
270 | |||
271 | #define ACPI_IS_DEBUG_ENABLED(level, component) \ | ||
272 | ((level & acpi_dbg_level) && (component & acpi_dbg_layer)) | ||
266 | 273 | ||
267 | /* | 274 | /* |
268 | * Master debug print macros | 275 | * Master debug print macros |
269 | * Print message if and only if: | 276 | * Print message if and only if: |
270 | * 1) Debug print for the current component is enabled | 277 | * 1) Debug print for the current component is enabled |
271 | * 2) Debug error level or trace level for the print statement is enabled | 278 | * 2) Debug error level or trace level for the print statement is enabled |
279 | * | ||
280 | * November 2012: Moved the runtime check for whether to actually emit the | ||
281 | * debug message outside of the print function itself. This improves overall | ||
282 | * performance at a relatively small code cost. Implementation involves the | ||
283 | * use of variadic macros supported by C99. | ||
284 | * | ||
285 | * Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from | ||
286 | * complaining about these constructs. On other compilers the do...while | ||
287 | * adds some extra code, so this feature is optional. | ||
272 | */ | 288 | */ |
273 | #define ACPI_DEBUG_PRINT(plist) acpi_debug_print plist | 289 | #ifdef ACPI_USE_DO_WHILE_0 |
274 | #define ACPI_DEBUG_PRINT_RAW(plist) acpi_debug_print_raw plist | 290 | #define ACPI_DO_WHILE0(a) do a while(0) |
275 | |||
276 | #else | 291 | #else |
292 | #define ACPI_DO_WHILE0(a) a | ||
293 | #endif | ||
294 | |||
295 | /* DEBUG_PRINT functions */ | ||
296 | |||
297 | #define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist | ||
298 | #define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist | ||
299 | |||
300 | /* Helper macros for DEBUG_PRINT */ | ||
301 | |||
302 | #define ACPI_DO_DEBUG_PRINT(function, level, line, filename, modulename, component, ...) \ | ||
303 | ACPI_DO_WHILE0 ({ \ | ||
304 | if (ACPI_IS_DEBUG_ENABLED (level, component)) \ | ||
305 | { \ | ||
306 | function (level, line, filename, modulename, component, __VA_ARGS__); \ | ||
307 | } \ | ||
308 | }) | ||
309 | |||
310 | #define ACPI_ACTUAL_DEBUG(level, line, filename, modulename, component, ...) \ | ||
311 | ACPI_DO_DEBUG_PRINT (acpi_debug_print, level, line, \ | ||
312 | filename, modulename, component, __VA_ARGS__) | ||
313 | |||
314 | #define ACPI_ACTUAL_DEBUG_RAW(level, line, filename, modulename, component, ...) \ | ||
315 | ACPI_DO_DEBUG_PRINT (acpi_debug_print_raw, level, line, \ | ||
316 | filename, modulename, component, __VA_ARGS__) | ||
317 | |||
318 | /* | ||
319 | * Function entry tracing | ||
320 | * | ||
321 | * The name of the function is emitted as a local variable that is | ||
322 | * intended to be used by both the entry trace and the exit trace. | ||
323 | */ | ||
324 | |||
325 | /* Helper macro */ | ||
326 | |||
327 | #define ACPI_TRACE_ENTRY(name, function, cast, param) \ | ||
328 | ACPI_FUNCTION_NAME (name) \ | ||
329 | function (ACPI_DEBUG_PARAMETERS, cast (param)) | ||
330 | |||
331 | /* The actual entry trace macros */ | ||
332 | |||
333 | #define ACPI_FUNCTION_TRACE(name) \ | ||
334 | ACPI_FUNCTION_NAME(name) \ | ||
335 | acpi_ut_trace (ACPI_DEBUG_PARAMETERS) | ||
336 | |||
337 | #define ACPI_FUNCTION_TRACE_PTR(name, pointer) \ | ||
338 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_ptr, (void *), pointer) | ||
339 | |||
340 | #define ACPI_FUNCTION_TRACE_U32(name, value) \ | ||
341 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_u32, (u32), value) | ||
342 | |||
343 | #define ACPI_FUNCTION_TRACE_STR(name, string) \ | ||
344 | ACPI_TRACE_ENTRY (name, acpi_ut_trace_str, (char *), string) | ||
345 | |||
346 | #define ACPI_FUNCTION_ENTRY() \ | ||
347 | acpi_ut_track_stack_ptr() | ||
348 | |||
349 | /* | ||
350 | * Function exit tracing | ||
351 | * | ||
352 | * These macros include a return statement. This is usually considered | ||
353 | * bad form, but having a separate exit macro before the actual return | ||
354 | * is very ugly and difficult to maintain. | ||
355 | * | ||
356 | * One of the FUNCTION_TRACE macros above must be used in conjunction | ||
357 | * with these macros so that "_AcpiFunctionName" is defined. | ||
358 | */ | ||
359 | |||
360 | /* Exit trace helper macro */ | ||
361 | |||
362 | #define ACPI_TRACE_EXIT(function, cast, param) \ | ||
363 | ACPI_DO_WHILE0 ({ \ | ||
364 | function (ACPI_DEBUG_PARAMETERS, cast (param)); \ | ||
365 | return ((param)); \ | ||
366 | }) | ||
367 | |||
368 | /* The actual exit macros */ | ||
369 | |||
370 | #define return_VOID \ | ||
371 | ACPI_DO_WHILE0 ({ \ | ||
372 | acpi_ut_exit (ACPI_DEBUG_PARAMETERS); \ | ||
373 | return; \ | ||
374 | }) | ||
375 | |||
376 | #define return_ACPI_STATUS(status) \ | ||
377 | ACPI_TRACE_EXIT (acpi_ut_status_exit, (acpi_status), status) | ||
378 | |||
379 | #define return_PTR(pointer) \ | ||
380 | ACPI_TRACE_EXIT (acpi_ut_ptr_exit, (u8 *), pointer) | ||
381 | |||
382 | #define return_VALUE(value) \ | ||
383 | ACPI_TRACE_EXIT (acpi_ut_value_exit, (u64), value) | ||
384 | |||
385 | /* Conditional execution */ | ||
386 | |||
387 | #define ACPI_DEBUG_EXEC(a) a | ||
388 | #define ACPI_DEBUG_ONLY_MEMBERS(a) a; | ||
389 | #define _VERBOSE_STRUCTURES | ||
390 | |||
391 | /* Various object display routines for debug */ | ||
392 | |||
393 | #define ACPI_DUMP_STACK_ENTRY(a) acpi_ex_dump_operand((a), 0) | ||
394 | #define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c) | ||
395 | #define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b) | ||
396 | #define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d) | ||
397 | #define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) | ||
398 | |||
399 | #else /* ACPI_DEBUG_OUTPUT */ | ||
277 | /* | 400 | /* |
278 | * This is the non-debug case -- make everything go away, | 401 | * This is the non-debug case -- make everything go away, |
279 | * leaving no executable debug code! | 402 | * leaving no executable debug code! |
@@ -281,6 +404,32 @@ | |||
281 | #define ACPI_FUNCTION_NAME(a) | 404 | #define ACPI_FUNCTION_NAME(a) |
282 | #define ACPI_DEBUG_PRINT(pl) | 405 | #define ACPI_DEBUG_PRINT(pl) |
283 | #define ACPI_DEBUG_PRINT_RAW(pl) | 406 | #define ACPI_DEBUG_PRINT_RAW(pl) |
407 | #define ACPI_DEBUG_EXEC(a) | ||
408 | #define ACPI_DEBUG_ONLY_MEMBERS(a) | ||
409 | #define ACPI_FUNCTION_TRACE(a) | ||
410 | #define ACPI_FUNCTION_TRACE_PTR(a, b) | ||
411 | #define ACPI_FUNCTION_TRACE_U32(a, b) | ||
412 | #define ACPI_FUNCTION_TRACE_STR(a, b) | ||
413 | #define ACPI_FUNCTION_EXIT | ||
414 | #define ACPI_FUNCTION_STATUS_EXIT(s) | ||
415 | #define ACPI_FUNCTION_VALUE_EXIT(s) | ||
416 | #define ACPI_FUNCTION_ENTRY() | ||
417 | #define ACPI_DUMP_STACK_ENTRY(a) | ||
418 | #define ACPI_DUMP_OPERANDS(a, b, c) | ||
419 | #define ACPI_DUMP_ENTRY(a, b) | ||
420 | #define ACPI_DUMP_TABLES(a, b) | ||
421 | #define ACPI_DUMP_PATHNAME(a, b, c, d) | ||
422 | #define ACPI_DUMP_BUFFER(a, b) | ||
423 | #define ACPI_DEBUG_PRINT(pl) | ||
424 | #define ACPI_DEBUG_PRINT_RAW(pl) | ||
425 | #define ACPI_IS_DEBUG_ENABLED(level, component) 0 | ||
426 | |||
427 | /* Return macros must have a return statement at the minimum */ | ||
428 | |||
429 | #define return_VOID return | ||
430 | #define return_ACPI_STATUS(s) return(s) | ||
431 | #define return_VALUE(s) return(s) | ||
432 | #define return_PTR(s) return(s) | ||
284 | 433 | ||
285 | #endif /* ACPI_DEBUG_OUTPUT */ | 434 | #endif /* ACPI_DEBUG_OUTPUT */ |
286 | 435 | ||
diff --git a/include/acpi/acpi.h b/include/acpi/acpi.h index c1ea8436961f..618787715d56 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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/acpi_bus.h b/include/acpi/acpi_bus.h index 7ced5dc20dd3..227ba7dc293d 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -84,28 +84,29 @@ struct acpi_driver; | |||
84 | struct acpi_device; | 84 | struct acpi_device; |
85 | 85 | ||
86 | /* | 86 | /* |
87 | * ACPI Scan Handler | ||
88 | * ----------------- | ||
89 | */ | ||
90 | |||
91 | struct acpi_scan_handler { | ||
92 | const struct acpi_device_id *ids; | ||
93 | struct list_head list_node; | ||
94 | int (*attach)(struct acpi_device *dev, const struct acpi_device_id *id); | ||
95 | void (*detach)(struct acpi_device *dev); | ||
96 | }; | ||
97 | |||
98 | /* | ||
87 | * ACPI Driver | 99 | * ACPI Driver |
88 | * ----------- | 100 | * ----------- |
89 | */ | 101 | */ |
90 | 102 | ||
91 | typedef int (*acpi_op_add) (struct acpi_device * device); | 103 | typedef int (*acpi_op_add) (struct acpi_device * device); |
92 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); | 104 | typedef int (*acpi_op_remove) (struct acpi_device * device); |
93 | typedef int (*acpi_op_start) (struct acpi_device * device); | ||
94 | typedef int (*acpi_op_bind) (struct acpi_device * device); | ||
95 | typedef int (*acpi_op_unbind) (struct acpi_device * device); | ||
96 | typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); | 105 | typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); |
97 | 106 | ||
98 | struct acpi_bus_ops { | ||
99 | u32 acpi_op_add:1; | ||
100 | u32 acpi_op_start:1; | ||
101 | }; | ||
102 | |||
103 | struct acpi_device_ops { | 107 | struct acpi_device_ops { |
104 | acpi_op_add add; | 108 | acpi_op_add add; |
105 | acpi_op_remove remove; | 109 | acpi_op_remove remove; |
106 | acpi_op_start start; | ||
107 | acpi_op_bind bind; | ||
108 | acpi_op_unbind unbind; | ||
109 | acpi_op_notify notify; | 110 | acpi_op_notify notify; |
110 | }; | 111 | }; |
111 | 112 | ||
@@ -148,7 +149,8 @@ struct acpi_device_flags { | |||
148 | u32 power_manageable:1; | 149 | u32 power_manageable:1; |
149 | u32 performance_manageable:1; | 150 | u32 performance_manageable:1; |
150 | u32 eject_pending:1; | 151 | u32 eject_pending:1; |
151 | u32 reserved:24; | 152 | u32 match_driver:1; |
153 | u32 reserved:23; | ||
152 | }; | 154 | }; |
153 | 155 | ||
154 | /* File System */ | 156 | /* File System */ |
@@ -207,7 +209,7 @@ struct acpi_device_power_state { | |||
207 | } flags; | 209 | } flags; |
208 | int power; /* % Power (compared to D0) */ | 210 | int power; /* % Power (compared to D0) */ |
209 | int latency; /* Dx->D0 time (microseconds) */ | 211 | int latency; /* Dx->D0 time (microseconds) */ |
210 | struct acpi_handle_list resources; /* Power resources referenced */ | 212 | struct list_head resources; /* Power resources referenced */ |
211 | }; | 213 | }; |
212 | 214 | ||
213 | struct acpi_device_power { | 215 | struct acpi_device_power { |
@@ -250,7 +252,7 @@ struct acpi_device_wakeup { | |||
250 | acpi_handle gpe_device; | 252 | acpi_handle gpe_device; |
251 | u64 gpe_number; | 253 | u64 gpe_number; |
252 | u64 sleep_state; | 254 | u64 sleep_state; |
253 | struct acpi_handle_list resources; | 255 | struct list_head resources; |
254 | struct acpi_device_wakeup_flags flags; | 256 | struct acpi_device_wakeup_flags flags; |
255 | int prepare_count; | 257 | int prepare_count; |
256 | }; | 258 | }; |
@@ -279,16 +281,17 @@ struct acpi_device { | |||
279 | struct acpi_device_wakeup wakeup; | 281 | struct acpi_device_wakeup wakeup; |
280 | struct acpi_device_perf performance; | 282 | struct acpi_device_perf performance; |
281 | struct acpi_device_dir dir; | 283 | struct acpi_device_dir dir; |
282 | struct acpi_device_ops ops; | 284 | struct acpi_scan_handler *handler; |
283 | struct acpi_driver *driver; | 285 | struct acpi_driver *driver; |
284 | void *driver_data; | 286 | void *driver_data; |
285 | struct device dev; | 287 | struct device dev; |
286 | struct acpi_bus_ops bus_ops; /* workaround for different code path for hotplug */ | ||
287 | enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ | 288 | enum acpi_bus_removal_type removal_type; /* indicate for different removal type */ |
288 | u8 physical_node_count; | 289 | u8 physical_node_count; |
289 | struct list_head physical_node_list; | 290 | struct list_head physical_node_list; |
290 | struct mutex physical_node_lock; | 291 | struct mutex physical_node_lock; |
291 | DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE); | 292 | DECLARE_BITMAP(physical_node_id_bitmap, ACPI_MAX_PHYSICAL_NODE); |
293 | struct list_head power_dependent; | ||
294 | void (*remove)(struct acpi_device *); | ||
292 | }; | 295 | }; |
293 | 296 | ||
294 | static inline void *acpi_driver_data(struct acpi_device *d) | 297 | static inline void *acpi_driver_data(struct acpi_device *d) |
@@ -316,7 +319,7 @@ struct acpi_bus_event { | |||
316 | }; | 319 | }; |
317 | 320 | ||
318 | struct acpi_eject_event { | 321 | struct acpi_eject_event { |
319 | acpi_handle handle; | 322 | struct acpi_device *device; |
320 | u32 event; | 323 | u32 event; |
321 | }; | 324 | }; |
322 | 325 | ||
@@ -339,13 +342,51 @@ void acpi_bus_data_handler(acpi_handle handle, void *context); | |||
339 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, | 342 | acpi_status acpi_bus_get_status_handle(acpi_handle handle, |
340 | unsigned long long *sta); | 343 | unsigned long long *sta); |
341 | int acpi_bus_get_status(struct acpi_device *device); | 344 | int acpi_bus_get_status(struct acpi_device *device); |
345 | |||
346 | #ifdef CONFIG_PM | ||
342 | int acpi_bus_set_power(acpi_handle handle, int state); | 347 | int acpi_bus_set_power(acpi_handle handle, int state); |
348 | const char *acpi_power_state_string(int state); | ||
349 | int acpi_device_get_power(struct acpi_device *device, int *state); | ||
343 | int acpi_device_set_power(struct acpi_device *device, int state); | 350 | int acpi_device_set_power(struct acpi_device *device, int state); |
351 | int acpi_bus_init_power(struct acpi_device *device); | ||
344 | int acpi_bus_update_power(acpi_handle handle, int *state_p); | 352 | int acpi_bus_update_power(acpi_handle handle, int *state_p); |
345 | bool acpi_bus_power_manageable(acpi_handle handle); | 353 | bool acpi_bus_power_manageable(acpi_handle handle); |
346 | bool acpi_bus_can_wakeup(acpi_handle handle); | 354 | bool acpi_bus_can_wakeup(acpi_handle handle); |
347 | int acpi_power_resource_register_device(struct device *dev, acpi_handle handle); | 355 | #else /* !CONFIG_PM */ |
348 | void acpi_power_resource_unregister_device(struct device *dev, acpi_handle handle); | 356 | static inline int acpi_bus_set_power(acpi_handle handle, int state) |
357 | { | ||
358 | return 0; | ||
359 | } | ||
360 | static inline const char *acpi_power_state_string(int state) | ||
361 | { | ||
362 | return "D0"; | ||
363 | } | ||
364 | static inline int acpi_device_get_power(struct acpi_device *device, int *state) | ||
365 | { | ||
366 | return 0; | ||
367 | } | ||
368 | static inline int acpi_device_set_power(struct acpi_device *device, int state) | ||
369 | { | ||
370 | return 0; | ||
371 | } | ||
372 | static inline int acpi_bus_init_power(struct acpi_device *device) | ||
373 | { | ||
374 | return 0; | ||
375 | } | ||
376 | static inline int acpi_bus_update_power(acpi_handle handle, int *state_p) | ||
377 | { | ||
378 | return 0; | ||
379 | } | ||
380 | static inline bool acpi_bus_power_manageable(acpi_handle handle) | ||
381 | { | ||
382 | return false; | ||
383 | } | ||
384 | static inline bool acpi_bus_can_wakeup(acpi_handle handle) | ||
385 | { | ||
386 | return false; | ||
387 | } | ||
388 | #endif /* !CONFIG_PM */ | ||
389 | |||
349 | #ifdef CONFIG_ACPI_PROC_EVENT | 390 | #ifdef CONFIG_ACPI_PROC_EVENT |
350 | int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); | 391 | int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data); |
351 | int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); | 392 | int acpi_bus_generate_proc_event4(const char *class, const char *bid, u8 type, int data); |
@@ -354,13 +395,15 @@ int acpi_bus_receive_event(struct acpi_bus_event *event); | |||
354 | static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) | 395 | static inline int acpi_bus_generate_proc_event(struct acpi_device *device, u8 type, int data) |
355 | { return 0; } | 396 | { return 0; } |
356 | #endif | 397 | #endif |
398 | |||
399 | void acpi_scan_lock_acquire(void); | ||
400 | void acpi_scan_lock_release(void); | ||
401 | int acpi_scan_add_handler(struct acpi_scan_handler *handler); | ||
357 | int acpi_bus_register_driver(struct acpi_driver *driver); | 402 | int acpi_bus_register_driver(struct acpi_driver *driver); |
358 | void acpi_bus_unregister_driver(struct acpi_driver *driver); | 403 | void acpi_bus_unregister_driver(struct acpi_driver *driver); |
359 | int acpi_bus_add(struct acpi_device **child, struct acpi_device *parent, | 404 | int acpi_bus_scan(acpi_handle handle); |
360 | acpi_handle handle, int type); | ||
361 | void acpi_bus_hot_remove_device(void *context); | 405 | void acpi_bus_hot_remove_device(void *context); |
362 | int acpi_bus_trim(struct acpi_device *start, int rmdevice); | 406 | void acpi_bus_trim(struct acpi_device *start); |
363 | int acpi_bus_start(struct acpi_device *device); | ||
364 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); | 407 | acpi_status acpi_bus_get_ejd(acpi_handle handle, acpi_handle * ejd); |
365 | int acpi_match_device_ids(struct acpi_device *device, | 408 | int acpi_match_device_ids(struct acpi_device *device, |
366 | const struct acpi_device_id *ids); | 409 | const struct acpi_device_id *ids); |
@@ -390,6 +433,8 @@ struct acpi_bus_type { | |||
390 | int (*find_device) (struct device *, acpi_handle *); | 433 | int (*find_device) (struct device *, acpi_handle *); |
391 | /* For bridges, such as PCI root bridge, IDE controller */ | 434 | /* For bridges, such as PCI root bridge, IDE controller */ |
392 | int (*find_bridge) (struct device *, acpi_handle *); | 435 | int (*find_bridge) (struct device *, acpi_handle *); |
436 | void (*setup)(struct device *); | ||
437 | void (*cleanup)(struct device *); | ||
393 | }; | 438 | }; |
394 | int register_acpi_bus_type(struct acpi_bus_type *); | 439 | int register_acpi_bus_type(struct acpi_bus_type *); |
395 | int unregister_acpi_bus_type(struct acpi_bus_type *); | 440 | int unregister_acpi_bus_type(struct acpi_bus_type *); |
@@ -397,7 +442,6 @@ int unregister_acpi_bus_type(struct acpi_bus_type *); | |||
397 | struct acpi_pci_root { | 442 | struct acpi_pci_root { |
398 | struct list_head node; | 443 | struct list_head node; |
399 | struct acpi_device * device; | 444 | struct acpi_device * device; |
400 | struct acpi_pci_id id; | ||
401 | struct pci_bus *bus; | 445 | struct pci_bus *bus; |
402 | u16 segment; | 446 | u16 segment; |
403 | struct resource secondary; /* downstream bus range */ | 447 | struct resource secondary; /* downstream bus range */ |
@@ -425,6 +469,8 @@ acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, | |||
425 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, | 469 | int acpi_device_power_state(struct device *dev, struct acpi_device *adev, |
426 | u32 target_state, int d_max_in, int *d_min_p); | 470 | u32 target_state, int d_max_in, int *d_min_p); |
427 | int acpi_pm_device_sleep_state(struct device *, int *, int); | 471 | int acpi_pm_device_sleep_state(struct device *, int *, int); |
472 | void acpi_dev_pm_add_dependent(acpi_handle handle, struct device *depdev); | ||
473 | void acpi_dev_pm_remove_dependent(acpi_handle handle, struct device *depdev); | ||
428 | #else | 474 | #else |
429 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, | 475 | static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, |
430 | acpi_notify_handler handler, | 476 | acpi_notify_handler handler, |
@@ -454,6 +500,10 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m) | |||
454 | { | 500 | { |
455 | return __acpi_device_power_state(m, p); | 501 | return __acpi_device_power_state(m, p); |
456 | } | 502 | } |
503 | static inline void acpi_dev_pm_add_dependent(acpi_handle handle, | ||
504 | struct device *depdev) {} | ||
505 | static inline void acpi_dev_pm_remove_dependent(acpi_handle handle, | ||
506 | struct device *depdev) {} | ||
457 | #endif | 507 | #endif |
458 | 508 | ||
459 | #ifdef CONFIG_PM_RUNTIME | 509 | #ifdef CONFIG_PM_RUNTIME |
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h index 43152742b46f..7d2a9eaab9eb 100644 --- a/include/acpi/acpiosxf.h +++ b/include/acpi/acpiosxf.h | |||
@@ -7,7 +7,7 @@ | |||
7 | *****************************************************************************/ | 7 | *****************************************************************************/ |
8 | 8 | ||
9 | /* | 9 | /* |
10 | * Copyright (C) 2000 - 2012, Intel Corp. | 10 | * Copyright (C) 2000 - 2013, 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 |
@@ -102,10 +102,8 @@ acpi_os_physical_table_override(struct acpi_table_header *existing_table, | |||
102 | /* | 102 | /* |
103 | * Spinlock primitives | 103 | * Spinlock primitives |
104 | */ | 104 | */ |
105 | |||
106 | #ifndef acpi_os_create_lock | 105 | #ifndef acpi_os_create_lock |
107 | acpi_status | 106 | acpi_status acpi_os_create_lock(acpi_spinlock * out_handle); |
108 | acpi_os_create_lock(acpi_spinlock *out_handle); | ||
109 | #endif | 107 | #endif |
110 | 108 | ||
111 | void acpi_os_delete_lock(acpi_spinlock handle); | 109 | void acpi_os_delete_lock(acpi_spinlock handle); |
@@ -148,6 +146,8 @@ void acpi_os_release_mutex(acpi_mutex handle); | |||
148 | */ | 146 | */ |
149 | void *acpi_os_allocate(acpi_size size); | 147 | void *acpi_os_allocate(acpi_size size); |
150 | 148 | ||
149 | void acpi_os_free(void *memory); | ||
150 | |||
151 | void __iomem *acpi_os_map_memory(acpi_physical_address where, | 151 | void __iomem *acpi_os_map_memory(acpi_physical_address where, |
152 | acpi_size length); | 152 | acpi_size length); |
153 | 153 | ||
@@ -180,12 +180,13 @@ acpi_status acpi_os_release_object(acpi_cache_t * cache, void *object); | |||
180 | * Interrupt handlers | 180 | * Interrupt handlers |
181 | */ | 181 | */ |
182 | acpi_status | 182 | acpi_status |
183 | acpi_os_install_interrupt_handler(u32 gsi, | 183 | acpi_os_install_interrupt_handler(u32 interrupt_number, |
184 | acpi_osd_handler service_routine, | 184 | acpi_osd_handler service_routine, |
185 | void *context); | 185 | void *context); |
186 | 186 | ||
187 | acpi_status | 187 | acpi_status |
188 | acpi_os_remove_interrupt_handler(u32 gsi, acpi_osd_handler service_routine); | 188 | acpi_os_remove_interrupt_handler(u32 interrupt_number, |
189 | acpi_osd_handler service_routine); | ||
189 | 190 | ||
190 | void acpi_os_gpe_count(u32 gpe_number); | 191 | void acpi_os_gpe_count(u32 gpe_number); |
191 | void acpi_os_fixed_event_count(u32 fixed_event_number); | 192 | void acpi_os_fixed_event_count(u32 fixed_event_number); |
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index 3d88395d4d6f..03322dddd88e 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -46,7 +46,7 @@ | |||
46 | 46 | ||
47 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 47 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
48 | 48 | ||
49 | #define ACPI_CA_VERSION 0x20121018 | 49 | #define ACPI_CA_VERSION 0x20130117 |
50 | 50 | ||
51 | #include <acpi/acconfig.h> | 51 | #include <acpi/acconfig.h> |
52 | #include <acpi/actypes.h> | 52 | #include <acpi/actypes.h> |
@@ -56,11 +56,20 @@ | |||
56 | extern u8 acpi_gbl_permanent_mmap; | 56 | extern u8 acpi_gbl_permanent_mmap; |
57 | 57 | ||
58 | /* | 58 | /* |
59 | * Globals that are publicly available, allowing for | 59 | * Globals that are publically available |
60 | * run time configuration | ||
61 | */ | 60 | */ |
61 | extern u32 acpi_current_gpe_count; | ||
62 | extern struct acpi_table_fadt acpi_gbl_FADT; | ||
63 | extern u8 acpi_gbl_system_awake_and_running; | ||
64 | extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ | ||
65 | |||
66 | /* Runtime configuration of debug print levels */ | ||
67 | |||
62 | extern u32 acpi_dbg_level; | 68 | extern u32 acpi_dbg_level; |
63 | extern u32 acpi_dbg_layer; | 69 | extern u32 acpi_dbg_layer; |
70 | |||
71 | /* ACPICA runtime options */ | ||
72 | |||
64 | extern u8 acpi_gbl_enable_interpreter_slack; | 73 | extern u8 acpi_gbl_enable_interpreter_slack; |
65 | extern u8 acpi_gbl_all_methods_serialized; | 74 | extern u8 acpi_gbl_all_methods_serialized; |
66 | extern u8 acpi_gbl_create_osi_method; | 75 | extern u8 acpi_gbl_create_osi_method; |
@@ -99,14 +108,9 @@ extern u8 acpi_gbl_disable_auto_repair; | |||
99 | 108 | ||
100 | #endif /* !ACPI_REDUCED_HARDWARE */ | 109 | #endif /* !ACPI_REDUCED_HARDWARE */ |
101 | 110 | ||
102 | extern u32 acpi_current_gpe_count; | ||
103 | extern struct acpi_table_fadt acpi_gbl_FADT; | ||
104 | extern u8 acpi_gbl_system_awake_and_running; | ||
105 | extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */ | ||
106 | |||
107 | extern u32 acpi_rsdt_forced; | 111 | extern u32 acpi_rsdt_forced; |
108 | /* | 112 | /* |
109 | * Global interfaces | 113 | * Initialization |
110 | */ | 114 | */ |
111 | acpi_status | 115 | acpi_status |
112 | acpi_initialize_tables(struct acpi_table_desc *initial_storage, | 116 | acpi_initialize_tables(struct acpi_table_desc *initial_storage, |
@@ -120,13 +124,15 @@ acpi_status acpi_initialize_objects(u32 flags); | |||
120 | 124 | ||
121 | acpi_status acpi_terminate(void); | 125 | acpi_status acpi_terminate(void); |
122 | 126 | ||
127 | /* | ||
128 | * Miscellaneous global interfaces | ||
129 | */ | ||
130 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | ||
131 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | ||
123 | #ifdef ACPI_FUTURE_USAGE | 132 | #ifdef ACPI_FUTURE_USAGE |
124 | acpi_status acpi_subsystem_status(void); | 133 | acpi_status acpi_subsystem_status(void); |
125 | #endif | 134 | #endif |
126 | 135 | ||
127 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void)) | ||
128 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void)) | ||
129 | |||
130 | #ifdef ACPI_FUTURE_USAGE | 136 | #ifdef ACPI_FUTURE_USAGE |
131 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); | 137 | acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); |
132 | #endif | 138 | #endif |
@@ -191,9 +197,9 @@ acpi_status | |||
191 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); | 197 | acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table); |
192 | 198 | ||
193 | acpi_status | 199 | acpi_status |
194 | acpi_install_table_handler(acpi_tbl_handler handler, void *context); | 200 | acpi_install_table_handler(acpi_table_handler handler, void *context); |
195 | 201 | ||
196 | acpi_status acpi_remove_table_handler(acpi_tbl_handler handler); | 202 | acpi_status acpi_remove_table_handler(acpi_table_handler handler); |
197 | 203 | ||
198 | /* | 204 | /* |
199 | * Namespace and name interfaces | 205 | * Namespace and name interfaces |
@@ -438,6 +444,11 @@ acpi_get_event_resources(acpi_handle device_handle, | |||
438 | struct acpi_buffer *ret_buffer); | 444 | struct acpi_buffer *ret_buffer); |
439 | 445 | ||
440 | acpi_status | 446 | acpi_status |
447 | acpi_walk_resource_buffer(struct acpi_buffer *buffer, | ||
448 | acpi_walk_resource_callback user_function, | ||
449 | void *context); | ||
450 | |||
451 | acpi_status | ||
441 | acpi_walk_resources(acpi_handle device, | 452 | acpi_walk_resources(acpi_handle device, |
442 | char *name, | 453 | char *name, |
443 | acpi_walk_resource_callback user_function, void *context); | 454 | acpi_walk_resource_callback user_function, void *context); |
@@ -462,6 +473,10 @@ acpi_buffer_to_resource(u8 *aml_buffer, | |||
462 | */ | 473 | */ |
463 | acpi_status acpi_reset(void); | 474 | acpi_status acpi_reset(void); |
464 | 475 | ||
476 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); | ||
477 | |||
478 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); | ||
479 | |||
465 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | 480 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status |
466 | acpi_read_bit_register(u32 register_id, | 481 | acpi_read_bit_register(u32 register_id, |
467 | u32 *return_value)) | 482 | u32 *return_value)) |
@@ -470,20 +485,6 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | |||
470 | acpi_write_bit_register(u32 register_id, | 485 | acpi_write_bit_register(u32 register_id, |
471 | u32 value)) | 486 | u32 value)) |
472 | 487 | ||
473 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
474 | acpi_set_firmware_waking_vector(u32 | ||
475 | physical_address)) | ||
476 | |||
477 | #if ACPI_MACHINE_WIDTH == 64 | ||
478 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
479 | acpi_set_firmware_waking_vector64(u64 | ||
480 | physical_address)) | ||
481 | #endif | ||
482 | |||
483 | acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg); | ||
484 | |||
485 | acpi_status acpi_write(u64 value, struct acpi_generic_address *reg); | ||
486 | |||
487 | /* | 488 | /* |
488 | * Sleep/Wake interfaces | 489 | * Sleep/Wake interfaces |
489 | */ | 490 | */ |
@@ -500,6 +501,15 @@ acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); | |||
500 | 501 | ||
501 | acpi_status acpi_leave_sleep_state(u8 sleep_state); | 502 | acpi_status acpi_leave_sleep_state(u8 sleep_state); |
502 | 503 | ||
504 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
505 | acpi_set_firmware_waking_vector(u32 | ||
506 | physical_address)) | ||
507 | |||
508 | #if ACPI_MACHINE_WIDTH == 64 | ||
509 | ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status | ||
510 | acpi_set_firmware_waking_vector64(u64 | ||
511 | physical_address)) | ||
512 | #endif | ||
503 | /* | 513 | /* |
504 | * ACPI Timer interfaces | 514 | * ACPI Timer interfaces |
505 | */ | 515 | */ |
diff --git a/include/acpi/acrestyp.h b/include/acpi/acrestyp.h index 40349ae65464..cbf4bf977f75 100644 --- a/include/acpi/acrestyp.h +++ b/include/acpi/acrestyp.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -102,8 +102,11 @@ typedef u32 acpi_rsdesc_size; /* Max Resource Descriptor size is (Length+3) = (6 | |||
102 | 102 | ||
103 | #define ACPI_EXCLUSIVE (u8) 0x00 | 103 | #define ACPI_EXCLUSIVE (u8) 0x00 |
104 | #define ACPI_SHARED (u8) 0x01 | 104 | #define ACPI_SHARED (u8) 0x01 |
105 | #define ACPI_EXCLUSIVE_AND_WAKE (u8) 0x02 | 105 | |
106 | #define ACPI_SHARED_AND_WAKE (u8) 0x03 | 106 | /* Wake */ |
107 | |||
108 | #define ACPI_NOT_WAKE_CAPABLE (u8) 0x00 | ||
109 | #define ACPI_WAKE_CAPABLE (u8) 0x01 | ||
107 | 110 | ||
108 | /* | 111 | /* |
109 | * DMA Attributes | 112 | * DMA Attributes |
@@ -171,6 +174,7 @@ struct acpi_resource_irq { | |||
171 | u8 triggering; | 174 | u8 triggering; |
172 | u8 polarity; | 175 | u8 polarity; |
173 | u8 sharable; | 176 | u8 sharable; |
177 | u8 wake_capable; | ||
174 | u8 interrupt_count; | 178 | u8 interrupt_count; |
175 | u8 interrupts[1]; | 179 | u8 interrupts[1]; |
176 | }; | 180 | }; |
@@ -346,6 +350,7 @@ struct acpi_resource_extended_irq { | |||
346 | u8 triggering; | 350 | u8 triggering; |
347 | u8 polarity; | 351 | u8 polarity; |
348 | u8 sharable; | 352 | u8 sharable; |
353 | u8 wake_capable; | ||
349 | u8 interrupt_count; | 354 | u8 interrupt_count; |
350 | struct acpi_resource_source resource_source; | 355 | struct acpi_resource_source resource_source; |
351 | u32 interrupts[1]; | 356 | u32 interrupts[1]; |
@@ -365,6 +370,7 @@ struct acpi_resource_gpio { | |||
365 | u8 producer_consumer; /* For values, see Producer/Consumer above */ | 370 | u8 producer_consumer; /* For values, see Producer/Consumer above */ |
366 | u8 pin_config; | 371 | u8 pin_config; |
367 | u8 sharable; /* For values, see Interrupt Attributes above */ | 372 | u8 sharable; /* For values, see Interrupt Attributes above */ |
373 | u8 wake_capable; /* For values, see Interrupt Attributes above */ | ||
368 | u8 io_restriction; | 374 | u8 io_restriction; |
369 | u8 triggering; /* For values, see Interrupt Attributes above */ | 375 | u8 triggering; /* For values, see Interrupt Attributes above */ |
370 | u8 polarity; /* For values, see Interrupt Attributes above */ | 376 | u8 polarity; /* For values, see Interrupt Attributes above */ |
@@ -591,7 +597,10 @@ struct acpi_resource { | |||
591 | #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) | 597 | #define ACPI_RS_SIZE_MIN (u32) ACPI_ROUND_UP_TO_NATIVE_WORD (12) |
592 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) | 598 | #define ACPI_RS_SIZE(type) (u32) (ACPI_RS_SIZE_NO_DATA + sizeof (type)) |
593 | 599 | ||
594 | #define ACPI_NEXT_RESOURCE(res) (struct acpi_resource *)((u8 *) res + res->length) | 600 | /* Macro for walking resource templates with multiple descriptors */ |
601 | |||
602 | #define ACPI_NEXT_RESOURCE(res) \ | ||
603 | ACPI_ADD_PTR (struct acpi_resource, (res), (res)->length) | ||
595 | 604 | ||
596 | struct acpi_pci_routing_table { | 605 | struct acpi_pci_routing_table { |
597 | u32 length; | 606 | u32 length; |
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h index 4f94b1d812d5..9b58a8f43771 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -326,8 +326,6 @@ enum acpi_preferred_pm_profiles { | |||
326 | 326 | ||
327 | #pragma pack() | 327 | #pragma pack() |
328 | 328 | ||
329 | #define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f) | ||
330 | |||
331 | /* | 329 | /* |
332 | * Internal table-related structures | 330 | * Internal table-related structures |
333 | */ | 331 | */ |
@@ -359,11 +357,14 @@ struct acpi_table_desc { | |||
359 | /* | 357 | /* |
360 | * Get the remaining ACPI tables | 358 | * Get the remaining ACPI tables |
361 | */ | 359 | */ |
362 | |||
363 | #include <acpi/actbl1.h> | 360 | #include <acpi/actbl1.h> |
364 | #include <acpi/actbl2.h> | 361 | #include <acpi/actbl2.h> |
365 | #include <acpi/actbl3.h> | 362 | #include <acpi/actbl3.h> |
366 | 363 | ||
364 | /* Macros used to generate offsets to specific table fields */ | ||
365 | |||
366 | #define ACPI_FADT_OFFSET(f) (u16) ACPI_OFFSET (struct acpi_table_fadt, f) | ||
367 | |||
367 | /* | 368 | /* |
368 | * Sizes of the various flavors of FADT. We need to look closely | 369 | * Sizes of the various flavors of FADT. We need to look closely |
369 | * at the FADT length because the version number essentially tells | 370 | * at the FADT length because the version number essentially tells |
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h index 280fc45b59dd..0bd750ebeb49 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -768,7 +768,7 @@ struct acpi_madt_interrupt_source { | |||
768 | 768 | ||
769 | struct acpi_madt_local_x2apic { | 769 | struct acpi_madt_local_x2apic { |
770 | struct acpi_subtable_header header; | 770 | struct acpi_subtable_header header; |
771 | u16 reserved; /* Reserved - must be zero */ | 771 | u16 reserved; /* reserved - must be zero */ |
772 | u32 local_apic_id; /* Processor x2APIC ID */ | 772 | u32 local_apic_id; /* Processor x2APIC ID */ |
773 | u32 lapic_flags; | 773 | u32 lapic_flags; |
774 | u32 uid; /* ACPI processor UID */ | 774 | u32 uid; /* ACPI processor UID */ |
@@ -781,14 +781,14 @@ struct acpi_madt_local_x2apic_nmi { | |||
781 | u16 inti_flags; | 781 | u16 inti_flags; |
782 | u32 uid; /* ACPI processor UID */ | 782 | u32 uid; /* ACPI processor UID */ |
783 | u8 lint; /* LINTn to which NMI is connected */ | 783 | u8 lint; /* LINTn to which NMI is connected */ |
784 | u8 reserved[3]; | 784 | u8 reserved[3]; /* reserved - must be zero */ |
785 | }; | 785 | }; |
786 | 786 | ||
787 | /* 11: Generic Interrupt (ACPI 5.0) */ | 787 | /* 11: Generic Interrupt (ACPI 5.0) */ |
788 | 788 | ||
789 | struct acpi_madt_generic_interrupt { | 789 | struct acpi_madt_generic_interrupt { |
790 | struct acpi_subtable_header header; | 790 | struct acpi_subtable_header header; |
791 | u16 reserved; /* Reserved - must be zero */ | 791 | u16 reserved; /* reserved - must be zero */ |
792 | u32 gic_id; | 792 | u32 gic_id; |
793 | u32 uid; | 793 | u32 uid; |
794 | u32 flags; | 794 | u32 flags; |
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h index 1b2b356486d1..77dc7a4099a3 100644 --- a/include/acpi/actbl2.h +++ b/include/acpi/actbl2.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -261,9 +261,28 @@ struct acpi_csrt_group { | |||
261 | u16 subdevice_id; | 261 | u16 subdevice_id; |
262 | u16 revision; | 262 | u16 revision; |
263 | u16 reserved; | 263 | u16 reserved; |
264 | u32 info_length; | 264 | u32 shared_info_length; |
265 | 265 | ||
266 | /* Shared data (length = info_length) immediately follows */ | 266 | /* Shared data immediately follows (Length = shared_info_length) */ |
267 | }; | ||
268 | |||
269 | /* Shared Info subtable */ | ||
270 | |||
271 | struct acpi_csrt_shared_info { | ||
272 | u16 major_version; | ||
273 | u16 minor_version; | ||
274 | u32 mmio_base_low; | ||
275 | u32 mmio_base_high; | ||
276 | u32 gsi_interrupt; | ||
277 | u8 interrupt_polarity; | ||
278 | u8 interrupt_mode; | ||
279 | u8 num_channels; | ||
280 | u8 dma_address_width; | ||
281 | u16 base_request_line; | ||
282 | u16 num_handshake_signals; | ||
283 | u32 max_block_size; | ||
284 | |||
285 | /* Resource descriptors immediately follow (Length = Group length - shared_info_length) */ | ||
267 | }; | 286 | }; |
268 | 287 | ||
269 | /* Resource Descriptor subtable */ | 288 | /* Resource Descriptor subtable */ |
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h index 6585141e4b97..332b17e3bec8 100644 --- a/include/acpi/actbl3.h +++ b/include/acpi/actbl3.h | |||
@@ -5,7 +5,7 @@ | |||
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -68,13 +68,13 @@ | |||
68 | #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ | 68 | #define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */ |
69 | #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ | 69 | #define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */ |
70 | #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ | 70 | #define ACPI_SIG_RASF "RASF" /* RAS Feature table */ |
71 | #define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */ | ||
71 | 72 | ||
72 | #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ | 73 | #define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */ |
73 | #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ | 74 | #define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */ |
74 | 75 | ||
75 | /* Reserved table signatures */ | 76 | /* Reserved table signatures */ |
76 | 77 | ||
77 | #define ACPI_SIG_CSRT "CSRT" /* Core System Resources Table */ | ||
78 | #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ | 78 | #define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */ |
79 | #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ | 79 | #define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */ |
80 | #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ | 80 | #define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */ |
@@ -550,6 +550,36 @@ enum acpi_rasf_status { | |||
550 | #define ACPI_RASF_ERROR (1<<2) | 550 | #define ACPI_RASF_ERROR (1<<2) |
551 | #define ACPI_RASF_STATUS (0x1F<<3) | 551 | #define ACPI_RASF_STATUS (0x1F<<3) |
552 | 552 | ||
553 | /******************************************************************************* | ||
554 | * | ||
555 | * TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table | ||
556 | * Version 3 | ||
557 | * | ||
558 | * Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011 | ||
559 | * | ||
560 | ******************************************************************************/ | ||
561 | |||
562 | struct acpi_table_tpm2 { | ||
563 | struct acpi_table_header header; /* Common ACPI table header */ | ||
564 | u32 flags; | ||
565 | u64 control_address; | ||
566 | u32 start_method; | ||
567 | }; | ||
568 | |||
569 | /* Control area structure (not part of table, pointed to by control_address) */ | ||
570 | |||
571 | struct acpi_tpm2_control { | ||
572 | u32 reserved; | ||
573 | u32 error; | ||
574 | u32 cancel; | ||
575 | u32 start; | ||
576 | u64 interrupt_control; | ||
577 | u32 command_size; | ||
578 | u64 command_address; | ||
579 | u32 response_size; | ||
580 | u64 response_address; | ||
581 | }; | ||
582 | |||
553 | /* Reset to default packing */ | 583 | /* Reset to default packing */ |
554 | 584 | ||
555 | #pragma pack() | 585 | #pragma pack() |
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h index 4f43f1fba132..845e75f1ffd8 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -341,7 +341,7 @@ typedef u32 acpi_physical_address; | |||
341 | 341 | ||
342 | /* PM Timer ticks per second (HZ) */ | 342 | /* PM Timer ticks per second (HZ) */ |
343 | 343 | ||
344 | #define PM_TIMER_FREQUENCY 3579545 | 344 | #define ACPI_PM_TIMER_FREQUENCY 3579545 |
345 | 345 | ||
346 | /******************************************************************************* | 346 | /******************************************************************************* |
347 | * | 347 | * |
@@ -373,6 +373,21 @@ typedef u32 acpi_name; /* 4-byte ACPI name */ | |||
373 | typedef char *acpi_string; /* Null terminated ASCII string */ | 373 | typedef char *acpi_string; /* Null terminated ASCII string */ |
374 | typedef void *acpi_handle; /* Actually a ptr to a NS Node */ | 374 | typedef void *acpi_handle; /* Actually a ptr to a NS Node */ |
375 | 375 | ||
376 | /* Time constants for timer calculations */ | ||
377 | |||
378 | #define ACPI_MSEC_PER_SEC 1000L | ||
379 | |||
380 | #define ACPI_USEC_PER_MSEC 1000L | ||
381 | #define ACPI_USEC_PER_SEC 1000000L | ||
382 | |||
383 | #define ACPI_100NSEC_PER_USEC 10L | ||
384 | #define ACPI_100NSEC_PER_MSEC 10000L | ||
385 | #define ACPI_100NSEC_PER_SEC 10000000L | ||
386 | |||
387 | #define ACPI_NSEC_PER_USEC 1000L | ||
388 | #define ACPI_NSEC_PER_MSEC 1000000L | ||
389 | #define ACPI_NSEC_PER_SEC 1000000000L | ||
390 | |||
376 | /* Owner IDs are used to track namespace nodes for selective deletion */ | 391 | /* Owner IDs are used to track namespace nodes for selective deletion */ |
377 | 392 | ||
378 | typedef u8 acpi_owner_id; | 393 | typedef u8 acpi_owner_id; |
@@ -390,10 +405,6 @@ typedef u8 acpi_owner_id; | |||
390 | #define ACPI_MAX16_DECIMAL_DIGITS 5 | 405 | #define ACPI_MAX16_DECIMAL_DIGITS 5 |
391 | #define ACPI_MAX8_DECIMAL_DIGITS 3 | 406 | #define ACPI_MAX8_DECIMAL_DIGITS 3 |
392 | 407 | ||
393 | /* PM Timer ticks per second (HZ) */ | ||
394 | |||
395 | #define PM_TIMER_FREQUENCY 3579545 | ||
396 | |||
397 | /* | 408 | /* |
398 | * Constants with special meanings | 409 | * Constants with special meanings |
399 | */ | 410 | */ |
@@ -474,6 +485,7 @@ typedef u64 acpi_integer; | |||
474 | */ | 485 | */ |
475 | #define ACPI_FULL_INITIALIZATION 0x00 | 486 | #define ACPI_FULL_INITIALIZATION 0x00 |
476 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 | 487 | #define ACPI_NO_ADDRESS_SPACE_INIT 0x01 |
488 | #define ACPI_NO_HARDWARE_INIT 0x02 | ||
477 | #define ACPI_NO_EVENT_INIT 0x04 | 489 | #define ACPI_NO_EVENT_INIT 0x04 |
478 | #define ACPI_NO_HANDLER_INIT 0x08 | 490 | #define ACPI_NO_HANDLER_INIT 0x08 |
479 | #define ACPI_NO_ACPI_ENABLE 0x10 | 491 | #define ACPI_NO_ACPI_ENABLE 0x10 |
@@ -595,7 +607,7 @@ typedef u32 acpi_object_type; | |||
595 | 607 | ||
596 | /* | 608 | /* |
597 | * These are special object types that never appear in | 609 | * These are special object types that never appear in |
598 | * a Namespace node, only in a union acpi_operand_object | 610 | * a Namespace node, only in an object of union acpi_operand_object |
599 | */ | 611 | */ |
600 | #define ACPI_TYPE_LOCAL_EXTRA 0x1C | 612 | #define ACPI_TYPE_LOCAL_EXTRA 0x1C |
601 | #define ACPI_TYPE_LOCAL_DATA 0x1D | 613 | #define ACPI_TYPE_LOCAL_DATA 0x1D |
@@ -662,7 +674,7 @@ typedef u32 acpi_event_status; | |||
662 | #define ACPI_GPE_MAX 0xFF | 674 | #define ACPI_GPE_MAX 0xFF |
663 | #define ACPI_NUM_GPE 256 | 675 | #define ACPI_NUM_GPE 256 |
664 | 676 | ||
665 | /* Actions for acpi_set_gpe_wake_mask, acpi_hw_low_set_gpe */ | 677 | /* Actions for acpi_set_gpe, acpi_gpe_wakeup, acpi_hw_low_set_gpe */ |
666 | 678 | ||
667 | #define ACPI_GPE_ENABLE 0 | 679 | #define ACPI_GPE_ENABLE 0 |
668 | #define ACPI_GPE_DISABLE 1 | 680 | #define ACPI_GPE_DISABLE 1 |
@@ -880,6 +892,10 @@ struct acpi_buffer { | |||
880 | void *pointer; /* pointer to buffer */ | 892 | void *pointer; /* pointer to buffer */ |
881 | }; | 893 | }; |
882 | 894 | ||
895 | /* Free a buffer created in an struct acpi_buffer via ACPI_ALLOCATE_LOCAL_BUFFER */ | ||
896 | |||
897 | #define ACPI_FREE_BUFFER(b) ACPI_FREE(b.pointer) | ||
898 | |||
883 | /* | 899 | /* |
884 | * name_type for acpi_get_name | 900 | * name_type for acpi_get_name |
885 | */ | 901 | */ |
@@ -968,7 +984,11 @@ acpi_status(*acpi_exception_handler) (acpi_status aml_status, | |||
968 | /* Table Event handler (Load, load_table, etc.) and types */ | 984 | /* Table Event handler (Load, load_table, etc.) and types */ |
969 | 985 | ||
970 | typedef | 986 | typedef |
971 | acpi_status(*acpi_tbl_handler) (u32 event, void *table, void *context); | 987 | acpi_status(*acpi_table_handler) (u32 event, void *table, void *context); |
988 | |||
989 | #define ACPI_TABLE_LOAD 0x0 | ||
990 | #define ACPI_TABLE_UNLOAD 0x1 | ||
991 | #define ACPI_NUM_TABLE_EVENTS 2 | ||
972 | 992 | ||
973 | /* Address Spaces (For Operation Regions) */ | 993 | /* Address Spaces (For Operation Regions) */ |
974 | 994 | ||
diff --git a/include/acpi/container.h b/include/acpi/container.h deleted file mode 100644 index a703f14e049e..000000000000 --- a/include/acpi/container.h +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #ifndef __ACPI_CONTAINER_H | ||
2 | #define __ACPI_CONTAINER_H | ||
3 | |||
4 | #include <linux/kernel.h> | ||
5 | |||
6 | struct acpi_container { | ||
7 | acpi_handle handle; | ||
8 | unsigned long sun; | ||
9 | int state; | ||
10 | }; | ||
11 | |||
12 | #endif /* __ACPI_CONTAINER_H */ | ||
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h index 89cee88dd2a5..ef04b36ca6ed 100644 --- a/include/acpi/platform/acenv.h +++ b/include/acpi/platform/acenv.h | |||
@@ -1,11 +1,11 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Name: acenv.h - Generation environment specific items | 3 | * Name: acenv.h - Host and compiler configuration |
4 | * | 4 | * |
5 | *****************************************************************************/ | 5 | *****************************************************************************/ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * Copyright (C) 2000 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -44,6 +44,12 @@ | |||
44 | #ifndef __ACENV_H__ | 44 | #ifndef __ACENV_H__ |
45 | #define __ACENV_H__ | 45 | #define __ACENV_H__ |
46 | 46 | ||
47 | /* | ||
48 | * Environment configuration. The purpose of this file is to interface ACPICA | ||
49 | * to the local environment. This includes compiler-specific, OS-specific, | ||
50 | * and machine-specific configuration. | ||
51 | */ | ||
52 | |||
47 | /* Types for ACPI_MUTEX_TYPE */ | 53 | /* Types for ACPI_MUTEX_TYPE */ |
48 | 54 | ||
49 | #define ACPI_BINARY_SEMAPHORE 0 | 55 | #define ACPI_BINARY_SEMAPHORE 0 |
@@ -60,139 +66,170 @@ | |||
60 | * | 66 | * |
61 | *****************************************************************************/ | 67 | *****************************************************************************/ |
62 | 68 | ||
63 | #ifdef ACPI_LIBRARY | 69 | /* iASL configuration */ |
64 | /* | ||
65 | * Note: The non-debug version of the acpi_library does not contain any | ||
66 | * debug support, for minimal size. The debug version uses ACPI_FULL_DEBUG | ||
67 | */ | ||
68 | #define ACPI_USE_LOCAL_CACHE | ||
69 | #endif | ||
70 | 70 | ||
71 | #ifdef ACPI_ASL_COMPILER | 71 | #ifdef ACPI_ASL_COMPILER |
72 | #define ACPI_DEBUG_OUTPUT | ||
73 | #define ACPI_APPLICATION | 72 | #define ACPI_APPLICATION |
74 | #define ACPI_DISASSEMBLER | 73 | #define ACPI_DISASSEMBLER |
74 | #define ACPI_DEBUG_OUTPUT | ||
75 | #define ACPI_CONSTANT_EVAL_ONLY | 75 | #define ACPI_CONSTANT_EVAL_ONLY |
76 | #define ACPI_LARGE_NAMESPACE_NODE | 76 | #define ACPI_LARGE_NAMESPACE_NODE |
77 | #define ACPI_DATA_TABLE_DISASSEMBLY | 77 | #define ACPI_DATA_TABLE_DISASSEMBLY |
78 | #define ACPI_SINGLE_THREADED | ||
78 | #endif | 79 | #endif |
79 | 80 | ||
81 | /* acpi_exec configuration. Multithreaded with full AML debugger */ | ||
82 | |||
80 | #ifdef ACPI_EXEC_APP | 83 | #ifdef ACPI_EXEC_APP |
81 | #undef DEBUGGER_THREADING | ||
82 | #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED | ||
83 | #define ACPI_FULL_DEBUG | ||
84 | #define ACPI_APPLICATION | 84 | #define ACPI_APPLICATION |
85 | #define ACPI_DEBUGGER | 85 | #define ACPI_FULL_DEBUG |
86 | #define ACPI_MUTEX_DEBUG | 86 | #define ACPI_MUTEX_DEBUG |
87 | #define ACPI_DBG_TRACK_ALLOCATIONS | 87 | #define ACPI_DBG_TRACK_ALLOCATIONS |
88 | #endif | 88 | #endif |
89 | 89 | ||
90 | /* acpi_names configuration. Single threaded with debugger output enabled. */ | ||
91 | |||
92 | #ifdef ACPI_NAMES_APP | ||
93 | #define ACPI_DEBUGGER | ||
94 | #define ACPI_APPLICATION | ||
95 | #define ACPI_SINGLE_THREADED | ||
96 | #endif | ||
97 | |||
98 | /* | ||
99 | * acpi_bin/acpi_help/acpi_src configuration. All single threaded, with | ||
100 | * no debug output. | ||
101 | */ | ||
102 | #if (defined ACPI_BIN_APP) || \ | ||
103 | (defined ACPI_SRC_APP) || \ | ||
104 | (defined ACPI_XTRACT_APP) | ||
105 | #define ACPI_APPLICATION | ||
106 | #define ACPI_SINGLE_THREADED | ||
107 | #endif | ||
108 | |||
109 | #ifdef ACPI_HELP_APP | ||
110 | #define ACPI_APPLICATION | ||
111 | #define ACPI_SINGLE_THREADED | ||
112 | #define ACPI_NO_ERROR_MESSAGES | ||
113 | #endif | ||
114 | |||
115 | /* Linkable ACPICA library */ | ||
116 | |||
117 | #ifdef ACPI_LIBRARY | ||
118 | #define ACPI_USE_LOCAL_CACHE | ||
119 | #define ACPI_FUTURE_USAGE | ||
120 | #endif | ||
121 | |||
122 | /* Common for all ACPICA applications */ | ||
123 | |||
90 | #ifdef ACPI_APPLICATION | 124 | #ifdef ACPI_APPLICATION |
91 | #define ACPI_USE_SYSTEM_CLIBRARY | 125 | #define ACPI_USE_SYSTEM_CLIBRARY |
92 | #define ACPI_USE_LOCAL_CACHE | 126 | #define ACPI_USE_LOCAL_CACHE |
93 | #endif | 127 | #endif |
94 | 128 | ||
129 | /* Common debug support */ | ||
130 | |||
95 | #ifdef ACPI_FULL_DEBUG | 131 | #ifdef ACPI_FULL_DEBUG |
96 | #define ACPI_DEBUGGER | 132 | #define ACPI_DEBUGGER |
97 | #define ACPI_DEBUG_OUTPUT | 133 | #define ACPI_DEBUG_OUTPUT |
98 | #define ACPI_DISASSEMBLER | 134 | #define ACPI_DISASSEMBLER |
99 | #endif | 135 | #endif |
100 | 136 | ||
101 | /* | ||
102 | * Environment configuration. The purpose of this file is to interface to the | ||
103 | * local generation environment. | ||
104 | * | ||
105 | * 1) ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. | ||
106 | * Otherwise, local versions of string/memory functions will be used. | ||
107 | * 2) ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and | ||
108 | * the standard header files may be used. | ||
109 | * | ||
110 | * The ACPI subsystem only uses low level C library functions that do not call | ||
111 | * operating system services and may therefore be inlined in the code. | ||
112 | * | ||
113 | * It may be necessary to tailor these include files to the target | ||
114 | * generation environment. | ||
115 | * | ||
116 | * | ||
117 | * Functions and constants used from each header: | ||
118 | * | ||
119 | * string.h: memcpy | ||
120 | * memset | ||
121 | * strcat | ||
122 | * strcmp | ||
123 | * strcpy | ||
124 | * strlen | ||
125 | * strncmp | ||
126 | * strncat | ||
127 | * strncpy | ||
128 | * | ||
129 | * stdlib.h: strtoul | ||
130 | * | ||
131 | * stdarg.h: va_list | ||
132 | * va_arg | ||
133 | * va_start | ||
134 | * va_end | ||
135 | * | ||
136 | */ | ||
137 | 137 | ||
138 | /*! [Begin] no source code translation */ | 138 | /*! [Begin] no source code translation */ |
139 | 139 | ||
140 | /****************************************************************************** | ||
141 | * | ||
142 | * Host configuration files. The compiler configuration files are included | ||
143 | * by the host files. | ||
144 | * | ||
145 | *****************************************************************************/ | ||
146 | |||
140 | #if defined(_LINUX) || defined(__linux__) | 147 | #if defined(_LINUX) || defined(__linux__) |
141 | #include <acpi/platform/aclinux.h> | 148 | #include <acpi/platform/aclinux.h> |
142 | 149 | ||
143 | #elif defined(_AED_EFI) | ||
144 | #include "acefi.h" | ||
145 | |||
146 | #elif defined(WIN32) | ||
147 | #include "acwin.h" | ||
148 | |||
149 | #elif defined(WIN64) | ||
150 | #include "acwin64.h" | ||
151 | |||
152 | #elif defined(MSDOS) /* Must appear after WIN32 and WIN64 check */ | ||
153 | #include "acdos16.h" | ||
154 | |||
155 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) | 150 | #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) |
156 | #include "acfreebsd.h" | 151 | #include "acfreebsd.h" |
157 | 152 | ||
158 | #elif defined(__NetBSD__) | 153 | #elif defined(__NetBSD__) |
159 | #include "acnetbsd.h" | 154 | #include "acnetbsd.h" |
160 | 155 | ||
156 | #elif defined(__sun) | ||
157 | #include "acsolaris.h" | ||
158 | |||
161 | #elif defined(MODESTO) | 159 | #elif defined(MODESTO) |
162 | #include "acmodesto.h" | 160 | #include "acmodesto.h" |
163 | 161 | ||
164 | #elif defined(NETWARE) | 162 | #elif defined(NETWARE) |
165 | #include "acnetware.h" | 163 | #include "acnetware.h" |
166 | 164 | ||
167 | #elif defined(__sun) | 165 | #elif defined(_CYGWIN) |
168 | #include "acsolaris.h" | 166 | #include "accygwin.h" |
169 | 167 | ||
170 | #else | 168 | #elif defined(WIN32) |
169 | #include "acwin.h" | ||
170 | |||
171 | #elif defined(WIN64) | ||
172 | #include "acwin64.h" | ||
171 | 173 | ||
172 | /* All other environments */ | 174 | #elif defined(_WRS_LIB_BUILD) |
175 | #include "acvxworks.h" | ||
173 | 176 | ||
174 | #define ACPI_USE_STANDARD_HEADERS | 177 | #elif defined(__OS2__) |
178 | #include "acos2.h" | ||
175 | 179 | ||
176 | #define COMPILER_DEPENDENT_INT64 long long | 180 | #elif defined(_AED_EFI) |
177 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | 181 | #include "acefi.h" |
182 | |||
183 | #elif defined(__HAIKU__) | ||
184 | #include "achaiku.h" | ||
178 | 185 | ||
186 | #else | ||
187 | |||
188 | /* Unknown environment */ | ||
189 | |||
190 | #error Unknown target environment | ||
179 | #endif | 191 | #endif |
180 | 192 | ||
181 | /*! [End] no source code translation !*/ | 193 | /*! [End] no source code translation !*/ |
182 | 194 | ||
183 | /****************************************************************************** | 195 | /****************************************************************************** |
184 | * | 196 | * |
185 | * Miscellaneous configuration | 197 | * Setup defaults for the required symbols that were not defined in one of |
198 | * the host/compiler files above. | ||
186 | * | 199 | * |
187 | *****************************************************************************/ | 200 | *****************************************************************************/ |
188 | 201 | ||
189 | /* | 202 | /* 64-bit data types */ |
190 | * Are mutexes supported by the host? default is no, use binary semaphores. | 203 | |
191 | */ | 204 | #ifndef COMPILER_DEPENDENT_INT64 |
205 | #define COMPILER_DEPENDENT_INT64 long long | ||
206 | #endif | ||
207 | |||
208 | #ifndef COMPILER_DEPENDENT_UINT64 | ||
209 | #define COMPILER_DEPENDENT_UINT64 unsigned long long | ||
210 | #endif | ||
211 | |||
212 | /* Type of mutex supported by host. Default is binary semaphores. */ | ||
192 | #ifndef ACPI_MUTEX_TYPE | 213 | #ifndef ACPI_MUTEX_TYPE |
193 | #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE | 214 | #define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE |
194 | #endif | 215 | #endif |
195 | 216 | ||
217 | /* Global Lock acquire/release */ | ||
218 | |||
219 | #ifndef ACPI_ACQUIRE_GLOBAL_LOCK | ||
220 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acquired) acquired = 1 | ||
221 | #endif | ||
222 | |||
223 | #ifndef ACPI_RELEASE_GLOBAL_LOCK | ||
224 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, pending) pending = 0 | ||
225 | #endif | ||
226 | |||
227 | /* Flush CPU cache - used when going to sleep. Wbinvd or similar. */ | ||
228 | |||
229 | #ifndef ACPI_FLUSH_CPU_CACHE | ||
230 | #define ACPI_FLUSH_CPU_CACHE() | ||
231 | #endif | ||
232 | |||
196 | /* "inline" keywords - configurable since inline is not standardized */ | 233 | /* "inline" keywords - configurable since inline is not standardized */ |
197 | 234 | ||
198 | #ifndef ACPI_INLINE | 235 | #ifndef ACPI_INLINE |
@@ -200,6 +237,30 @@ | |||
200 | #endif | 237 | #endif |
201 | 238 | ||
202 | /* | 239 | /* |
240 | * Configurable calling conventions: | ||
241 | * | ||
242 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | ||
243 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | ||
244 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | ||
245 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | ||
246 | */ | ||
247 | #ifndef ACPI_SYSTEM_XFACE | ||
248 | #define ACPI_SYSTEM_XFACE | ||
249 | #endif | ||
250 | |||
251 | #ifndef ACPI_EXTERNAL_XFACE | ||
252 | #define ACPI_EXTERNAL_XFACE | ||
253 | #endif | ||
254 | |||
255 | #ifndef ACPI_INTERNAL_XFACE | ||
256 | #define ACPI_INTERNAL_XFACE | ||
257 | #endif | ||
258 | |||
259 | #ifndef ACPI_INTERNAL_VAR_XFACE | ||
260 | #define ACPI_INTERNAL_VAR_XFACE | ||
261 | #endif | ||
262 | |||
263 | /* | ||
203 | * Debugger threading model | 264 | * Debugger threading model |
204 | * Use single threaded if the entire subsystem is contained in an application | 265 | * Use single threaded if the entire subsystem is contained in an application |
205 | * Use multiple threaded when the subsystem is running in the kernel. | 266 | * Use multiple threaded when the subsystem is running in the kernel. |
@@ -222,17 +283,26 @@ | |||
222 | * | 283 | * |
223 | *****************************************************************************/ | 284 | *****************************************************************************/ |
224 | 285 | ||
225 | #define ACPI_IS_ASCII(c) ((c) < 0x80) | ||
226 | |||
227 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | ||
228 | /* | 286 | /* |
229 | * Use the standard C library headers. | 287 | * ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library. |
230 | * We want to keep these to a minimum. | 288 | * Otherwise, local versions of string/memory functions will be used. |
289 | * ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and | ||
290 | * the standard header files may be used. | ||
291 | * | ||
292 | * The ACPICA subsystem only uses low level C library functions that do not call | ||
293 | * operating system services and may therefore be inlined in the code. | ||
294 | * | ||
295 | * It may be necessary to tailor these include files to the target | ||
296 | * generation environment. | ||
231 | */ | 297 | */ |
298 | #ifdef ACPI_USE_SYSTEM_CLIBRARY | ||
299 | |||
300 | /* Use the standard C library headers. We want to keep these to a minimum. */ | ||
301 | |||
232 | #ifdef ACPI_USE_STANDARD_HEADERS | 302 | #ifdef ACPI_USE_STANDARD_HEADERS |
233 | /* | 303 | |
234 | * Use the standard headers from the standard locations | 304 | /* Use the standard headers from the standard locations */ |
235 | */ | 305 | |
236 | #include <stdarg.h> | 306 | #include <stdarg.h> |
237 | #include <stdlib.h> | 307 | #include <stdlib.h> |
238 | #include <string.h> | 308 | #include <string.h> |
@@ -240,9 +310,8 @@ | |||
240 | 310 | ||
241 | #endif /* ACPI_USE_STANDARD_HEADERS */ | 311 | #endif /* ACPI_USE_STANDARD_HEADERS */ |
242 | 312 | ||
243 | /* | 313 | /* We will be linking to the standard Clib functions */ |
244 | * We will be linking to the standard Clib functions | 314 | |
245 | */ | ||
246 | #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) | 315 | #define ACPI_STRSTR(s1,s2) strstr((s1), (s2)) |
247 | #define ACPI_STRCHR(s1,c) strchr((s1), (c)) | 316 | #define ACPI_STRCHR(s1,c) strchr((s1), (c)) |
248 | #define ACPI_STRLEN(s) (acpi_size) strlen((s)) | 317 | #define ACPI_STRLEN(s) (acpi_size) strlen((s)) |
@@ -274,13 +343,12 @@ | |||
274 | * | 343 | * |
275 | *****************************************************************************/ | 344 | *****************************************************************************/ |
276 | 345 | ||
277 | /* | 346 | /* |
278 | * Use local definitions of C library macros and functions | 347 | * Use local definitions of C library macros and functions. These function |
279 | * NOTE: The function implementations may not be as efficient | 348 | * implementations may not be as efficient as an inline or assembly code |
280 | * as an inline or assembly code implementation provided by a | 349 | * implementation provided by a native C library, but they are functionally |
281 | * native C library. | 350 | * equivalent. |
282 | */ | 351 | */ |
283 | |||
284 | #ifndef va_arg | 352 | #ifndef va_arg |
285 | 353 | ||
286 | #ifndef _VALIST | 354 | #ifndef _VALIST |
@@ -288,22 +356,22 @@ | |||
288 | typedef char *va_list; | 356 | typedef char *va_list; |
289 | #endif /* _VALIST */ | 357 | #endif /* _VALIST */ |
290 | 358 | ||
291 | /* | 359 | /* Storage alignment properties */ |
292 | * Storage alignment properties | 360 | |
293 | */ | ||
294 | #define _AUPBND (sizeof (acpi_native_int) - 1) | 361 | #define _AUPBND (sizeof (acpi_native_int) - 1) |
295 | #define _ADNBND (sizeof (acpi_native_int) - 1) | 362 | #define _ADNBND (sizeof (acpi_native_int) - 1) |
296 | 363 | ||
297 | /* | 364 | /* Variable argument list macro definitions */ |
298 | * Variable argument list macro definitions | 365 | |
299 | */ | ||
300 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) | 366 | #define _bnd(X, bnd) (((sizeof (X)) + (bnd)) & (~(bnd))) |
301 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) | 367 | #define va_arg(ap, T) (*(T *)(((ap) += (_bnd (T, _AUPBND))) - (_bnd (T,_ADNBND)))) |
302 | #define va_end(ap) (void) 0 | 368 | #define va_end(ap) (ap = (va_list) NULL) |
303 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) | 369 | #define va_start(ap, A) (void) ((ap) = (((char *) &(A)) + (_bnd (A,_AUPBND)))) |
304 | 370 | ||
305 | #endif /* va_arg */ | 371 | #endif /* va_arg */ |
306 | 372 | ||
373 | /* Use the local (ACPICA) definitions of the clib functions */ | ||
374 | |||
307 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) | 375 | #define ACPI_STRSTR(s1,s2) acpi_ut_strstr ((s1), (s2)) |
308 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) | 376 | #define ACPI_STRCHR(s1,c) acpi_ut_strchr ((s1), (c)) |
309 | #define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) | 377 | #define ACPI_STRLEN(s) (acpi_size) acpi_ut_strlen ((s)) |
@@ -322,59 +390,4 @@ typedef char *va_list; | |||
322 | 390 | ||
323 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ | 391 | #endif /* ACPI_USE_SYSTEM_CLIBRARY */ |
324 | 392 | ||
325 | /****************************************************************************** | ||
326 | * | ||
327 | * Assembly code macros | ||
328 | * | ||
329 | *****************************************************************************/ | ||
330 | |||
331 | /* | ||
332 | * Handle platform- and compiler-specific assembly language differences. | ||
333 | * These should already have been defined by the platform includes above. | ||
334 | * | ||
335 | * Notes: | ||
336 | * 1) Interrupt 3 is used to break into a debugger | ||
337 | * 2) Interrupts are turned off during ACPI register setup | ||
338 | */ | ||
339 | |||
340 | /* Unrecognized compiler, use defaults */ | ||
341 | |||
342 | #ifndef ACPI_ASM_MACROS | ||
343 | |||
344 | /* | ||
345 | * Calling conventions: | ||
346 | * | ||
347 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | ||
348 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | ||
349 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | ||
350 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | ||
351 | */ | ||
352 | #define ACPI_SYSTEM_XFACE | ||
353 | #define ACPI_EXTERNAL_XFACE | ||
354 | #define ACPI_INTERNAL_XFACE | ||
355 | #define ACPI_INTERNAL_VAR_XFACE | ||
356 | |||
357 | #define ACPI_ASM_MACROS | ||
358 | #define BREAKPOINT3 | ||
359 | #define ACPI_DISABLE_IRQS() | ||
360 | #define ACPI_ENABLE_IRQS() | ||
361 | #define ACPI_ACQUIRE_GLOBAL_LOCK(Glptr, acq) | ||
362 | #define ACPI_RELEASE_GLOBAL_LOCK(Glptr, acq) | ||
363 | |||
364 | #endif /* ACPI_ASM_MACROS */ | ||
365 | |||
366 | #ifdef ACPI_APPLICATION | ||
367 | |||
368 | /* Don't want software interrupts within a ring3 application */ | ||
369 | |||
370 | #undef BREAKPOINT3 | ||
371 | #define BREAKPOINT3 | ||
372 | #endif | ||
373 | |||
374 | /****************************************************************************** | ||
375 | * | ||
376 | * Compiler-specific information is contained in the compiler-specific | ||
377 | * headers. | ||
378 | * | ||
379 | *****************************************************************************/ | ||
380 | #endif /* __ACENV_H__ */ | 393 | #endif /* __ACENV_H__ */ |
diff --git a/include/acpi/platform/acgcc.h b/include/acpi/platform/acgcc.h index 72553b0c9f33..e077ce6c38ca 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -64,8 +64,4 @@ | |||
64 | */ | 64 | */ |
65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) | 65 | #define ACPI_UNUSED_VAR __attribute__ ((unused)) |
66 | 66 | ||
67 | #ifdef _ANSI | ||
68 | #define inline | ||
69 | #endif | ||
70 | |||
71 | #endif /* __ACGCC_H__ */ | 67 | #endif /* __ACGCC_H__ */ |
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h index 85d5d8f38452..68534ef86ec8 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 - 2012, Intel Corp. | 8 | * Copyright (C) 2000 - 2013, 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 |
@@ -108,7 +108,6 @@ | |||
108 | 108 | ||
109 | #include <acpi/platform/acgcc.h> | 109 | #include <acpi/platform/acgcc.h> |
110 | 110 | ||
111 | |||
112 | #ifdef __KERNEL__ | 111 | #ifdef __KERNEL__ |
113 | #include <acpi/actypes.h> | 112 | #include <acpi/actypes.h> |
114 | /* | 113 | /* |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 3994d7790b23..bcbdd7484e58 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -74,9 +74,10 @@ enum acpi_address_range_id { | |||
74 | 74 | ||
75 | /* Table Handlers */ | 75 | /* Table Handlers */ |
76 | 76 | ||
77 | typedef int (*acpi_table_handler) (struct acpi_table_header *table); | 77 | typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table); |
78 | 78 | ||
79 | typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); | 79 | typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header, |
80 | const unsigned long end); | ||
80 | 81 | ||
81 | #ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE | 82 | #ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE |
82 | void acpi_initrd_override(void *data, size_t size); | 83 | void acpi_initrd_override(void *data, size_t size); |
@@ -95,10 +96,14 @@ int acpi_mps_check (void); | |||
95 | int acpi_numa_init (void); | 96 | int acpi_numa_init (void); |
96 | 97 | ||
97 | int acpi_table_init (void); | 98 | int acpi_table_init (void); |
98 | int acpi_table_parse (char *id, acpi_table_handler handler); | 99 | int acpi_table_parse(char *id, acpi_tbl_table_handler handler); |
99 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, | 100 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, |
100 | int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); | 101 | int entry_id, |
101 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); | 102 | acpi_tbl_entry_handler handler, |
103 | unsigned int max_entries); | ||
104 | int acpi_table_parse_madt(enum acpi_madt_type id, | ||
105 | acpi_tbl_entry_handler handler, | ||
106 | unsigned int max_entries); | ||
102 | int acpi_parse_mcfg (struct acpi_table_header *header); | 107 | int acpi_parse_mcfg (struct acpi_table_header *header); |
103 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); | 108 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); |
104 | 109 | ||
@@ -358,8 +363,7 @@ extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, | |||
358 | #if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ | 363 | #if defined(CONFIG_ACPI_HOTPLUG_CPU) && \ |
359 | (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \ | 364 | (defined(CONFIG_ACPI_HOTPLUG_MEMORY) || \ |
360 | defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \ | 365 | defined(CONFIG_ACPI_HOTPLUG_MEMORY_MODULE)) && \ |
361 | (defined(CONFIG_ACPI_CONTAINER) || \ | 366 | defined(CONFIG_ACPI_CONTAINER) |
362 | defined(CONFIG_ACPI_CONTAINER_MODULE)) | ||
363 | #define ACPI_HOTPLUG_OST | 367 | #define ACPI_HOTPLUG_OST |
364 | #endif | 368 | #endif |
365 | 369 | ||
@@ -511,7 +515,7 @@ static inline int acpi_subsys_runtime_suspend(struct device *dev) { return 0; } | |||
511 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } | 515 | static inline int acpi_subsys_runtime_resume(struct device *dev) { return 0; } |
512 | #endif | 516 | #endif |
513 | 517 | ||
514 | #ifdef CONFIG_ACPI_SLEEP | 518 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM_SLEEP) |
515 | int acpi_dev_suspend_late(struct device *dev); | 519 | int acpi_dev_suspend_late(struct device *dev); |
516 | int acpi_dev_resume_early(struct device *dev); | 520 | int acpi_dev_resume_early(struct device *dev); |
517 | int acpi_subsys_prepare(struct device *dev); | 521 | int acpi_subsys_prepare(struct device *dev); |
@@ -526,9 +530,14 @@ static inline int acpi_subsys_resume_early(struct device *dev) { return 0; } | |||
526 | #endif | 530 | #endif |
527 | 531 | ||
528 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) | 532 | #if defined(CONFIG_ACPI) && defined(CONFIG_PM) |
533 | struct acpi_device *acpi_dev_pm_get_node(struct device *dev); | ||
529 | int acpi_dev_pm_attach(struct device *dev, bool power_on); | 534 | int acpi_dev_pm_attach(struct device *dev, bool power_on); |
530 | void acpi_dev_pm_detach(struct device *dev, bool power_off); | 535 | void acpi_dev_pm_detach(struct device *dev, bool power_off); |
531 | #else | 536 | #else |
537 | static inline struct acpi_device *acpi_dev_pm_get_node(struct device *dev) | ||
538 | { | ||
539 | return NULL; | ||
540 | } | ||
532 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) | 541 | static inline int acpi_dev_pm_attach(struct device *dev, bool power_on) |
533 | { | 542 | { |
534 | return -ENODEV; | 543 | return -ENODEV; |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index a55b88eaf96a..a22944ca0526 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -89,11 +89,15 @@ struct cpufreq_real_policy { | |||
89 | }; | 89 | }; |
90 | 90 | ||
91 | struct cpufreq_policy { | 91 | struct cpufreq_policy { |
92 | cpumask_var_t cpus; /* CPUs requiring sw coordination */ | 92 | /* CPUs sharing clock, require sw coordination */ |
93 | cpumask_var_t related_cpus; /* CPUs with any coordination */ | 93 | cpumask_var_t cpus; /* Online CPUs only */ |
94 | unsigned int shared_type; /* ANY or ALL affected CPUs | 94 | cpumask_var_t related_cpus; /* Online + Offline CPUs */ |
95 | |||
96 | unsigned int shared_type; /* ACPI: ANY or ALL affected CPUs | ||
95 | should set cpufreq */ | 97 | should set cpufreq */ |
96 | unsigned int cpu; /* cpu nr of registered CPU */ | 98 | unsigned int cpu; /* cpu nr of CPU managing this policy */ |
99 | unsigned int last_cpu; /* cpu nr of previous CPU that managed | ||
100 | * this policy */ | ||
97 | struct cpufreq_cpuinfo cpuinfo;/* see above */ | 101 | struct cpufreq_cpuinfo cpuinfo;/* see above */ |
98 | 102 | ||
99 | unsigned int min; /* in kHz */ | 103 | unsigned int min; /* in kHz */ |
@@ -112,16 +116,23 @@ struct cpufreq_policy { | |||
112 | struct completion kobj_unregister; | 116 | struct completion kobj_unregister; |
113 | }; | 117 | }; |
114 | 118 | ||
115 | #define CPUFREQ_ADJUST (0) | 119 | #define CPUFREQ_ADJUST (0) |
116 | #define CPUFREQ_INCOMPATIBLE (1) | 120 | #define CPUFREQ_INCOMPATIBLE (1) |
117 | #define CPUFREQ_NOTIFY (2) | 121 | #define CPUFREQ_NOTIFY (2) |
118 | #define CPUFREQ_START (3) | 122 | #define CPUFREQ_START (3) |
123 | #define CPUFREQ_UPDATE_POLICY_CPU (4) | ||
119 | 124 | ||
125 | /* Only for ACPI */ | ||
120 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ | 126 | #define CPUFREQ_SHARED_TYPE_NONE (0) /* None */ |
121 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ | 127 | #define CPUFREQ_SHARED_TYPE_HW (1) /* HW does needed coordination */ |
122 | #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ | 128 | #define CPUFREQ_SHARED_TYPE_ALL (2) /* All dependent CPUs should set freq */ |
123 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ | 129 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ |
124 | 130 | ||
131 | static inline bool policy_is_shared(struct cpufreq_policy *policy) | ||
132 | { | ||
133 | return cpumask_weight(policy->cpus) > 1; | ||
134 | } | ||
135 | |||
125 | /******************** cpufreq transition notifiers *******************/ | 136 | /******************** cpufreq transition notifiers *******************/ |
126 | 137 | ||
127 | #define CPUFREQ_PRECHANGE (0) | 138 | #define CPUFREQ_PRECHANGE (0) |
@@ -173,6 +184,7 @@ static inline unsigned long cpufreq_scale(unsigned long old, u_int div, u_int mu | |||
173 | 184 | ||
174 | struct cpufreq_governor { | 185 | struct cpufreq_governor { |
175 | char name[CPUFREQ_NAME_LEN]; | 186 | char name[CPUFREQ_NAME_LEN]; |
187 | int initialized; | ||
176 | int (*governor) (struct cpufreq_policy *policy, | 188 | int (*governor) (struct cpufreq_policy *policy, |
177 | unsigned int event); | 189 | unsigned int event); |
178 | ssize_t (*show_setspeed) (struct cpufreq_policy *policy, | 190 | ssize_t (*show_setspeed) (struct cpufreq_policy *policy, |
@@ -308,6 +320,9 @@ __ATTR(_name, 0444, show_##_name, NULL) | |||
308 | static struct global_attr _name = \ | 320 | static struct global_attr _name = \ |
309 | __ATTR(_name, 0644, show_##_name, store_##_name) | 321 | __ATTR(_name, 0644, show_##_name, store_##_name) |
310 | 322 | ||
323 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); | ||
324 | void cpufreq_cpu_put(struct cpufreq_policy *data); | ||
325 | const char *cpufreq_get_current_driver(void); | ||
311 | 326 | ||
312 | /********************************************************************* | 327 | /********************************************************************* |
313 | * CPUFREQ 2.6. INTERFACE * | 328 | * CPUFREQ 2.6. INTERFACE * |
@@ -397,14 +412,13 @@ int cpufreq_frequency_table_target(struct cpufreq_policy *policy, | |||
397 | 412 | ||
398 | /* the following 3 funtions are for cpufreq core use only */ | 413 | /* the following 3 funtions are for cpufreq core use only */ |
399 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); | 414 | struct cpufreq_frequency_table *cpufreq_frequency_get_table(unsigned int cpu); |
400 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); | ||
401 | void cpufreq_cpu_put(struct cpufreq_policy *data); | ||
402 | 415 | ||
403 | /* the following are really really optional */ | 416 | /* the following are really really optional */ |
404 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; | 417 | extern struct freq_attr cpufreq_freq_attr_scaling_available_freqs; |
405 | 418 | ||
406 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, | 419 | void cpufreq_frequency_table_get_attr(struct cpufreq_frequency_table *table, |
407 | unsigned int cpu); | 420 | unsigned int cpu); |
421 | void cpufreq_frequency_table_update_policy_cpu(struct cpufreq_policy *policy); | ||
408 | 422 | ||
409 | void cpufreq_frequency_table_put_attr(unsigned int cpu); | 423 | void cpufreq_frequency_table_put_attr(unsigned int cpu); |
410 | #endif /* _LINUX_CPUFREQ_H */ | 424 | #endif /* _LINUX_CPUFREQ_H */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 24cd1037b6d6..480c14dc1ddd 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -32,8 +32,6 @@ struct cpuidle_driver; | |||
32 | ****************************/ | 32 | ****************************/ |
33 | 33 | ||
34 | struct cpuidle_state_usage { | 34 | struct cpuidle_state_usage { |
35 | void *driver_data; | ||
36 | |||
37 | unsigned long long disable; | 35 | unsigned long long disable; |
38 | unsigned long long usage; | 36 | unsigned long long usage; |
39 | unsigned long long time; /* in US */ | 37 | unsigned long long time; /* in US */ |
@@ -62,26 +60,6 @@ struct cpuidle_state { | |||
62 | 60 | ||
63 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) | 61 | #define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) |
64 | 62 | ||
65 | /** | ||
66 | * cpuidle_get_statedata - retrieves private driver state data | ||
67 | * @st_usage: the state usage statistics | ||
68 | */ | ||
69 | static inline void *cpuidle_get_statedata(struct cpuidle_state_usage *st_usage) | ||
70 | { | ||
71 | return st_usage->driver_data; | ||
72 | } | ||
73 | |||
74 | /** | ||
75 | * cpuidle_set_statedata - stores private driver state data | ||
76 | * @st_usage: the state usage statistics | ||
77 | * @data: the private data | ||
78 | */ | ||
79 | static inline void | ||
80 | cpuidle_set_statedata(struct cpuidle_state_usage *st_usage, void *data) | ||
81 | { | ||
82 | st_usage->driver_data = data; | ||
83 | } | ||
84 | |||
85 | struct cpuidle_device { | 63 | struct cpuidle_device { |
86 | unsigned int registered:1; | 64 | unsigned int registered:1; |
87 | unsigned int enabled:1; | 65 | unsigned int enabled:1; |
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index e4238ceaa4d6..e70df40d84f6 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -13,6 +13,11 @@ extern bool pm_freezing; /* PM freezing in effect */ | |||
13 | extern bool pm_nosig_freezing; /* PM nosig freezing in effect */ | 13 | extern bool pm_nosig_freezing; /* PM nosig freezing in effect */ |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Timeout for stopping processes | ||
17 | */ | ||
18 | extern unsigned int freeze_timeout_msecs; | ||
19 | |||
20 | /* | ||
16 | * Check if a process has been frozen | 21 | * Check if a process has been frozen |
17 | */ | 22 | */ |
18 | static inline bool frozen(struct task_struct *p) | 23 | static inline bool frozen(struct task_struct *p) |
diff --git a/include/linux/mailbox.h b/include/linux/mailbox.h new file mode 100644 index 000000000000..5161f63ec1c8 --- /dev/null +++ b/include/linux/mailbox.h | |||
@@ -0,0 +1,17 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify it | ||
3 | * under the terms and conditions of the GNU General Public License, | ||
4 | * version 2, as published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
7 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
8 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
9 | * more details. | ||
10 | * | ||
11 | * You should have received a copy of the GNU General Public License along with | ||
12 | * this program. If not, see <http://www.gnu.org/licenses/>. | ||
13 | */ | ||
14 | |||
15 | int pl320_ipc_transmit(u32 *data); | ||
16 | int pl320_ipc_register_notifier(struct notifier_block *nb); | ||
17 | int pl320_ipc_unregister_notifier(struct notifier_block *nb); | ||
diff --git a/include/linux/pm.h b/include/linux/pm.h index 03d7bb145311..97bcf23e045a 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -31,7 +31,6 @@ | |||
31 | /* | 31 | /* |
32 | * Callbacks for platform drivers to implement. | 32 | * Callbacks for platform drivers to implement. |
33 | */ | 33 | */ |
34 | extern void (*pm_idle)(void); | ||
35 | extern void (*pm_power_off)(void); | 34 | extern void (*pm_power_off)(void); |
36 | extern void (*pm_power_off_prepare)(void); | 35 | extern void (*pm_power_off_prepare)(void); |
37 | 36 | ||
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index f271860c78d5..c785c215abfc 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -80,6 +80,12 @@ static inline bool pm_runtime_suspended(struct device *dev) | |||
80 | && !dev->power.disable_depth; | 80 | && !dev->power.disable_depth; |
81 | } | 81 | } |
82 | 82 | ||
83 | static inline bool pm_runtime_active(struct device *dev) | ||
84 | { | ||
85 | return dev->power.runtime_status == RPM_ACTIVE | ||
86 | || dev->power.disable_depth; | ||
87 | } | ||
88 | |||
83 | static inline bool pm_runtime_status_suspended(struct device *dev) | 89 | static inline bool pm_runtime_status_suspended(struct device *dev) |
84 | { | 90 | { |
85 | return dev->power.runtime_status == RPM_SUSPENDED; | 91 | return dev->power.runtime_status == RPM_SUSPENDED; |
@@ -132,6 +138,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {} | |||
132 | static inline bool device_run_wake(struct device *dev) { return false; } | 138 | static inline bool device_run_wake(struct device *dev) { return false; } |
133 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | 139 | static inline void device_set_run_wake(struct device *dev, bool enable) {} |
134 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } | 140 | static inline bool pm_runtime_suspended(struct device *dev) { return false; } |
141 | static inline bool pm_runtime_active(struct device *dev) { return true; } | ||
135 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } | 142 | static inline bool pm_runtime_status_suspended(struct device *dev) { return false; } |
136 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } | 143 | static inline bool pm_runtime_enabled(struct device *dev) { return false; } |
137 | 144 | ||
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 0c808d7fa579..d4e3f16d5e89 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -34,8 +34,10 @@ static inline void pm_restore_console(void) | |||
34 | typedef int __bitwise suspend_state_t; | 34 | typedef int __bitwise suspend_state_t; |
35 | 35 | ||
36 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) | 36 | #define PM_SUSPEND_ON ((__force suspend_state_t) 0) |
37 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 1) | 37 | #define PM_SUSPEND_FREEZE ((__force suspend_state_t) 1) |
38 | #define PM_SUSPEND_STANDBY ((__force suspend_state_t) 2) | ||
38 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) | 39 | #define PM_SUSPEND_MEM ((__force suspend_state_t) 3) |
40 | #define PM_SUSPEND_MIN PM_SUSPEND_FREEZE | ||
39 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) | 41 | #define PM_SUSPEND_MAX ((__force suspend_state_t) 4) |
40 | 42 | ||
41 | enum suspend_stat_step { | 43 | enum suspend_stat_step { |
@@ -192,6 +194,7 @@ struct platform_suspend_ops { | |||
192 | */ | 194 | */ |
193 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); | 195 | extern void suspend_set_ops(const struct platform_suspend_ops *ops); |
194 | extern int suspend_valid_only_mem(suspend_state_t state); | 196 | extern int suspend_valid_only_mem(suspend_state_t state); |
197 | extern void freeze_wake(void); | ||
195 | 198 | ||
196 | /** | 199 | /** |
197 | * arch_suspend_disable_irqs - disable IRQs for suspend | 200 | * arch_suspend_disable_irqs - disable IRQs for suspend |
@@ -217,6 +220,7 @@ extern int pm_suspend(suspend_state_t state); | |||
217 | 220 | ||
218 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} | 221 | static inline void suspend_set_ops(const struct platform_suspend_ops *ops) {} |
219 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } | 222 | static inline int pm_suspend(suspend_state_t state) { return -ENOSYS; } |
223 | static inline void freeze_wake(void) {} | ||
220 | #endif /* !CONFIG_SUSPEND */ | 224 | #endif /* !CONFIG_SUSPEND */ |
221 | 225 | ||
222 | /* struct pbe is used for creating lists of pages that should be restored | 226 | /* struct pbe is used for creating lists of pages that should be restored |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 381f06db2fe5..e2cee22f578a 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -181,6 +181,10 @@ int sysfs_merge_group(struct kobject *kobj, | |||
181 | const struct attribute_group *grp); | 181 | const struct attribute_group *grp); |
182 | void sysfs_unmerge_group(struct kobject *kobj, | 182 | void sysfs_unmerge_group(struct kobject *kobj, |
183 | const struct attribute_group *grp); | 183 | const struct attribute_group *grp); |
184 | int sysfs_add_link_to_group(struct kobject *kobj, const char *group_name, | ||
185 | struct kobject *target, const char *link_name); | ||
186 | void sysfs_remove_link_from_group(struct kobject *kobj, const char *group_name, | ||
187 | const char *link_name); | ||
184 | 188 | ||
185 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); | 189 | void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); |
186 | void sysfs_notify_dirent(struct sysfs_dirent *sd); | 190 | void sysfs_notify_dirent(struct sysfs_dirent *sd); |
@@ -326,6 +330,18 @@ static inline void sysfs_unmerge_group(struct kobject *kobj, | |||
326 | { | 330 | { |
327 | } | 331 | } |
328 | 332 | ||
333 | static inline int sysfs_add_link_to_group(struct kobject *kobj, | ||
334 | const char *group_name, struct kobject *target, | ||
335 | const char *link_name) | ||
336 | { | ||
337 | return 0; | ||
338 | } | ||
339 | |||
340 | static inline void sysfs_remove_link_from_group(struct kobject *kobj, | ||
341 | const char *group_name, const char *link_name) | ||
342 | { | ||
343 | } | ||
344 | |||
329 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, | 345 | static inline void sysfs_notify(struct kobject *kobj, const char *dir, |
330 | const char *attr) | 346 | const char *attr) |
331 | { | 347 | { |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index 0c9783841a30..427acab5d69a 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -99,98 +99,6 @@ DEFINE_EVENT(wakeup_source, wakeup_source_deactivate, | |||
99 | TP_ARGS(name, state) | 99 | TP_ARGS(name, state) |
100 | ); | 100 | ); |
101 | 101 | ||
102 | #ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED | ||
103 | |||
104 | /* | ||
105 | * The power events are used for cpuidle & suspend (power_start, power_end) | ||
106 | * and for cpufreq (power_frequency) | ||
107 | */ | ||
108 | DECLARE_EVENT_CLASS(power, | ||
109 | |||
110 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
111 | |||
112 | TP_ARGS(type, state, cpu_id), | ||
113 | |||
114 | TP_STRUCT__entry( | ||
115 | __field( u64, type ) | ||
116 | __field( u64, state ) | ||
117 | __field( u64, cpu_id ) | ||
118 | ), | ||
119 | |||
120 | TP_fast_assign( | ||
121 | __entry->type = type; | ||
122 | __entry->state = state; | ||
123 | __entry->cpu_id = cpu_id; | ||
124 | ), | ||
125 | |||
126 | TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type, | ||
127 | (unsigned long)__entry->state, (unsigned long)__entry->cpu_id) | ||
128 | ); | ||
129 | |||
130 | DEFINE_EVENT(power, power_start, | ||
131 | |||
132 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
133 | |||
134 | TP_ARGS(type, state, cpu_id) | ||
135 | ); | ||
136 | |||
137 | DEFINE_EVENT(power, power_frequency, | ||
138 | |||
139 | TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id), | ||
140 | |||
141 | TP_ARGS(type, state, cpu_id) | ||
142 | ); | ||
143 | |||
144 | TRACE_EVENT(power_end, | ||
145 | |||
146 | TP_PROTO(unsigned int cpu_id), | ||
147 | |||
148 | TP_ARGS(cpu_id), | ||
149 | |||
150 | TP_STRUCT__entry( | ||
151 | __field( u64, cpu_id ) | ||
152 | ), | ||
153 | |||
154 | TP_fast_assign( | ||
155 | __entry->cpu_id = cpu_id; | ||
156 | ), | ||
157 | |||
158 | TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id) | ||
159 | |||
160 | ); | ||
161 | |||
162 | /* Deprecated dummy functions must be protected against multi-declartion */ | ||
163 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
164 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
165 | |||
166 | enum { | ||
167 | POWER_NONE = 0, | ||
168 | POWER_CSTATE = 1, | ||
169 | POWER_PSTATE = 2, | ||
170 | }; | ||
171 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
172 | |||
173 | #else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
174 | |||
175 | #ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
176 | #define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED | ||
177 | enum { | ||
178 | POWER_NONE = 0, | ||
179 | POWER_CSTATE = 1, | ||
180 | POWER_PSTATE = 2, | ||
181 | }; | ||
182 | |||
183 | /* These dummy declaration have to be ripped out when the deprecated | ||
184 | events get removed */ | ||
185 | static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {}; | ||
186 | static inline void trace_power_end(u64 cpuid) {}; | ||
187 | static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {}; | ||
188 | static inline void trace_power_end_rcuidle(u64 cpuid) {}; | ||
189 | static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {}; | ||
190 | #endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */ | ||
191 | |||
192 | #endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */ | ||
193 | |||
194 | /* | 102 | /* |
195 | * The clock events are used for clock enable/disable and for | 103 | * The clock events are used for clock enable/disable and for |
196 | * clock rate change | 104 | * clock rate change |