aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 23:34:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-06 23:34:19 -0400
commit7725131982477bffff8ffdea143434dcc69f5d90 (patch)
tree099440f6a8b11c8221ea99effec4c22818b3b577 /include
parent6b22df74f7af62137772c280791c932855f7635b (diff)
parent7ef97e0e3a0f4b02601dde384127cc85d27e46e2 (diff)
Merge tag 'pm+acpi-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael Wysocki: "Again, ACPICA leads the pack (47 commits), followed by cpufreq (18 commits) and system suspend/hibernation (9 commits). From the new code perspective, the ACPICA update brings ACPI 5.1 to the table, including a new device configuration object called _DSD (Device Specific Data) that will hopefully help us to operate device properties like Device Trees do (at least to some extent) and changes related to supporting ACPI on ARM. Apart from that we have hibernation changes making it use radix trees to store memory bitmaps which should speed up some operations carried out by it quite significantly. We also have some power management changes related to suspend-to-idle (the "freeze" sleep state) support and more preliminary changes needed to support ACPI on ARM (outside of ACPICA). The rest is fixes and cleanups pretty much everywhere. Specifics: - ACPICA update to upstream version 20140724. That includes ACPI 5.1 material (support for the _CCA and _DSD predefined names, changes related to the DMAR and PCCT tables and ARM support among other things) and cleanups related to using ACPICA's header files. A major part of it is related to acpidump and the core code used by that utility. Changes from Bob Moore, David E Box, Lv Zheng, Sascha Wildner, Tomasz Nowicki, Hanjun Guo. - Radix trees for memory bitmaps used by the hibernation core from Joerg Roedel. - Support for waking up the system from suspend-to-idle (also known as the "freeze" sleep state) using ACPI-based PCI wakeup signaling (Rafael J Wysocki). - Fixes for issues related to ACPI button events (Rafael J Wysocki). - New device ID for an ACPI-enumerated device included into the Wildcat Point PCH from Jie Yang. - ACPI video updates related to backlight handling from Hans de Goede and Linus Torvalds. - Preliminary changes needed to support ACPI on ARM from Hanjun Guo and Graeme Gregory. - ACPI PNP core cleanups from Arjun Sreedharan and Zhang Rui. - Cleanups related to ACPI_COMPANION() and ACPI_HANDLE() macros (Rafael J Wysocki). - ACPI-based device hotplug cleanups from Wei Yongjun and Rafael J Wysocki. - Cleanups and improvements related to system suspend from Lan Tianyu, Randy Dunlap and Rafael J Wysocki. - ACPI battery cleanup from Wei Yongjun. - cpufreq core fixes from Viresh Kumar. - Elimination of a deadband effect from the cpufreq ondemand governor and intel_pstate driver cleanups from Stratos Karafotis. - 350MHz CPU support for the powernow-k6 cpufreq driver from Mikulas Patocka. - Fix for the imx6 cpufreq driver from Anson Huang. - cpuidle core and governor cleanups from Daniel Lezcano, Sandeep Tripathy and Mohammad Merajul Islam Molla. - Build fix for the big_little cpuidle driver from Sachin Kamat. - Configuration fix for the Operation Performance Points (OPP) framework from Mark Brown. - APM cleanup from Jean Delvare. - cpupower utility fixes and cleanups from Peter Senna Tschudin, Andrey Utkin, Himangi Saraogi, Rickard Strandqvist, Thomas Renninger" * tag 'pm+acpi-3.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (118 commits) ACPI / LPSS: add LPSS device for Wildcat Point PCH ACPI / PNP: Replace faulty is_hex_digit() by isxdigit() ACPICA: Update version to 20140724. ACPICA: ACPI 5.1: Update for PCCT table changes. ACPICA/ARM: ACPI 5.1: Update for GTDT table changes. ACPICA/ARM: ACPI 5.1: Update for MADT changes. ACPICA/ARM: ACPI 5.1: Update for FADT changes. ACPICA: ACPI 5.1: Support for the _CCA predifined name. ACPICA: ACPI 5.1: New notify value for System Affinity Update. ACPICA: ACPI 5.1: Support for the _DSD predefined name. ACPICA: Debug object: Add current value of Timer() to debug line prefix. ACPICA: acpihelp: Add UUID support, restructure some existing files. ACPICA: Utilities: Fix local printf issue. ACPICA: Tables: Update for DMAR table changes. ACPICA: Remove some extraneous printf arguments. ACPICA: Update for comments/formatting. No functional changes. ACPICA: Disassembler: Add support for the ToUUID opererator (macro). ACPICA: Remove a redundant cast to acpi_size for ACPI_OFFSET() macro. ACPICA: Work around an ancient GCC bug. ACPI / processor: Make it possible to get local x2apic id via _MAT ...
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acconfig.h18
-rw-r--r--include/acpi/acnames.h1
-rw-r--r--include/acpi/acpi_bus.h42
-rw-r--r--include/acpi/acpiosxf.h31
-rw-r--r--include/acpi/acpixf.h54
-rw-r--r--include/acpi/actbl.h12
-rw-r--r--include/acpi/actbl1.h58
-rw-r--r--include/acpi/actbl2.h14
-rw-r--r--include/acpi/actbl3.h118
-rw-r--r--include/acpi/actypes.h19
-rw-r--r--include/acpi/ghes.h2
-rw-r--r--include/acpi/platform/acenv.h53
-rw-r--r--include/acpi/platform/aclinux.h12
-rw-r--r--include/acpi/platform/aclinuxex.h22
-rw-r--r--include/linux/acpi.h6
-rw-r--r--include/linux/cpufreq.h1
-rw-r--r--include/linux/pci-acpi.h13
-rw-r--r--include/linux/pm_runtime.h11
-rw-r--r--include/linux/sfi_acpi.h3
19 files changed, 389 insertions, 101 deletions
diff --git a/include/acpi/acconfig.h b/include/acpi/acconfig.h
index 932a60d6ed82..5a0a3e5daf85 100644
--- a/include/acpi/acconfig.h
+++ b/include/acpi/acconfig.h
@@ -219,6 +219,24 @@
219 219
220/****************************************************************************** 220/******************************************************************************
221 * 221 *
222 * Miscellaneous constants
223 *
224 *****************************************************************************/
225
226/* UUID constants */
227
228#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */
229#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */
230
231/* Positions for required hyphens (dashes) in UUID strings */
232
233#define UUID_HYPHEN1_OFFSET 8
234#define UUID_HYPHEN2_OFFSET 13
235#define UUID_HYPHEN3_OFFSET 18
236#define UUID_HYPHEN4_OFFSET 23
237
238/******************************************************************************
239 *
222 * ACPI AML Debugger 240 * ACPI AML Debugger
223 * 241 *
224 *****************************************************************************/ 242 *****************************************************************************/
diff --git a/include/acpi/acnames.h b/include/acpi/acnames.h
index 3dd6e838dc30..c728113374f5 100644
--- a/include/acpi/acnames.h
+++ b/include/acpi/acnames.h
@@ -55,6 +55,7 @@
55#define METHOD_NAME__HID "_HID" 55#define METHOD_NAME__HID "_HID"
56#define METHOD_NAME__INI "_INI" 56#define METHOD_NAME__INI "_INI"
57#define METHOD_NAME__PLD "_PLD" 57#define METHOD_NAME__PLD "_PLD"
58#define METHOD_NAME__DSD "_DSD"
58#define METHOD_NAME__PRS "_PRS" 59#define METHOD_NAME__PRS "_PRS"
59#define METHOD_NAME__PRT "_PRT" 60#define METHOD_NAME__PRT "_PRT"
60#define METHOD_NAME__PRW "_PRW" 61#define METHOD_NAME__PRW "_PRW"
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index b5714580801a..bcfd808b1098 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -315,12 +315,19 @@ struct acpi_device_wakeup_flags {
315 u8 notifier_present:1; /* Wake-up notify handler has been installed */ 315 u8 notifier_present:1; /* Wake-up notify handler has been installed */
316}; 316};
317 317
318struct acpi_device_wakeup_context {
319 struct work_struct work;
320 struct device *dev;
321};
322
318struct acpi_device_wakeup { 323struct acpi_device_wakeup {
319 acpi_handle gpe_device; 324 acpi_handle gpe_device;
320 u64 gpe_number; 325 u64 gpe_number;
321 u64 sleep_state; 326 u64 sleep_state;
322 struct list_head resources; 327 struct list_head resources;
323 struct acpi_device_wakeup_flags flags; 328 struct acpi_device_wakeup_flags flags;
329 struct acpi_device_wakeup_context context;
330 struct wakeup_source *ws;
324 int prepare_count; 331 int prepare_count;
325}; 332};
326 333
@@ -372,15 +379,9 @@ static inline void acpi_set_device_status(struct acpi_device *adev, u32 sta)
372} 379}
373 380
374static inline void acpi_set_hp_context(struct acpi_device *adev, 381static inline void acpi_set_hp_context(struct acpi_device *adev,
375 struct acpi_hotplug_context *hp, 382 struct acpi_hotplug_context *hp)
376 int (*notify)(struct acpi_device *, u32),
377 void (*uevent)(struct acpi_device *, u32),
378 void (*fixup)(struct acpi_device *))
379{ 383{
380 hp->self = adev; 384 hp->self = adev;
381 hp->notify = notify;
382 hp->uevent = uevent;
383 hp->fixup = fixup;
384 adev->hp = hp; 385 adev->hp = hp;
385} 386}
386 387
@@ -487,6 +488,8 @@ struct acpi_bus_type {
487}; 488};
488int register_acpi_bus_type(struct acpi_bus_type *); 489int register_acpi_bus_type(struct acpi_bus_type *);
489int unregister_acpi_bus_type(struct acpi_bus_type *); 490int unregister_acpi_bus_type(struct acpi_bus_type *);
491int acpi_bind_one(struct device *dev, struct acpi_device *adev);
492int acpi_unbind_one(struct device *dev);
490 493
491struct acpi_pci_root { 494struct acpi_pci_root {
492 struct acpi_device * device; 495 struct acpi_device * device;
@@ -510,20 +513,18 @@ int acpi_enable_wakeup_device_power(struct acpi_device *dev, int state);
510int acpi_disable_wakeup_device_power(struct acpi_device *dev); 513int acpi_disable_wakeup_device_power(struct acpi_device *dev);
511 514
512#ifdef CONFIG_PM 515#ifdef CONFIG_PM
513acpi_status acpi_add_pm_notifier(struct acpi_device *adev, 516acpi_status acpi_add_pm_notifier(struct acpi_device *adev, struct device *dev,
514 acpi_notify_handler handler, void *context); 517 void (*work_func)(struct work_struct *work));
515acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 518acpi_status acpi_remove_pm_notifier(struct acpi_device *adev);
516 acpi_notify_handler handler);
517int acpi_pm_device_sleep_state(struct device *, int *, int); 519int acpi_pm_device_sleep_state(struct device *, int *, int);
518#else 520#else
519static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev, 521static inline acpi_status acpi_add_pm_notifier(struct acpi_device *adev,
520 acpi_notify_handler handler, 522 struct device *dev,
521 void *context) 523 void (*work_func)(struct work_struct *work))
522{ 524{
523 return AE_SUPPORT; 525 return AE_SUPPORT;
524} 526}
525static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev, 527static inline acpi_status acpi_remove_pm_notifier(struct acpi_device *adev)
526 acpi_notify_handler handler)
527{ 528{
528 return AE_SUPPORT; 529 return AE_SUPPORT;
529} 530}
@@ -538,13 +539,8 @@ static inline int acpi_pm_device_sleep_state(struct device *d, int *p, int m)
538#endif 539#endif
539 540
540#ifdef CONFIG_PM_RUNTIME 541#ifdef CONFIG_PM_RUNTIME
541int __acpi_device_run_wake(struct acpi_device *, bool);
542int acpi_pm_device_run_wake(struct device *, bool); 542int acpi_pm_device_run_wake(struct device *, bool);
543#else 543#else
544static inline int __acpi_device_run_wake(struct acpi_device *adev, bool en)
545{
546 return -ENODEV;
547}
548static inline int acpi_pm_device_run_wake(struct device *dev, bool enable) 544static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
549{ 545{
550 return -ENODEV; 546 return -ENODEV;
@@ -552,14 +548,8 @@ static inline int acpi_pm_device_run_wake(struct device *dev, bool enable)
552#endif 548#endif
553 549
554#ifdef CONFIG_PM_SLEEP 550#ifdef CONFIG_PM_SLEEP
555int __acpi_device_sleep_wake(struct acpi_device *, u32, bool);
556int acpi_pm_device_sleep_wake(struct device *, bool); 551int acpi_pm_device_sleep_wake(struct device *, bool);
557#else 552#else
558static inline int __acpi_device_sleep_wake(struct acpi_device *adev,
559 u32 target_state, bool enable)
560{
561 return -ENODEV;
562}
563static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable) 553static inline int acpi_pm_device_sleep_wake(struct device *dev, bool enable)
564{ 554{
565 return -ENODEV; 555 return -ENODEV;
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index f6f5f8af2112..03b3e6d405ff 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -399,4 +399,35 @@ char *acpi_os_get_next_filename(void *dir_handle);
399void acpi_os_close_directory(void *dir_handle); 399void acpi_os_close_directory(void *dir_handle);
400#endif 400#endif
401 401
402/*
403 * File I/O and related support
404 */
405#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_open_file
406ACPI_FILE acpi_os_open_file(const char *path, u8 modes);
407#endif
408
409#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_close_file
410void acpi_os_close_file(ACPI_FILE file);
411#endif
412
413#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_read_file
414int
415acpi_os_read_file(ACPI_FILE file,
416 void *buffer, acpi_size size, acpi_size count);
417#endif
418
419#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_write_file
420int
421acpi_os_write_file(ACPI_FILE file,
422 void *buffer, acpi_size size, acpi_size count);
423#endif
424
425#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_get_file_offset
426long acpi_os_get_file_offset(ACPI_FILE file);
427#endif
428
429#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_acpi_os_set_file_offset
430acpi_status acpi_os_set_file_offset(ACPI_FILE file, long offset, u8 from);
431#endif
432
402#endif /* __ACPIOSXF_H__ */ 433#endif /* __ACPIOSXF_H__ */
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 35b525c19711..b7c89d47efbe 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -46,15 +46,13 @@
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 0x20140424 49#define ACPI_CA_VERSION 0x20140724
50 50
51#include <acpi/acconfig.h> 51#include <acpi/acconfig.h>
52#include <acpi/actypes.h> 52#include <acpi/actypes.h>
53#include <acpi/actbl.h> 53#include <acpi/actbl.h>
54#include <acpi/acbuffer.h> 54#include <acpi/acbuffer.h>
55 55
56extern u8 acpi_gbl_permanent_mmap;
57
58/***************************************************************************** 56/*****************************************************************************
59 * 57 *
60 * Macros used for ACPICA globals and configuration 58 * Macros used for ACPICA globals and configuration
@@ -335,6 +333,23 @@ ACPI_GLOBAL(u8, acpi_gbl_system_awake_and_running);
335 333
336#endif /* ACPI_DEBUG_OUTPUT */ 334#endif /* ACPI_DEBUG_OUTPUT */
337 335
336/*
337 * Application prototypes
338 *
339 * All interfaces used by application will be configured
340 * out of the ACPICA build unless the ACPI_APPLICATION
341 * flag is defined.
342 */
343#ifdef ACPI_APPLICATION
344#define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
345 prototype;
346
347#else
348#define ACPI_APP_DEPENDENT_RETURN_VOID(prototype) \
349 static ACPI_INLINE prototype {return;}
350
351#endif /* ACPI_APPLICATION */
352
338/***************************************************************************** 353/*****************************************************************************
339 * 354 *
340 * ACPICA public interface prototypes 355 * ACPICA public interface prototypes
@@ -658,6 +673,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
658 u32 gpe_number)) 673 u32 gpe_number))
659 674
660ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 675ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
676 acpi_mark_gpe_for_wake(acpi_handle gpe_device,
677 u32 gpe_number))
678
679ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
661 acpi_setup_gpe_for_wake(acpi_handle 680 acpi_setup_gpe_for_wake(acpi_handle
662 parent_device, 681 parent_device,
663 acpi_handle gpe_device, 682 acpi_handle gpe_device,
@@ -861,21 +880,32 @@ ACPI_DBG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(6)
861 const char *module_name, 880 const char *module_name,
862 u32 component_id, 881 u32 component_id,
863 const char *format, ...)) 882 const char *format, ...))
883ACPI_APP_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(1)
884 void ACPI_INTERNAL_VAR_XFACE
885 acpi_log_error(const char *format, ...))
864 886
865/* 887/*
866 * Divergences 888 * Divergences
867 */ 889 */
868acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); 890ACPI_GLOBAL(u8, acpi_gbl_permanent_mmap);
869 891
870acpi_status acpi_unload_table_id(acpi_owner_id id); 892ACPI_EXTERNAL_RETURN_STATUS(acpi_status
893 acpi_get_id(acpi_handle object,
894 acpi_owner_id * out_type))
871 895
872acpi_status 896ACPI_EXTERNAL_RETURN_STATUS(acpi_status acpi_unload_table_id(acpi_owner_id id))
873acpi_get_table_with_size(acpi_string signature,
874 u32 instance, struct acpi_table_header **out_table,
875 acpi_size *tbl_size);
876 897
877acpi_status 898ACPI_EXTERNAL_RETURN_STATUS(acpi_status
878acpi_get_data_full(acpi_handle object, acpi_object_handler handler, void **data, 899 acpi_get_table_with_size(acpi_string signature,
879 void (*callback)(void *)); 900 u32 instance,
901 struct acpi_table_header
902 **out_table,
903 acpi_size *tbl_size))
904
905ACPI_EXTERNAL_RETURN_STATUS(acpi_status
906 acpi_get_data_full(acpi_handle object,
907 acpi_object_handler handler,
908 void **data,
909 void (*callback)(void *)))
880 910
881#endif /* __ACXFACE_H__ */ 911#endif /* __ACXFACE_H__ */
diff --git a/include/acpi/actbl.h b/include/acpi/actbl.h
index 1cc7ef13c01a..bee19d8170c5 100644
--- a/include/acpi/actbl.h
+++ b/include/acpi/actbl.h
@@ -270,7 +270,8 @@ struct acpi_table_fadt {
270 u32 flags; /* Miscellaneous flag bits (see below for individual flags) */ 270 u32 flags; /* Miscellaneous flag bits (see below for individual flags) */
271 struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */ 271 struct acpi_generic_address reset_register; /* 64-bit address of the Reset register */
272 u8 reset_value; /* Value to write to the reset_register port to reset the system */ 272 u8 reset_value; /* Value to write to the reset_register port to reset the system */
273 u8 reserved4[3]; /* Reserved, must be zero */ 273 u16 arm_boot_flags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
274 u8 minor_revision; /* FADT Minor Revision (ACPI 5.1) */
274 u64 Xfacs; /* 64-bit physical address of FACS */ 275 u64 Xfacs; /* 64-bit physical address of FACS */
275 u64 Xdsdt; /* 64-bit physical address of DSDT */ 276 u64 Xdsdt; /* 64-bit physical address of DSDT */
276 struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */ 277 struct acpi_generic_address xpm1a_event_block; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
@@ -285,7 +286,7 @@ struct acpi_table_fadt {
285 struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */ 286 struct acpi_generic_address sleep_status; /* 64-bit Sleep Status register (ACPI 5.0) */
286}; 287};
287 288
288/* Masks for FADT Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */ 289/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
289 290
290#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */ 291#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
291#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */ 292#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
@@ -296,6 +297,11 @@ struct acpi_table_fadt {
296 297
297#define FADT2_REVISION_ID 3 298#define FADT2_REVISION_ID 3
298 299
300/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
301
302#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
303#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
304
299/* Masks for FADT flags */ 305/* Masks for FADT flags */
300 306
301#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */ 307#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
@@ -399,7 +405,7 @@ struct acpi_table_desc {
399 * FADT V5 size: 0x10C 405 * FADT V5 size: 0x10C
400 */ 406 */
401#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4) 407#define ACPI_FADT_V1_SIZE (u32) (ACPI_FADT_OFFSET (flags) + 4)
402#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (reserved4[0]) + 3) 408#define ACPI_FADT_V2_SIZE (u32) (ACPI_FADT_OFFSET (minor_revision) + 1)
403#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control)) 409#define ACPI_FADT_V3_SIZE (u32) (ACPI_FADT_OFFSET (sleep_control))
404#define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt)) 410#define ACPI_FADT_V5_SIZE (u32) (sizeof (struct acpi_table_fadt))
405 411
diff --git a/include/acpi/actbl1.h b/include/acpi/actbl1.h
index 4ad7da805180..7626bfeac2cb 100644
--- a/include/acpi/actbl1.h
+++ b/include/acpi/actbl1.h
@@ -604,7 +604,7 @@ struct acpi_hest_generic {
604 604
605/* Generic Error Status block */ 605/* Generic Error Status block */
606 606
607struct acpi_generic_status { 607struct acpi_hest_generic_status {
608 u32 block_status; 608 u32 block_status;
609 u32 raw_data_offset; 609 u32 raw_data_offset;
610 u32 raw_data_length; 610 u32 raw_data_length;
@@ -614,15 +614,15 @@ struct acpi_generic_status {
614 614
615/* Values for block_status flags above */ 615/* Values for block_status flags above */
616 616
617#define ACPI_GEN_ERR_UC BIT(0) 617#define ACPI_HEST_UNCORRECTABLE (1)
618#define ACPI_GEN_ERR_CE BIT(1) 618#define ACPI_HEST_CORRECTABLE (1<<1)
619#define ACPI_GEN_ERR_MULTI_UC BIT(2) 619#define ACPI_HEST_MULTIPLE_UNCORRECTABLE (1<<2)
620#define ACPI_GEN_ERR_MULTI_CE BIT(3) 620#define ACPI_HEST_MULTIPLE_CORRECTABLE (1<<3)
621#define ACPI_GEN_ERR_COUNT_SHIFT (0xFF<<4) /* 8 bits, error count */ 621#define ACPI_HEST_ERROR_ENTRY_COUNT (0xFF<<4) /* 8 bits, error count */
622 622
623/* Generic Error Data entry */ 623/* Generic Error Data entry */
624 624
625struct acpi_generic_data { 625struct acpi_hest_generic_data {
626 u8 section_type[16]; 626 u8 section_type[16];
627 u32 error_severity; 627 u32 error_severity;
628 u16 revision; 628 u16 revision;
@@ -671,7 +671,9 @@ enum acpi_madt_type {
671 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10, 671 ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
672 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11, 672 ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
673 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12, 673 ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
674 ACPI_MADT_TYPE_RESERVED = 13 /* 13 and greater are reserved */ 674 ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
675 ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
676 ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */
675}; 677};
676 678
677/* 679/*
@@ -797,15 +799,26 @@ struct acpi_madt_local_x2apic_nmi {
797struct acpi_madt_generic_interrupt { 799struct acpi_madt_generic_interrupt {
798 struct acpi_subtable_header header; 800 struct acpi_subtable_header header;
799 u16 reserved; /* reserved - must be zero */ 801 u16 reserved; /* reserved - must be zero */
800 u32 gic_id; 802 u32 cpu_interface_number;
801 u32 uid; 803 u32 uid;
802 u32 flags; 804 u32 flags;
803 u32 parking_version; 805 u32 parking_version;
804 u32 performance_interrupt; 806 u32 performance_interrupt;
805 u64 parked_address; 807 u64 parked_address;
806 u64 base_address; 808 u64 base_address;
809 u64 gicv_base_address;
810 u64 gich_base_address;
811 u32 vgic_interrupt;
812 u64 gicr_base_address;
813 u64 arm_mpidr;
807}; 814};
808 815
816/* Masks for Flags field above */
817
818/* ACPI_MADT_ENABLED (1) Processor is usable if set */
819#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
820#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
821
809/* 12: Generic Distributor (ACPI 5.0) */ 822/* 12: Generic Distributor (ACPI 5.0) */
810 823
811struct acpi_madt_generic_distributor { 824struct acpi_madt_generic_distributor {
@@ -817,11 +830,36 @@ struct acpi_madt_generic_distributor {
817 u32 reserved2; /* reserved - must be zero */ 830 u32 reserved2; /* reserved - must be zero */
818}; 831};
819 832
833/* 13: Generic MSI Frame (ACPI 5.1) */
834
835struct acpi_madt_generic_msi_frame {
836 struct acpi_subtable_header header;
837 u16 reserved; /* reserved - must be zero */
838 u32 msi_frame_id;
839 u64 base_address;
840 u32 flags;
841 u16 spi_count;
842 u16 spi_base;
843};
844
845/* Masks for Flags field above */
846
847#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
848
849/* 14: Generic Redistributor (ACPI 5.1) */
850
851struct acpi_madt_generic_redistributor {
852 struct acpi_subtable_header header;
853 u16 reserved; /* reserved - must be zero */
854 u64 base_address;
855 u32 length;
856};
857
820/* 858/*
821 * Common flags fields for MADT subtables 859 * Common flags fields for MADT subtables
822 */ 860 */
823 861
824/* MADT Local APIC flags (lapic_flags) and GIC flags */ 862/* MADT Local APIC flags */
825 863
826#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */ 864#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
827 865
diff --git a/include/acpi/actbl2.h b/include/acpi/actbl2.h
index 860e5c883eb3..ecff62405f17 100644
--- a/include/acpi/actbl2.h
+++ b/include/acpi/actbl2.h
@@ -396,7 +396,7 @@ struct acpi_table_dbgp {
396 * Version 1 396 * Version 1
397 * 397 *
398 * Conforms to "Intel Virtualization Technology for Directed I/O", 398 * Conforms to "Intel Virtualization Technology for Directed I/O",
399 * Version 1.2, Sept. 2008 399 * Version 2.2, Sept. 2013
400 * 400 *
401 ******************************************************************************/ 401 ******************************************************************************/
402 402
@@ -423,9 +423,9 @@ struct acpi_dmar_header {
423enum acpi_dmar_type { 423enum acpi_dmar_type {
424 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0, 424 ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
425 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1, 425 ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
426 ACPI_DMAR_TYPE_ATSR = 2, 426 ACPI_DMAR_TYPE_ROOT_ATS = 2,
427 ACPI_DMAR_HARDWARE_AFFINITY = 3, 427 ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
428 ACPI_DMAR_TYPE_ANDD = 4, 428 ACPI_DMAR_TYPE_NAMESPACE = 4,
429 ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */ 429 ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */
430}; 430};
431 431
@@ -439,7 +439,7 @@ struct acpi_dmar_device_scope {
439 u8 bus; 439 u8 bus;
440}; 440};
441 441
442/* Values for entry_type in struct acpi_dmar_device_scope */ 442/* Values for entry_type in struct acpi_dmar_device_scope - device types */
443 443
444enum acpi_dmar_scope_type { 444enum acpi_dmar_scope_type {
445 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0, 445 ACPI_DMAR_SCOPE_TYPE_NOT_USED = 0,
@@ -447,7 +447,7 @@ enum acpi_dmar_scope_type {
447 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2, 447 ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
448 ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3, 448 ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
449 ACPI_DMAR_SCOPE_TYPE_HPET = 4, 449 ACPI_DMAR_SCOPE_TYPE_HPET = 4,
450 ACPI_DMAR_SCOPE_TYPE_ACPI = 5, 450 ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
451 ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */ 451 ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */
452}; 452};
453 453
@@ -516,7 +516,7 @@ struct acpi_dmar_andd {
516 struct acpi_dmar_header header; 516 struct acpi_dmar_header header;
517 u8 reserved[3]; 517 u8 reserved[3];
518 u8 device_number; 518 u8 device_number;
519 u8 object_name[]; 519 char device_name[1];
520}; 520};
521 521
522/******************************************************************************* 522/*******************************************************************************
diff --git a/include/acpi/actbl3.h b/include/acpi/actbl3.h
index c2295cc4a5c0..787bcc814463 100644
--- a/include/acpi/actbl3.h
+++ b/include/acpi/actbl3.h
@@ -241,33 +241,96 @@ struct acpi_s3pt_suspend {
241 241
242/******************************************************************************* 242/*******************************************************************************
243 * 243 *
244 * GTDT - Generic Timer Description Table (ACPI 5.0) 244 * GTDT - Generic Timer Description Table (ACPI 5.1)
245 * Version 1 245 * Version 2
246 * 246 *
247 ******************************************************************************/ 247 ******************************************************************************/
248 248
249struct acpi_table_gtdt { 249struct acpi_table_gtdt {
250 struct acpi_table_header header; /* Common ACPI table header */ 250 struct acpi_table_header header; /* Common ACPI table header */
251 u64 address; 251 u64 counter_block_addresss;
252 u32 flags; 252 u32 reserved;
253 u32 secure_pl1_interrupt; 253 u32 secure_el1_interrupt;
254 u32 secure_pl1_flags; 254 u32 secure_el1_flags;
255 u32 non_secure_pl1_interrupt; 255 u32 non_secure_el1_interrupt;
256 u32 non_secure_pl1_flags; 256 u32 non_secure_el1_flags;
257 u32 virtual_timer_interrupt; 257 u32 virtual_timer_interrupt;
258 u32 virtual_timer_flags; 258 u32 virtual_timer_flags;
259 u32 non_secure_pl2_interrupt; 259 u32 non_secure_el2_interrupt;
260 u32 non_secure_pl2_flags; 260 u32 non_secure_el2_flags;
261 u64 counter_read_block_address;
262 u32 platform_timer_count;
263 u32 platform_timer_offset;
261}; 264};
262 265
263/* Values for Flags field above */ 266/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
267
268#define ACPI_GTDT_INTERRUPT_MODE (1)
269#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
270#define ACPI_GTDT_ALWAYS_ON (1<<2)
271
272/* Common GTDT subtable header */
273
274struct acpi_gtdt_header {
275 u8 type;
276 u16 length;
277};
264 278
265#define ACPI_GTDT_MAPPED_BLOCK_PRESENT 1 279/* Values for GTDT subtable type above */
266 280
267/* Values for all "TimerFlags" fields above */ 281enum acpi_gtdt_type {
282 ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
283 ACPI_GTDT_TYPE_WATCHDOG = 1,
284 ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
285};
286
287/* GTDT Subtables, correspond to Type in struct acpi_gtdt_header */
288
289/* 0: Generic Timer Block */
290
291struct acpi_gtdt_timer_block {
292 struct acpi_gtdt_header header;
293 u8 reserved;
294 u64 block_address;
295 u32 timer_count;
296 u32 timer_offset;
297};
298
299/* Timer Sub-Structure, one per timer */
300
301struct acpi_gtdt_timer_entry {
302 u8 frame_number;
303 u8 reserved[3];
304 u64 base_address;
305 u64 el0_base_address;
306 u32 timer_interrupt;
307 u32 timer_flags;
308 u32 virtual_timer_interrupt;
309 u32 virtual_timer_flags;
310 u32 common_flags;
311};
268 312
269#define ACPI_GTDT_INTERRUPT_MODE 1 313/* Flag Definitions: common_flags above */
270#define ACPI_GTDT_INTERRUPT_POLARITY 2 314
315#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
316#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
317
318/* 1: SBSA Generic Watchdog Structure */
319
320struct acpi_gtdt_watchdog {
321 struct acpi_gtdt_header header;
322 u8 reserved;
323 u64 refresh_frame_address;
324 u64 control_frame_address;
325 u32 timer_interrupt;
326 u32 timer_flags;
327};
328
329/* Flag Definitions: timer_flags above */
330
331#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
332#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
333#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
271 334
272/******************************************************************************* 335/*******************************************************************************
273 * 336 *
@@ -385,7 +448,8 @@ struct acpi_table_pcct {
385 448
386enum acpi_pcct_type { 449enum acpi_pcct_type {
387 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0, 450 ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
388 ACPI_PCCT_TYPE_RESERVED = 1 /* 1 and greater are reserved */ 451 ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
452 ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
389}; 453};
390 454
391/* 455/*
@@ -407,6 +471,28 @@ struct acpi_pcct_subspace {
407 u16 min_turnaround_time; 471 u16 min_turnaround_time;
408}; 472};
409 473
474/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
475
476struct acpi_pcct_hw_reduced {
477 struct acpi_subtable_header header;
478 u32 doorbell_interrupt;
479 u8 flags;
480 u8 reserved;
481 u64 base_address;
482 u64 length;
483 struct acpi_generic_address doorbell_register;
484 u64 preserve_mask;
485 u64 write_mask;
486 u32 latency;
487 u32 max_access_rate;
488 u16 min_turnaround_time;
489};
490
491/* Values for doorbell flags above */
492
493#define ACPI_PCCT_INTERRUPT_POLARITY (1)
494#define ACPI_PCCT_INTERRUPT_MODE (1<<1)
495
410/* 496/*
411 * PCC memory structures (not part of the ACPI table) 497 * PCC memory structures (not part of the ACPI table)
412 */ 498 */
diff --git a/include/acpi/actypes.h b/include/acpi/actypes.h
index 19b26bb69a70..ac03ec81d342 100644
--- a/include/acpi/actypes.h
+++ b/include/acpi/actypes.h
@@ -126,6 +126,7 @@
126typedef unsigned char u8; 126typedef unsigned char u8;
127typedef unsigned char u8; 127typedef unsigned char u8;
128typedef unsigned short u16; 128typedef unsigned short u16;
129typedef short s16;
129typedef COMPILER_DEPENDENT_UINT64 u64; 130typedef COMPILER_DEPENDENT_UINT64 u64;
130typedef COMPILER_DEPENDENT_INT64 s64; 131typedef COMPILER_DEPENDENT_INT64 s64;
131 132
@@ -516,7 +517,7 @@ typedef u64 acpi_integer;
516 517
517#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i) 518#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(acpi_size) i)
518#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL) 519#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
519#define ACPI_OFFSET(d, f) (acpi_size) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL) 520#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
520#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i) 521#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
521#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i) 522#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
522 523
@@ -611,8 +612,9 @@ typedef u64 acpi_integer;
611#define ACPI_NOTIFY_RESERVED (u8) 0x0A 612#define ACPI_NOTIFY_RESERVED (u8) 0x0A
612#define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B 613#define ACPI_NOTIFY_LOCALITY_UPDATE (u8) 0x0B
613#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C 614#define ACPI_NOTIFY_SHUTDOWN_REQUEST (u8) 0x0C
615#define ACPI_NOTIFY_AFFINITY_UPDATE (u8) 0x0D
614 616
615#define ACPI_NOTIFY_MAX 0x0C 617#define ACPI_NOTIFY_MAX 0x0D
616 618
617/* 619/*
618 * Types associated with ACPI names and objects. The first group of 620 * Types associated with ACPI names and objects. The first group of
@@ -1244,4 +1246,17 @@ struct acpi_memory_list {
1244#define ACPI_OSI_WIN_7 0x0B 1246#define ACPI_OSI_WIN_7 0x0B
1245#define ACPI_OSI_WIN_8 0x0C 1247#define ACPI_OSI_WIN_8 0x0C
1246 1248
1249/* Definitions of file IO */
1250
1251#define ACPI_FILE_READING 0x01
1252#define ACPI_FILE_WRITING 0x02
1253#define ACPI_FILE_BINARY 0x04
1254
1255#define ACPI_FILE_BEGIN 0x01
1256#define ACPI_FILE_END 0x02
1257
1258/* Definitions of getopt */
1259
1260#define ACPI_OPT_END -1
1261
1247#endif /* __ACTYPES_H__ */ 1262#endif /* __ACTYPES_H__ */
diff --git a/include/acpi/ghes.h b/include/acpi/ghes.h
index dfd60d0bfd27..720446cb243e 100644
--- a/include/acpi/ghes.h
+++ b/include/acpi/ghes.h
@@ -14,7 +14,7 @@
14 14
15struct ghes { 15struct ghes {
16 struct acpi_hest_generic *generic; 16 struct acpi_hest_generic *generic;
17 struct acpi_generic_status *estatus; 17 struct acpi_hest_generic_status *estatus;
18 u64 buffer_paddr; 18 u64 buffer_paddr;
19 unsigned long flags; 19 unsigned long flags;
20 union { 20 union {
diff --git a/include/acpi/platform/acenv.h b/include/acpi/platform/acenv.h
index e863dd5c4e04..5f8cc1fa3278 100644
--- a/include/acpi/platform/acenv.h
+++ b/include/acpi/platform/acenv.h
@@ -87,20 +87,14 @@
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/* 90/*
99 * acpi_bin/acpi_dump/acpi_src/acpi_xtract/Example configuration. All single 91 * acpi_bin/acpi_dump/acpi_help/acpi_names/acpi_src/acpi_xtract/Example configuration.
100 * threaded, with no debug output. 92 * All single threaded.
101 */ 93 */
102#if (defined ACPI_BIN_APP) || \ 94#if (defined ACPI_BIN_APP) || \
103 (defined ACPI_DUMP_APP) || \ 95 (defined ACPI_DUMP_APP) || \
96 (defined ACPI_HELP_APP) || \
97 (defined ACPI_NAMES_APP) || \
104 (defined ACPI_SRC_APP) || \ 98 (defined ACPI_SRC_APP) || \
105 (defined ACPI_XTRACT_APP) || \ 99 (defined ACPI_XTRACT_APP) || \
106 (defined ACPI_EXAMPLE_APP) 100 (defined ACPI_EXAMPLE_APP)
@@ -108,12 +102,40 @@
108#define ACPI_SINGLE_THREADED 102#define ACPI_SINGLE_THREADED
109#endif 103#endif
110 104
105/* acpi_help configuration. Error messages disabled. */
106
111#ifdef ACPI_HELP_APP 107#ifdef ACPI_HELP_APP
112#define ACPI_APPLICATION
113#define ACPI_SINGLE_THREADED
114#define ACPI_NO_ERROR_MESSAGES 108#define ACPI_NO_ERROR_MESSAGES
115#endif 109#endif
116 110
111/* acpi_names configuration. Debug output enabled. */
112
113#ifdef ACPI_NAMES_APP
114#define ACPI_DEBUG_OUTPUT
115#endif
116
117/* acpi_exec/acpi_names/Example configuration. Native RSDP used. */
118
119#if (defined ACPI_EXEC_APP) || \
120 (defined ACPI_EXAMPLE_APP) || \
121 (defined ACPI_NAMES_APP)
122#define ACPI_USE_NATIVE_RSDP_POINTER
123#endif
124
125/* acpi_dump configuration. Native mapping used if provied by OSPMs */
126
127#ifdef ACPI_DUMP_APP
128#define ACPI_USE_NATIVE_MEMORY_MAPPING
129#define USE_NATIVE_ALLOCATE_ZEROED
130#endif
131
132/* acpi_names/Example configuration. Hardware disabled */
133
134#if (defined ACPI_EXAMPLE_APP) || \
135 (defined ACPI_NAMES_APP)
136#define ACPI_REDUCED_HARDWARE 1
137#endif
138
117/* Linkable ACPICA library */ 139/* Linkable ACPICA library */
118 140
119#ifdef ACPI_LIBRARY 141#ifdef ACPI_LIBRARY
@@ -185,6 +207,9 @@
185#elif defined(_AED_EFI) 207#elif defined(_AED_EFI)
186#include "acefi.h" 208#include "acefi.h"
187 209
210#elif defined(_GNU_EFI)
211#include "acefi.h"
212
188#elif defined(__HAIKU__) 213#elif defined(__HAIKU__)
189#include "achaiku.h" 214#include "achaiku.h"
190 215
@@ -399,8 +424,12 @@ typedef char *va_list;
399#ifdef ACPI_APPLICATION 424#ifdef ACPI_APPLICATION
400#include <stdio.h> 425#include <stdio.h>
401#define ACPI_FILE FILE * 426#define ACPI_FILE FILE *
427#define ACPI_FILE_OUT stdout
428#define ACPI_FILE_ERR stderr
402#else 429#else
403#define ACPI_FILE void * 430#define ACPI_FILE void *
431#define ACPI_FILE_OUT NULL
432#define ACPI_FILE_ERR NULL
404#endif /* ACPI_APPLICATION */ 433#endif /* ACPI_APPLICATION */
405#endif /* ACPI_FILE */ 434#endif /* ACPI_FILE */
406 435
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index cd1f052d55bb..1ba7c190c2cc 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -44,6 +44,16 @@
44#ifndef __ACLINUX_H__ 44#ifndef __ACLINUX_H__
45#define __ACLINUX_H__ 45#define __ACLINUX_H__
46 46
47#ifdef __KERNEL__
48
49/* ACPICA external files should not include ACPICA headers directly. */
50
51#if !defined(BUILDING_ACPICA) && !defined(_LINUX_ACPI_H)
52#error "Please don't include <acpi/acpi.h> directly, include <linux/acpi.h> instead."
53#endif
54
55#endif
56
47/* Common (in-kernel/user-space) ACPICA configuration */ 57/* Common (in-kernel/user-space) ACPICA configuration */
48 58
49#define ACPI_USE_SYSTEM_CLIBRARY 59#define ACPI_USE_SYSTEM_CLIBRARY
@@ -70,7 +80,9 @@
70#ifdef EXPORT_ACPI_INTERFACES 80#ifdef EXPORT_ACPI_INTERFACES
71#include <linux/export.h> 81#include <linux/export.h>
72#endif 82#endif
83#ifdef CONFIG_ACPI
73#include <asm/acenv.h> 84#include <asm/acenv.h>
85#endif
74 86
75#ifndef CONFIG_ACPI 87#ifndef CONFIG_ACPI
76 88
diff --git a/include/acpi/platform/aclinuxex.h b/include/acpi/platform/aclinuxex.h
index 191e741cfa0e..568d4b886712 100644
--- a/include/acpi/platform/aclinuxex.h
+++ b/include/acpi/platform/aclinuxex.h
@@ -46,6 +46,28 @@
46 46
47#ifdef __KERNEL__ 47#ifdef __KERNEL__
48 48
49#ifndef ACPI_USE_NATIVE_DIVIDE
50
51#ifndef ACPI_DIV_64_BY_32
52#define ACPI_DIV_64_BY_32(n_hi, n_lo, d32, q32, r32) \
53 do { \
54 u64 (__n) = ((u64) n_hi) << 32 | (n_lo); \
55 (r32) = do_div ((__n), (d32)); \
56 (q32) = (u32) (__n); \
57 } while (0)
58#endif
59
60#ifndef ACPI_SHIFT_RIGHT_64
61#define ACPI_SHIFT_RIGHT_64(n_hi, n_lo) \
62 do { \
63 (n_lo) >>= 1; \
64 (n_lo) |= (((n_hi) & 1) << 31); \
65 (n_hi) >>= 1; \
66 } while (0)
67#endif
68
69#endif
70
49/* 71/*
50 * Overrides for in-kernel ACPICA 72 * Overrides for in-kernel ACPICA
51 */ 73 */
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 358c01b971db..5320153c311b 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -29,17 +29,17 @@
29#include <linux/ioport.h> /* for struct resource */ 29#include <linux/ioport.h> /* for struct resource */
30#include <linux/device.h> 30#include <linux/device.h>
31 31
32#ifdef CONFIG_ACPI
33
34#ifndef _LINUX 32#ifndef _LINUX
35#define _LINUX 33#define _LINUX
36#endif 34#endif
35#include <acpi/acpi.h>
36
37#ifdef CONFIG_ACPI
37 38
38#include <linux/list.h> 39#include <linux/list.h>
39#include <linux/mod_devicetable.h> 40#include <linux/mod_devicetable.h>
40#include <linux/dynamic_debug.h> 41#include <linux/dynamic_debug.h>
41 42
42#include <acpi/acpi.h>
43#include <acpi/acpi_bus.h> 43#include <acpi/acpi_bus.h>
44#include <acpi/acpi_drivers.h> 44#include <acpi/acpi_drivers.h>
45#include <acpi/acpi_numa.h> 45#include <acpi/acpi_numa.h>
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 8f8ae95c6e27..7d1955afa62c 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -176,6 +176,7 @@ static inline void disable_cpufreq(void) { }
176 176
177#define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */ 177#define CPUFREQ_RELATION_L 0 /* lowest frequency at or above target */
178#define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */ 178#define CPUFREQ_RELATION_H 1 /* highest frequency below or at target */
179#define CPUFREQ_RELATION_C 2 /* closest frequency to target */
179 180
180struct freq_attr { 181struct freq_attr {
181 struct attribute attr; 182 struct attribute attr;
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h
index 637a608ded0b..64dacb7288a6 100644
--- a/include/linux/pci-acpi.h
+++ b/include/linux/pci-acpi.h
@@ -11,12 +11,17 @@
11#include <linux/acpi.h> 11#include <linux/acpi.h>
12 12
13#ifdef CONFIG_ACPI 13#ifdef CONFIG_ACPI
14extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev, 14extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev);
15 struct pci_bus *pci_bus); 15static inline acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev)
16extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev); 16{
17 return acpi_remove_pm_notifier(dev);
18}
17extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, 19extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev,
18 struct pci_dev *pci_dev); 20 struct pci_dev *pci_dev);
19extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev); 21static inline acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev)
22{
23 return acpi_remove_pm_notifier(dev);
24}
20extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle); 25extern phys_addr_t acpi_pci_root_get_mcfg_addr(acpi_handle handle);
21 26
22static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) 27static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev)
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 43fd6716f662..367f49b9a1c9 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -24,11 +24,20 @@
24#define RPM_AUTO 0x08 /* Use autosuspend_delay */ 24#define RPM_AUTO 0x08 /* Use autosuspend_delay */
25 25
26#ifdef CONFIG_PM 26#ifdef CONFIG_PM
27extern struct workqueue_struct *pm_wq;
28
29static inline bool queue_pm_work(struct work_struct *work)
30{
31 return queue_work(pm_wq, work);
32}
33
27extern int pm_generic_runtime_suspend(struct device *dev); 34extern int pm_generic_runtime_suspend(struct device *dev);
28extern int pm_generic_runtime_resume(struct device *dev); 35extern int pm_generic_runtime_resume(struct device *dev);
29extern int pm_runtime_force_suspend(struct device *dev); 36extern int pm_runtime_force_suspend(struct device *dev);
30extern int pm_runtime_force_resume(struct device *dev); 37extern int pm_runtime_force_resume(struct device *dev);
31#else 38#else
39static inline bool queue_pm_work(struct work_struct *work) { return false; }
40
32static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; } 41static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
33static inline int pm_generic_runtime_resume(struct device *dev) { return 0; } 42static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
34static inline int pm_runtime_force_suspend(struct device *dev) { return 0; } 43static inline int pm_runtime_force_suspend(struct device *dev) { return 0; }
@@ -37,8 +46,6 @@ static inline int pm_runtime_force_resume(struct device *dev) { return 0; }
37 46
38#ifdef CONFIG_PM_RUNTIME 47#ifdef CONFIG_PM_RUNTIME
39 48
40extern struct workqueue_struct *pm_wq;
41
42extern int __pm_runtime_idle(struct device *dev, int rpmflags); 49extern int __pm_runtime_idle(struct device *dev, int rpmflags);
43extern int __pm_runtime_suspend(struct device *dev, int rpmflags); 50extern int __pm_runtime_suspend(struct device *dev, int rpmflags);
44extern int __pm_runtime_resume(struct device *dev, int rpmflags); 51extern int __pm_runtime_resume(struct device *dev, int rpmflags);
diff --git a/include/linux/sfi_acpi.h b/include/linux/sfi_acpi.h
index 4723bbfa1c26..a6e555cbe05c 100644
--- a/include/linux/sfi_acpi.h
+++ b/include/linux/sfi_acpi.h
@@ -63,8 +63,6 @@
63#include <linux/sfi.h> 63#include <linux/sfi.h>
64 64
65#ifdef CONFIG_SFI 65#ifdef CONFIG_SFI
66#include <acpi/acpi.h> /* FIXME: inclusion should be removed */
67
68extern int sfi_acpi_table_parse(char *signature, char *oem_id, 66extern int sfi_acpi_table_parse(char *signature, char *oem_id,
69 char *oem_table_id, 67 char *oem_table_id,
70 int (*handler)(struct acpi_table_header *)); 68 int (*handler)(struct acpi_table_header *));
@@ -78,7 +76,6 @@ static inline int __init acpi_sfi_table_parse(char *signature,
78 return sfi_acpi_table_parse(signature, NULL, NULL, handler); 76 return sfi_acpi_table_parse(signature, NULL, NULL, handler);
79} 77}
80#else /* !CONFIG_SFI */ 78#else /* !CONFIG_SFI */
81
82static inline int sfi_acpi_table_parse(char *signature, char *oem_id, 79static inline int sfi_acpi_table_parse(char *signature, char *oem_id,
83 char *oem_table_id, 80 char *oem_table_id,
84 int (*handler)(struct acpi_table_header *)) 81 int (*handler)(struct acpi_table_header *))