diff options
Diffstat (limited to 'include/asm-i386/acpi.h')
-rw-r--r-- | include/asm-i386/acpi.h | 50 |
1 files changed, 13 insertions, 37 deletions
diff --git a/include/asm-i386/acpi.h b/include/asm-i386/acpi.h index c80b3a94511a..5e657eb8946c 100644 --- a/include/asm-i386/acpi.h +++ b/include/asm-i386/acpi.h | |||
@@ -39,7 +39,7 @@ | |||
39 | * Calling conventions: | 39 | * Calling conventions: |
40 | * | 40 | * |
41 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) | 41 | * ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads) |
42 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces | 42 | * ACPI_EXTERNAL_XFACE - External ACPI interfaces |
43 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces | 43 | * ACPI_INTERNAL_XFACE - Internal ACPI interfaces |
44 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces | 44 | * ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces |
45 | */ | 45 | */ |
@@ -56,36 +56,14 @@ | |||
56 | #define ACPI_ENABLE_IRQS() local_irq_enable() | 56 | #define ACPI_ENABLE_IRQS() local_irq_enable() |
57 | #define ACPI_FLUSH_CPU_CACHE() wbinvd() | 57 | #define ACPI_FLUSH_CPU_CACHE() wbinvd() |
58 | 58 | ||
59 | int __acpi_acquire_global_lock(unsigned int *lock); | ||
60 | int __acpi_release_global_lock(unsigned int *lock); | ||
59 | 61 | ||
60 | static inline int | 62 | #define ACPI_ACQUIRE_GLOBAL_LOCK(facs, Acq) \ |
61 | __acpi_acquire_global_lock (unsigned int *lock) | 63 | ((Acq) = __acpi_acquire_global_lock(&facs->global_lock)) |
62 | { | ||
63 | unsigned int old, new, val; | ||
64 | do { | ||
65 | old = *lock; | ||
66 | new = (((old & ~0x3) + 2) + ((old >> 1) & 0x1)); | ||
67 | val = cmpxchg(lock, old, new); | ||
68 | } while (unlikely (val != old)); | ||
69 | return (new < 3) ? -1 : 0; | ||
70 | } | ||
71 | |||
72 | static inline int | ||
73 | __acpi_release_global_lock (unsigned int *lock) | ||
74 | { | ||
75 | unsigned int old, new, val; | ||
76 | do { | ||
77 | old = *lock; | ||
78 | new = old & ~0x3; | ||
79 | val = cmpxchg(lock, old, new); | ||
80 | } while (unlikely (val != old)); | ||
81 | return old & 0x1; | ||
82 | } | ||
83 | 64 | ||
84 | #define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acq) \ | 65 | #define ACPI_RELEASE_GLOBAL_LOCK(facs, Acq) \ |
85 | ((Acq) = __acpi_acquire_global_lock((unsigned int *) GLptr)) | 66 | ((Acq) = __acpi_release_global_lock(&facs->global_lock)) |
86 | |||
87 | #define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Acq) \ | ||
88 | ((Acq) = __acpi_release_global_lock((unsigned int *) GLptr)) | ||
89 | 67 | ||
90 | /* | 68 | /* |
91 | * Math helper asm macros | 69 | * Math helper asm macros |
@@ -109,7 +87,7 @@ extern void check_acpi_pci(void); | |||
109 | static inline void check_acpi_pci(void) { } | 87 | static inline void check_acpi_pci(void) { } |
110 | #endif | 88 | #endif |
111 | 89 | ||
112 | #ifdef CONFIG_ACPI | 90 | #ifdef CONFIG_ACPI |
113 | extern int acpi_lapic; | 91 | extern int acpi_lapic; |
114 | extern int acpi_ioapic; | 92 | extern int acpi_ioapic; |
115 | extern int acpi_noirq; | 93 | extern int acpi_noirq; |
@@ -117,9 +95,9 @@ extern int acpi_strict; | |||
117 | extern int acpi_disabled; | 95 | extern int acpi_disabled; |
118 | extern int acpi_ht; | 96 | extern int acpi_ht; |
119 | extern int acpi_pci_disabled; | 97 | extern int acpi_pci_disabled; |
120 | static inline void disable_acpi(void) | 98 | static inline void disable_acpi(void) |
121 | { | 99 | { |
122 | acpi_disabled = 1; | 100 | acpi_disabled = 1; |
123 | acpi_ht = 0; | 101 | acpi_ht = 0; |
124 | acpi_pci_disabled = 1; | 102 | acpi_pci_disabled = 1; |
125 | acpi_noirq = 1; | 103 | acpi_noirq = 1; |
@@ -136,9 +114,9 @@ extern int acpi_use_timer_override; | |||
136 | #endif | 114 | #endif |
137 | 115 | ||
138 | static inline void acpi_noirq_set(void) { acpi_noirq = 1; } | 116 | static inline void acpi_noirq_set(void) { acpi_noirq = 1; } |
139 | static inline void acpi_disable_pci(void) | 117 | static inline void acpi_disable_pci(void) |
140 | { | 118 | { |
141 | acpi_pci_disabled = 1; | 119 | acpi_pci_disabled = 1; |
142 | acpi_noirq_set(); | 120 | acpi_noirq_set(); |
143 | } | 121 | } |
144 | extern int acpi_irq_balance_set(char *str); | 122 | extern int acpi_irq_balance_set(char *str); |
@@ -166,8 +144,6 @@ extern void acpi_reserve_bootmem(void); | |||
166 | 144 | ||
167 | #endif /*CONFIG_ACPI_SLEEP*/ | 145 | #endif /*CONFIG_ACPI_SLEEP*/ |
168 | 146 | ||
169 | extern u8 x86_acpiid_to_apicid[]; | ||
170 | |||
171 | #define ARCH_HAS_POWER_INIT 1 | 147 | #define ARCH_HAS_POWER_INIT 1 |
172 | 148 | ||
173 | #endif /*__KERNEL__*/ | 149 | #endif /*__KERNEL__*/ |