aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/include
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/include')
-rw-r--r--arch/x86/include/asm/apic.h2
-rw-r--r--arch/x86/include/asm/atomic.h10
-rw-r--r--arch/x86/include/asm/atomic64_32.h2
-rw-r--r--arch/x86/include/asm/atomic64_64.h2
-rw-r--r--arch/x86/include/asm/bitops.h5
-rw-r--r--arch/x86/include/asm/hw_irq.h2
-rw-r--r--arch/x86/include/asm/kdebug.h1
-rw-r--r--arch/x86/include/asm/local.h2
-rw-r--r--arch/x86/include/asm/mce.h2
-rw-r--r--arch/x86/include/asm/mmu_context.h2
-rw-r--r--arch/x86/include/asm/olpc.h51
-rw-r--r--arch/x86/include/asm/prom.h2
-rw-r--r--arch/x86/include/asm/spinlock.h2
-rw-r--r--arch/x86/include/asm/thread_info.h2
14 files changed, 55 insertions, 32 deletions
diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
index 4a0b7c7e2cc..7b3ca8324b6 100644
--- a/arch/x86/include/asm/apic.h
+++ b/arch/x86/include/asm/apic.h
@@ -8,7 +8,7 @@
8#include <asm/cpufeature.h> 8#include <asm/cpufeature.h>
9#include <asm/processor.h> 9#include <asm/processor.h>
10#include <asm/apicdef.h> 10#include <asm/apicdef.h>
11#include <asm/atomic.h> 11#include <linux/atomic.h>
12#include <asm/fixmap.h> 12#include <asm/fixmap.h>
13#include <asm/mpspec.h> 13#include <asm/mpspec.h>
14#include <asm/system.h> 14#include <asm/system.h>
diff --git a/arch/x86/include/asm/atomic.h b/arch/x86/include/asm/atomic.h
index 952a826ac4e..10572e309ab 100644
--- a/arch/x86/include/asm/atomic.h
+++ b/arch/x86/include/asm/atomic.h
@@ -221,15 +221,15 @@ static inline int atomic_xchg(atomic_t *v, int new)
221} 221}
222 222
223/** 223/**
224 * atomic_add_unless - add unless the number is already a given value 224 * __atomic_add_unless - add unless the number is already a given value
225 * @v: pointer of type atomic_t 225 * @v: pointer of type atomic_t
226 * @a: the amount to add to v... 226 * @a: the amount to add to v...
227 * @u: ...unless v is equal to u. 227 * @u: ...unless v is equal to u.
228 * 228 *
229 * Atomically adds @a to @v, so long as @v was not already @u. 229 * Atomically adds @a to @v, so long as @v was not already @u.
230 * Returns non-zero if @v was not @u, and zero otherwise. 230 * Returns the old value of @v.
231 */ 231 */
232static inline int atomic_add_unless(atomic_t *v, int a, int u) 232static inline int __atomic_add_unless(atomic_t *v, int a, int u)
233{ 233{
234 int c, old; 234 int c, old;
235 c = atomic_read(v); 235 c = atomic_read(v);
@@ -241,10 +241,9 @@ static inline int atomic_add_unless(atomic_t *v, int a, int u)
241 break; 241 break;
242 c = old; 242 c = old;
243 } 243 }
244 return c != (u); 244 return c;
245} 245}
246 246
247#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
248 247
249/* 248/*
250 * atomic_dec_if_positive - decrement by 1 if old value positive 249 * atomic_dec_if_positive - decrement by 1 if old value positive
@@ -319,5 +318,4 @@ static inline void atomic_or_long(unsigned long *v1, unsigned long v2)
319# include "atomic64_64.h" 318# include "atomic64_64.h"
320#endif 319#endif
321 320
322#include <asm-generic/atomic-long.h>
323#endif /* _ASM_X86_ATOMIC_H */ 321#endif /* _ASM_X86_ATOMIC_H */
diff --git a/arch/x86/include/asm/atomic64_32.h b/arch/x86/include/asm/atomic64_32.h
index 2a934aa19a4..24098aafce0 100644
--- a/arch/x86/include/asm/atomic64_32.h
+++ b/arch/x86/include/asm/atomic64_32.h
@@ -263,7 +263,7 @@ static inline int atomic64_add_negative(long long i, atomic64_t *v)
263 * @u: ...unless v is equal to u. 263 * @u: ...unless v is equal to u.
264 * 264 *
265 * Atomically adds @a to @v, so long as it was not @u. 265 * Atomically adds @a to @v, so long as it was not @u.
266 * Returns non-zero if @v was not @u, and zero otherwise. 266 * Returns the old value of @v.
267 */ 267 */
268static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u) 268static inline int atomic64_add_unless(atomic64_t *v, long long a, long long u)
269{ 269{
diff --git a/arch/x86/include/asm/atomic64_64.h b/arch/x86/include/asm/atomic64_64.h
index 49fd1ea2295..017594d403f 100644
--- a/arch/x86/include/asm/atomic64_64.h
+++ b/arch/x86/include/asm/atomic64_64.h
@@ -202,7 +202,7 @@ static inline long atomic64_xchg(atomic64_t *v, long new)
202 * @u: ...unless v is equal to u. 202 * @u: ...unless v is equal to u.
203 * 203 *
204 * Atomically adds @a to @v, so long as it was not @u. 204 * Atomically adds @a to @v, so long as it was not @u.
205 * Returns non-zero if @v was not @u, and zero otherwise. 205 * Returns the old value of @v.
206 */ 206 */
207static inline int atomic64_add_unless(atomic64_t *v, long a, long u) 207static inline int atomic64_add_unless(atomic64_t *v, long a, long u)
208{ 208{
diff --git a/arch/x86/include/asm/bitops.h b/arch/x86/include/asm/bitops.h
index 69d58131bc8..1775d6e5920 100644
--- a/arch/x86/include/asm/bitops.h
+++ b/arch/x86/include/asm/bitops.h
@@ -458,10 +458,7 @@ static inline int fls(int x)
458 458
459#include <asm-generic/bitops/le.h> 459#include <asm-generic/bitops/le.h>
460 460
461#define ext2_set_bit_atomic(lock, nr, addr) \ 461#include <asm-generic/bitops/ext2-atomic-setbit.h>
462 test_and_set_bit((nr), (unsigned long *)(addr))
463#define ext2_clear_bit_atomic(lock, nr, addr) \
464 test_and_clear_bit((nr), (unsigned long *)(addr))
465 462
466#endif /* __KERNEL__ */ 463#endif /* __KERNEL__ */
467#endif /* _ASM_X86_BITOPS_H */ 464#endif /* _ASM_X86_BITOPS_H */
diff --git a/arch/x86/include/asm/hw_irq.h b/arch/x86/include/asm/hw_irq.h
index 13f5504c76c..09199052060 100644
--- a/arch/x86/include/asm/hw_irq.h
+++ b/arch/x86/include/asm/hw_irq.h
@@ -21,7 +21,7 @@
21#include <linux/profile.h> 21#include <linux/profile.h>
22#include <linux/smp.h> 22#include <linux/smp.h>
23 23
24#include <asm/atomic.h> 24#include <linux/atomic.h>
25#include <asm/irq.h> 25#include <asm/irq.h>
26#include <asm/sections.h> 26#include <asm/sections.h>
27 27
diff --git a/arch/x86/include/asm/kdebug.h b/arch/x86/include/asm/kdebug.h
index fe2cc6e105f..d73f1571bde 100644
--- a/arch/x86/include/asm/kdebug.h
+++ b/arch/x86/include/asm/kdebug.h
@@ -28,7 +28,6 @@ extern void show_registers(struct pt_regs *regs);
28extern void show_trace(struct task_struct *t, struct pt_regs *regs, 28extern void show_trace(struct task_struct *t, struct pt_regs *regs,
29 unsigned long *sp, unsigned long bp); 29 unsigned long *sp, unsigned long bp);
30extern void __show_regs(struct pt_regs *regs, int all); 30extern void __show_regs(struct pt_regs *regs, int all);
31extern void show_regs(struct pt_regs *regs);
32extern unsigned long oops_begin(void); 31extern unsigned long oops_begin(void);
33extern void oops_end(unsigned long, struct pt_regs *, int signr); 32extern void oops_end(unsigned long, struct pt_regs *, int signr);
34#ifdef CONFIG_KEXEC 33#ifdef CONFIG_KEXEC
diff --git a/arch/x86/include/asm/local.h b/arch/x86/include/asm/local.h
index 2e9972468a5..9cdae5d47e8 100644
--- a/arch/x86/include/asm/local.h
+++ b/arch/x86/include/asm/local.h
@@ -4,7 +4,7 @@
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5 5
6#include <asm/system.h> 6#include <asm/system.h>
7#include <asm/atomic.h> 7#include <linux/atomic.h>
8#include <asm/asm.h> 8#include <asm/asm.h>
9 9
10typedef struct { 10typedef struct {
diff --git a/arch/x86/include/asm/mce.h b/arch/x86/include/asm/mce.h
index 716b48af786..c9321f34e55 100644
--- a/arch/x86/include/asm/mce.h
+++ b/arch/x86/include/asm/mce.h
@@ -124,7 +124,7 @@ extern struct atomic_notifier_head x86_mce_decoder_chain;
124 124
125#include <linux/percpu.h> 125#include <linux/percpu.h>
126#include <linux/init.h> 126#include <linux/init.h>
127#include <asm/atomic.h> 127#include <linux/atomic.h>
128 128
129extern int mce_disabled; 129extern int mce_disabled;
130extern int mce_p5_enabled; 130extern int mce_p5_enabled;
diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h
index 8b5393ec108..69021528b43 100644
--- a/arch/x86/include/asm/mmu_context.h
+++ b/arch/x86/include/asm/mmu_context.h
@@ -2,7 +2,7 @@
2#define _ASM_X86_MMU_CONTEXT_H 2#define _ASM_X86_MMU_CONTEXT_H
3 3
4#include <asm/desc.h> 4#include <asm/desc.h>
5#include <asm/atomic.h> 5#include <linux/atomic.h>
6#include <asm/pgalloc.h> 6#include <asm/pgalloc.h>
7#include <asm/tlbflush.h> 7#include <asm/tlbflush.h>
8#include <asm/paravirt.h> 8#include <asm/paravirt.h>
diff --git a/arch/x86/include/asm/olpc.h b/arch/x86/include/asm/olpc.h
index 5ca6801b75f..87bdbca72f9 100644
--- a/arch/x86/include/asm/olpc.h
+++ b/arch/x86/include/asm/olpc.h
@@ -13,6 +13,7 @@ struct olpc_platform_t {
13 13
14#define OLPC_F_PRESENT 0x01 14#define OLPC_F_PRESENT 0x01
15#define OLPC_F_DCON 0x02 15#define OLPC_F_DCON 0x02
16#define OLPC_F_EC_WIDE_SCI 0x04
16 17
17#ifdef CONFIG_OLPC 18#ifdef CONFIG_OLPC
18 19
@@ -62,6 +63,13 @@ static inline int olpc_board_at_least(uint32_t rev)
62 return olpc_platform_info.boardrev >= rev; 63 return olpc_platform_info.boardrev >= rev;
63} 64}
64 65
66extern void olpc_ec_wakeup_set(u16 value);
67extern void olpc_ec_wakeup_clear(u16 value);
68extern bool olpc_ec_wakeup_available(void);
69
70extern int olpc_ec_mask_write(u16 bits);
71extern int olpc_ec_sci_query(u16 *sci_value);
72
65#else 73#else
66 74
67static inline int machine_is_olpc(void) 75static inline int machine_is_olpc(void)
@@ -74,6 +82,20 @@ static inline int olpc_has_dcon(void)
74 return 0; 82 return 0;
75} 83}
76 84
85static inline void olpc_ec_wakeup_set(u16 value) { }
86static inline void olpc_ec_wakeup_clear(u16 value) { }
87
88static inline bool olpc_ec_wakeup_available(void)
89{
90 return false;
91}
92
93#endif
94
95#ifdef CONFIG_OLPC_XO1_PM
96extern void do_olpc_suspend_lowlevel(void);
97extern void olpc_xo1_pm_wakeup_set(u16 value);
98extern void olpc_xo1_pm_wakeup_clear(u16 value);
77#endif 99#endif
78 100
79extern int pci_olpc_init(void); 101extern int pci_olpc_init(void);
@@ -83,14 +105,19 @@ extern int pci_olpc_init(void);
83extern int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen, 105extern int olpc_ec_cmd(unsigned char cmd, unsigned char *inbuf, size_t inlen,
84 unsigned char *outbuf, size_t outlen); 106 unsigned char *outbuf, size_t outlen);
85 107
86extern int olpc_ec_mask_set(uint8_t bits);
87extern int olpc_ec_mask_unset(uint8_t bits);
88
89/* EC commands */ 108/* EC commands */
90 109
91#define EC_FIRMWARE_REV 0x08 110#define EC_FIRMWARE_REV 0x08
92#define EC_WLAN_ENTER_RESET 0x35 111#define EC_WRITE_SCI_MASK 0x1b
93#define EC_WLAN_LEAVE_RESET 0x25 112#define EC_WAKE_UP_WLAN 0x24
113#define EC_WLAN_LEAVE_RESET 0x25
114#define EC_READ_EB_MODE 0x2a
115#define EC_SET_SCI_INHIBIT 0x32
116#define EC_SET_SCI_INHIBIT_RELEASE 0x34
117#define EC_WLAN_ENTER_RESET 0x35
118#define EC_WRITE_EXT_SCI_MASK 0x38
119#define EC_SCI_QUERY 0x84
120#define EC_EXT_SCI_QUERY 0x85
94 121
95/* SCI source values */ 122/* SCI source values */
96 123
@@ -99,10 +126,12 @@ extern int olpc_ec_mask_unset(uint8_t bits);
99#define EC_SCI_SRC_BATTERY 0x02 126#define EC_SCI_SRC_BATTERY 0x02
100#define EC_SCI_SRC_BATSOC 0x04 127#define EC_SCI_SRC_BATSOC 0x04
101#define EC_SCI_SRC_BATERR 0x08 128#define EC_SCI_SRC_BATERR 0x08
102#define EC_SCI_SRC_EBOOK 0x10 129#define EC_SCI_SRC_EBOOK 0x10 /* XO-1 only */
103#define EC_SCI_SRC_WLAN 0x20 130#define EC_SCI_SRC_WLAN 0x20 /* XO-1 only */
104#define EC_SCI_SRC_ACPWR 0x40 131#define EC_SCI_SRC_ACPWR 0x40
105#define EC_SCI_SRC_ALL 0x7F 132#define EC_SCI_SRC_BATCRIT 0x80
133#define EC_SCI_SRC_GPWAKE 0x100 /* XO-1.5 only */
134#define EC_SCI_SRC_ALL 0x1FF
106 135
107/* GPIO assignments */ 136/* GPIO assignments */
108 137
@@ -116,7 +145,7 @@ extern int olpc_ec_mask_unset(uint8_t bits);
116#define OLPC_GPIO_SMB_CLK 14 145#define OLPC_GPIO_SMB_CLK 14
117#define OLPC_GPIO_SMB_DATA 15 146#define OLPC_GPIO_SMB_DATA 15
118#define OLPC_GPIO_WORKAUX geode_gpio(24) 147#define OLPC_GPIO_WORKAUX geode_gpio(24)
119#define OLPC_GPIO_LID geode_gpio(26) 148#define OLPC_GPIO_LID 26
120#define OLPC_GPIO_ECSCI geode_gpio(27) 149#define OLPC_GPIO_ECSCI 27
121 150
122#endif /* _ASM_X86_OLPC_H */ 151#endif /* _ASM_X86_OLPC_H */
diff --git a/arch/x86/include/asm/prom.h b/arch/x86/include/asm/prom.h
index df1287019e6..644dd885f05 100644
--- a/arch/x86/include/asm/prom.h
+++ b/arch/x86/include/asm/prom.h
@@ -19,7 +19,7 @@
19#include <linux/pci.h> 19#include <linux/pci.h>
20 20
21#include <asm/irq.h> 21#include <asm/irq.h>
22#include <asm/atomic.h> 22#include <linux/atomic.h>
23#include <asm/setup.h> 23#include <asm/setup.h>
24#include <asm/irq_controller.h> 24#include <asm/irq_controller.h>
25 25
diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
index e9e51f710e6..ee67edf86fd 100644
--- a/arch/x86/include/asm/spinlock.h
+++ b/arch/x86/include/asm/spinlock.h
@@ -1,7 +1,7 @@
1#ifndef _ASM_X86_SPINLOCK_H 1#ifndef _ASM_X86_SPINLOCK_H
2#define _ASM_X86_SPINLOCK_H 2#define _ASM_X86_SPINLOCK_H
3 3
4#include <asm/atomic.h> 4#include <linux/atomic.h>
5#include <asm/page.h> 5#include <asm/page.h>
6#include <asm/processor.h> 6#include <asm/processor.h>
7#include <linux/compiler.h> 7#include <linux/compiler.h>
diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 1f2e61e2898..a1fe5c127b5 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -21,7 +21,7 @@ struct task_struct;
21struct exec_domain; 21struct exec_domain;
22#include <asm/processor.h> 22#include <asm/processor.h>
23#include <asm/ftrace.h> 23#include <asm/ftrace.h>
24#include <asm/atomic.h> 24#include <linux/atomic.h>
25 25
26struct thread_info { 26struct thread_info {
27 struct task_struct *task; /* main task structure */ 27 struct task_struct *task; /* main task structure */