diff options
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/include/asm/acenv.h | 56 | ||||
-rw-r--r-- | arch/ia64/include/asm/acpi.h | 52 | ||||
-rw-r--r-- | arch/ia64/kernel/acpi.c | 3 |
3 files changed, 60 insertions, 51 deletions
diff --git a/arch/ia64/include/asm/acenv.h b/arch/ia64/include/asm/acenv.h new file mode 100644 index 000000000000..3f9eaeec9873 --- /dev/null +++ b/arch/ia64/include/asm/acenv.h | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * IA64 specific ACPICA environments and implementation | ||
3 | * | ||
4 | * Copyright (C) 2014, Intel Corporation | ||
5 | * Author: Lv Zheng <lv.zheng@intel.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef _ASM_IA64_ACENV_H | ||
13 | #define _ASM_IA64_ACENV_H | ||
14 | |||
15 | #include <asm/intrinsics.h> | ||
16 | |||
17 | #define COMPILER_DEPENDENT_INT64 long | ||
18 | #define COMPILER_DEPENDENT_UINT64 unsigned long | ||
19 | |||
20 | /* Asm macros */ | ||
21 | |||
22 | #ifdef CONFIG_ACPI | ||
23 | |||
24 | static inline int | ||
25 | ia64_acpi_acquire_global_lock(unsigned int *lock) | ||
26 | { | ||
27 | unsigned int old, new, val; | ||
28 | do { | ||
29 | old = *lock; | ||
30 | new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); | ||
31 | val = ia64_cmpxchg4_acq(lock, new, old); | ||
32 | } while (unlikely (val != old)); | ||
33 | return (new < 3) ? -1 : 0; | ||
34 | } | ||
35 | |||
36 | static inline int | ||
37 | ia64_acpi_release_global_lock(unsigned int *lock) | ||
38 | { | ||
39 | unsigned int old, new, val; | ||
40 | do { | ||
41 | old = *lock; | ||
42 | new = old & ~0x3; | ||
43 | val = ia64_cmpxchg4_acq(lock, new, old); | ||
44 | } while (unlikely (val != old)); | ||
45 | return old & 0x1; | ||
46 | } | ||
47 | |||
48 | #define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \ | ||
49 | ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) | ||
50 | |||
51 | #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ | ||
52 | ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) | ||
53 | |||
54 | #endif | ||
55 | |||
56 | #endif /* _ASM_IA64_ACENV_H */ | ||
diff --git a/arch/ia64/include/asm/acpi.h b/arch/ia64/include/asm/acpi.h index d651102a4d45..75dc59a793d6 100644 --- a/arch/ia64/include/asm/acpi.h +++ b/arch/ia64/include/asm/acpi.h | |||
@@ -34,57 +34,8 @@ | |||
34 | #include <linux/numa.h> | 34 | #include <linux/numa.h> |
35 | #include <asm/numa.h> | 35 | #include <asm/numa.h> |
36 | 36 | ||
37 | #define COMPILER_DEPENDENT_INT64 long | ||
38 | #define COMPILER_DEPENDENT_UINT64 unsigned long | ||
39 | |||
40 | /* | ||
41 | * Calling conventions: | ||
42 | * | ||
43 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | ||
44 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | ||
45 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | ||
46 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | ||
47 | */ | ||
48 | #define ACPI_SYSTEM_XFACE | ||
49 | #define ACPI_EXTERNAL_XFACE | ||
50 | #define ACPI_INTERNAL_XFACE | ||
51 | #define ACPI_INTERNAL_VAR_XFACE | ||
52 | |||
53 | /* Asm macros */ | ||
54 | |||
55 | #define ACPI_FLUSH_CPU_CACHE() | ||
56 | |||
57 | static inline int | ||
58 | ia64_acpi_acquire_global_lock (unsigned int *lock) | ||
59 | { | ||
60 | unsigned int old, new, val; | ||
61 | do { | ||
62 | old = *lock; | ||
63 | new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); | ||
64 | val = ia64_cmpxchg4_acq(lock, new, old); | ||
65 | } while (unlikely (val != old)); | ||
66 | return (new < 3) ? -1 : 0; | ||
67 | } | ||
68 | |||
69 | static inline int | ||
70 | ia64_acpi_release_global_lock (unsigned int *lock) | ||
71 | { | ||
72 | unsigned int old, new, val; | ||
73 | do { | ||
74 | old = *lock; | ||
75 | new = old & ~0x3; | ||
76 | val = ia64_cmpxchg4_acq(lock, new, old); | ||
77 | } while (unlikely (val != old)); | ||
78 | return old & 0x1; | ||
79 | } | ||
80 | |||
81 | #define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \ | ||
82 | ((Acq) = ia64_acpi_acquire_global_lock(&facs->global_lock)) | ||
83 | |||
84 | #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ | ||
85 | ((Acq) = ia64_acpi_release_global_lock(&facs->global_lock)) | ||
86 | |||
87 | #ifdef CONFIG_ACPI | 37 | #ifdef CONFIG_ACPI |
38 | extern int acpi_lapic; | ||
88 | #define acpi_disabled 0 /* ACPI always enabled on IA64 */ | 39 | #define acpi_disabled 0 /* ACPI always enabled on IA64 */ |
89 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ | 40 | #define acpi_noirq 0 /* ACPI always enabled on IA64 */ |
90 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ | 41 | #define acpi_pci_disabled 0 /* ACPI PCI always enabled on IA64 */ |
@@ -92,7 +43,6 @@ ia64_acpi_release_global_lock (unsigned int *lock) | |||
92 | #endif | 43 | #endif |
93 | #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ | 44 | #define acpi_processor_cstate_check(x) (x) /* no idle limits on IA64 :) */ |
94 | static inline void disable_acpi(void) { } | 45 | static inline void disable_acpi(void) { } |
95 | static inline void pci_acpi_crs_quirks(void) { } | ||
96 | 46 | ||
97 | #ifdef CONFIG_IA64_GENERIC | 47 | #ifdef CONFIG_IA64_GENERIC |
98 | const char *acpi_get_sysname (void); | 48 | const char *acpi_get_sysname (void); |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 0d407b300762..615ef81def49 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -56,6 +56,7 @@ | |||
56 | 56 | ||
57 | #define PREFIX "ACPI: " | 57 | #define PREFIX "ACPI: " |
58 | 58 | ||
59 | int acpi_lapic; | ||
59 | unsigned int acpi_cpei_override; | 60 | unsigned int acpi_cpei_override; |
60 | unsigned int acpi_cpei_phys_cpuid; | 61 | unsigned int acpi_cpei_phys_cpuid; |
61 | 62 | ||
@@ -676,6 +677,8 @@ int __init early_acpi_boot_init(void) | |||
676 | if (ret < 1) | 677 | if (ret < 1) |
677 | printk(KERN_ERR PREFIX | 678 | printk(KERN_ERR PREFIX |
678 | "Error parsing MADT - no LAPIC entries\n"); | 679 | "Error parsing MADT - no LAPIC entries\n"); |
680 | else | ||
681 | acpi_lapic = 1; | ||
679 | 682 | ||
680 | #ifdef CONFIG_SMP | 683 | #ifdef CONFIG_SMP |
681 | if (available_cpus == 0) { | 684 | if (available_cpus == 0) { |