aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-powerpc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r--include/asm-powerpc/atomic.h38
-rw-r--r--include/asm-powerpc/bitops.h105
-rw-r--r--include/asm-powerpc/bug.h36
-rw-r--r--include/asm-powerpc/cputable.h335
-rw-r--r--include/asm-powerpc/cputime.h202
-rw-r--r--include/asm-powerpc/firmware.h26
-rw-r--r--include/asm-powerpc/floppy.h5
-rw-r--r--include/asm-powerpc/futex.h6
-rw-r--r--include/asm-powerpc/hvcall.h1
-rw-r--r--include/asm-powerpc/hvconsole.h26
-rw-r--r--include/asm-powerpc/irq.h6
-rw-r--r--include/asm-powerpc/iseries/mf.h7
-rw-r--r--include/asm-powerpc/kdebug.h12
-rw-r--r--include/asm-powerpc/lmb.h19
-rw-r--r--include/asm-powerpc/machdep.h43
-rw-r--r--include/asm-powerpc/mmu.h1
-rw-r--r--include/asm-powerpc/oprofile_impl.h17
-rw-r--r--include/asm-powerpc/paca.h9
-rw-r--r--include/asm-powerpc/page.h3
-rw-r--r--include/asm-powerpc/percpu.h7
-rw-r--r--include/asm-powerpc/pgtable-4k.h11
-rw-r--r--include/asm-powerpc/pgtable.h14
-rw-r--r--include/asm-powerpc/pmac_feature.h2
-rw-r--r--include/asm-powerpc/poll.h1
-rw-r--r--include/asm-powerpc/ppc-pci.h1
-rw-r--r--include/asm-powerpc/ppc_asm.h42
-rw-r--r--include/asm-powerpc/processor.h44
-rw-r--r--include/asm-powerpc/prom.h20
-rw-r--r--include/asm-powerpc/reg.h4
-rw-r--r--include/asm-powerpc/rwsem.h2
-rw-r--r--include/asm-powerpc/smp.h2
-rw-r--r--include/asm-powerpc/spu.h11
-rw-r--r--include/asm-powerpc/string.h2
-rw-r--r--include/asm-powerpc/synch.h2
-rw-r--r--include/asm-powerpc/syscalls.h58
-rw-r--r--include/asm-powerpc/system.h11
-rw-r--r--include/asm-powerpc/time.h15
-rw-r--r--include/asm-powerpc/types.h5
-rw-r--r--include/asm-powerpc/unistd.h38
-rw-r--r--include/asm-powerpc/vdso_datapage.h3
40 files changed, 719 insertions, 473 deletions
diff --git a/include/asm-powerpc/atomic.h b/include/asm-powerpc/atomic.h
index 147a38dcc766..bb3c0ab7e667 100644
--- a/include/asm-powerpc/atomic.h
+++ b/include/asm-powerpc/atomic.h
@@ -8,6 +8,7 @@
8typedef struct { volatile int counter; } atomic_t; 8typedef struct { volatile int counter; } atomic_t;
9 9
10#ifdef __KERNEL__ 10#ifdef __KERNEL__
11#include <linux/compiler.h>
11#include <asm/synch.h> 12#include <asm/synch.h>
12#include <asm/asm-compat.h> 13#include <asm/asm-compat.h>
13 14
@@ -176,20 +177,29 @@ static __inline__ int atomic_dec_return(atomic_t *v)
176 * Atomically adds @a to @v, so long as it was not @u. 177 * Atomically adds @a to @v, so long as it was not @u.
177 * Returns non-zero if @v was not @u, and zero otherwise. 178 * Returns non-zero if @v was not @u, and zero otherwise.
178 */ 179 */
179#define atomic_add_unless(v, a, u) \ 180static __inline__ int atomic_add_unless(atomic_t *v, int a, int u)
180({ \ 181{
181 int c, old; \ 182 int t;
182 c = atomic_read(v); \ 183
183 for (;;) { \ 184 __asm__ __volatile__ (
184 if (unlikely(c == (u))) \ 185 LWSYNC_ON_SMP
185 break; \ 186"1: lwarx %0,0,%1 # atomic_add_unless\n\
186 old = atomic_cmpxchg((v), c, c + (a)); \ 187 cmpw 0,%0,%3 \n\
187 if (likely(old == c)) \ 188 beq- 2f \n\
188 break; \ 189 add %0,%2,%0 \n"
189 c = old; \ 190 PPC405_ERR77(0,%2)
190 } \ 191" stwcx. %0,0,%1 \n\
191 c != (u); \ 192 bne- 1b \n"
192}) 193 ISYNC_ON_SMP
194" subf %0,%2,%0 \n\
1952:"
196 : "=&r" (t)
197 : "r" (&v->counter), "r" (a), "r" (u)
198 : "cc", "memory");
199
200 return t != u;
201}
202
193#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 203#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
194 204
195#define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0) 205#define atomic_sub_and_test(a, v) (atomic_sub_return((a), (v)) == 0)
diff --git a/include/asm-powerpc/bitops.h b/include/asm-powerpc/bitops.h
index bf6941a810b8..d1c2a4405660 100644
--- a/include/asm-powerpc/bitops.h
+++ b/include/asm-powerpc/bitops.h
@@ -184,72 +184,7 @@ static __inline__ void set_bits(unsigned long mask, unsigned long *addr)
184 : "cc"); 184 : "cc");
185} 185}
186 186
187/* Non-atomic versions */ 187#include <asm-generic/bitops/non-atomic.h>
188static __inline__ int test_bit(unsigned long nr,
189 __const__ volatile unsigned long *addr)
190{
191 return 1UL & (addr[BITOP_WORD(nr)] >> (nr & (BITS_PER_LONG-1)));
192}
193
194static __inline__ void __set_bit(unsigned long nr,
195 volatile unsigned long *addr)
196{
197 unsigned long mask = BITOP_MASK(nr);
198 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
199
200 *p |= mask;
201}
202
203static __inline__ void __clear_bit(unsigned long nr,
204 volatile unsigned long *addr)
205{
206 unsigned long mask = BITOP_MASK(nr);
207 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
208
209 *p &= ~mask;
210}
211
212static __inline__ void __change_bit(unsigned long nr,
213 volatile unsigned long *addr)
214{
215 unsigned long mask = BITOP_MASK(nr);
216 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
217
218 *p ^= mask;
219}
220
221static __inline__ int __test_and_set_bit(unsigned long nr,
222 volatile unsigned long *addr)
223{
224 unsigned long mask = BITOP_MASK(nr);
225 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
226 unsigned long old = *p;
227
228 *p = old | mask;
229 return (old & mask) != 0;
230}
231
232static __inline__ int __test_and_clear_bit(unsigned long nr,
233 volatile unsigned long *addr)
234{
235 unsigned long mask = BITOP_MASK(nr);
236 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
237 unsigned long old = *p;
238
239 *p = old & ~mask;
240 return (old & mask) != 0;
241}
242
243static __inline__ int __test_and_change_bit(unsigned long nr,
244 volatile unsigned long *addr)
245{
246 unsigned long mask = BITOP_MASK(nr);
247 unsigned long *p = ((unsigned long *)addr) + BITOP_WORD(nr);
248 unsigned long old = *p;
249
250 *p = old ^ mask;
251 return (old & mask) != 0;
252}
253 188
254/* 189/*
255 * Return the zero-based bit position (LE, not IBM bit numbering) of 190 * Return the zero-based bit position (LE, not IBM bit numbering) of
@@ -310,16 +245,9 @@ static __inline__ int fls(unsigned int x)
310 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x)); 245 asm ("cntlzw %0,%1" : "=r" (lz) : "r" (x));
311 return 32 - lz; 246 return 32 - lz;
312} 247}
313#define fls64(x) generic_fls64(x) 248#include <asm-generic/bitops/fls64.h>
314 249
315/* 250#include <asm-generic/bitops/hweight.h>
316 * hweightN: returns the hamming weight (i.e. the number
317 * of bits set) of a N-bit word
318 */
319#define hweight64(x) generic_hweight64(x)
320#define hweight32(x) generic_hweight32(x)
321#define hweight16(x) generic_hweight16(x)
322#define hweight8(x) generic_hweight8(x)
323 251
324#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0) 252#define find_first_zero_bit(addr, size) find_next_zero_bit((addr), (size), 0)
325unsigned long find_next_zero_bit(const unsigned long *addr, 253unsigned long find_next_zero_bit(const unsigned long *addr,
@@ -397,32 +325,7 @@ unsigned long find_next_zero_le_bit(const unsigned long *addr,
397#define minix_find_first_zero_bit(addr,size) \ 325#define minix_find_first_zero_bit(addr,size) \
398 find_first_zero_le_bit((unsigned long *)addr, size) 326 find_first_zero_le_bit((unsigned long *)addr, size)
399 327
400/* 328#include <asm-generic/bitops/sched.h>
401 * Every architecture must define this function. It's the fastest
402 * way of searching a 140-bit bitmap where the first 100 bits are
403 * unlikely to be set. It's guaranteed that at least one of the 140
404 * bits is cleared.
405 */
406static inline int sched_find_first_bit(const unsigned long *b)
407{
408#ifdef CONFIG_PPC64
409 if (unlikely(b[0]))
410 return __ffs(b[0]);
411 if (unlikely(b[1]))
412 return __ffs(b[1]) + 64;
413 return __ffs(b[2]) + 128;
414#else
415 if (unlikely(b[0]))
416 return __ffs(b[0]);
417 if (unlikely(b[1]))
418 return __ffs(b[1]) + 32;
419 if (unlikely(b[2]))
420 return __ffs(b[2]) + 64;
421 if (b[3])
422 return __ffs(b[3]) + 96;
423 return __ffs(b[4]) + 128;
424#endif
425}
426 329
427#endif /* __KERNEL__ */ 330#endif /* __KERNEL__ */
428 331
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index 99817a802ca4..f44b529e3298 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -30,34 +30,60 @@ struct bug_entry *find_bug(unsigned long bugaddr);
30 30
31#ifdef CONFIG_BUG 31#ifdef CONFIG_BUG
32 32
33/*
34 * BUG_ON() and WARN_ON() do their best to cooperate with compile-time
35 * optimisations. However depending on the complexity of the condition
36 * some compiler versions may not produce optimal results.
37 */
38
33#define BUG() do { \ 39#define BUG() do { \
34 __asm__ __volatile__( \ 40 __asm__ __volatile__( \
35 "1: twi 31,0,0\n" \ 41 "1: twi 31,0,0\n" \
36 ".section __bug_table,\"a\"\n" \ 42 ".section __bug_table,\"a\"\n" \
37 "\t"PPC_LONG" 1b,%0,%1,%2\n" \ 43 "\t"PPC_LONG" 1b,%0,%1,%2\n" \
38 ".previous" \ 44 ".previous" \
39 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ 45 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
40} while (0) 46} while (0)
41 47
42#define BUG_ON(x) do { \ 48#define BUG_ON(x) do { \
43 __asm__ __volatile__( \ 49 if (__builtin_constant_p(x)) { \
50 if (x) \
51 BUG(); \
52 } else { \
53 __asm__ __volatile__( \
44 "1: "PPC_TLNEI" %0,0\n" \ 54 "1: "PPC_TLNEI" %0,0\n" \
45 ".section __bug_table,\"a\"\n" \ 55 ".section __bug_table,\"a\"\n" \
46 "\t"PPC_LONG" 1b,%1,%2,%3\n" \ 56 "\t"PPC_LONG" 1b,%1,%2,%3\n" \
47 ".previous" \ 57 ".previous" \
48 : : "r" ((long)(x)), "i" (__LINE__), \ 58 : : "r" ((long)(x)), "i" (__LINE__), \
49 "i" (__FILE__), "i" (__FUNCTION__)); \ 59 "i" (__FILE__), "i" (__FUNCTION__)); \
60 } \
50} while (0) 61} while (0)
51 62
52#define WARN_ON(x) do { \ 63#define __WARN() do { \
53 __asm__ __volatile__( \ 64 __asm__ __volatile__( \
65 "1: twi 31,0,0\n" \
66 ".section __bug_table,\"a\"\n" \
67 "\t"PPC_LONG" 1b,%0,%1,%2\n" \
68 ".previous" \
69 : : "i" (__LINE__ + BUG_WARNING_TRAP), \
70 "i" (__FILE__), "i" (__FUNCTION__)); \
71} while (0)
72
73#define WARN_ON(x) do { \
74 if (__builtin_constant_p(x)) { \
75 if (x) \
76 __WARN(); \
77 } else { \
78 __asm__ __volatile__( \
54 "1: "PPC_TLNEI" %0,0\n" \ 79 "1: "PPC_TLNEI" %0,0\n" \
55 ".section __bug_table,\"a\"\n" \ 80 ".section __bug_table,\"a\"\n" \
56 "\t"PPC_LONG" 1b,%1,%2,%3\n" \ 81 "\t"PPC_LONG" 1b,%1,%2,%3\n" \
57 ".previous" \ 82 ".previous" \
58 : : "r" ((long)(x)), \ 83 : : "r" ((long)(x)), \
59 "i" (__LINE__ + BUG_WARNING_TRAP), \ 84 "i" (__LINE__ + BUG_WARNING_TRAP), \
60 "i" (__FILE__), "i" (__FUNCTION__)); \ 85 "i" (__FILE__), "i" (__FUNCTION__)); \
86 } \
61} while (0) 87} while (0)
62 88
63#define HAVE_ARCH_BUG 89#define HAVE_ARCH_BUG
diff --git a/include/asm-powerpc/cputable.h b/include/asm-powerpc/cputable.h
index 5638518968c3..4321483cce51 100644
--- a/include/asm-powerpc/cputable.h
+++ b/include/asm-powerpc/cputable.h
@@ -102,38 +102,40 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
102#define CPU_FTR_NEED_COHERENT ASM_CONST(0x0000000000020000) 102#define CPU_FTR_NEED_COHERENT ASM_CONST(0x0000000000020000)
103#define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000) 103#define CPU_FTR_NO_BTIC ASM_CONST(0x0000000000040000)
104#define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000) 104#define CPU_FTR_BIG_PHYS ASM_CONST(0x0000000000080000)
105#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000) 105#define CPU_FTR_NODSISRALIGN ASM_CONST(0x0000000000100000)
106 106
107#ifdef __powerpc64__ 107#ifdef __powerpc64__
108/* Add the 64b processor unique features in the top half of the word */ 108/* Add the 64b processor unique features in the top half of the word */
109#define CPU_FTR_SLB ASM_CONST(0x0000000100000000) 109#define CPU_FTR_SLB ASM_CONST(0x0000000100000000)
110#define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000) 110#define CPU_FTR_16M_PAGE ASM_CONST(0x0000000200000000)
111#define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000) 111#define CPU_FTR_TLBIEL ASM_CONST(0x0000000400000000)
112#define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000) 112#define CPU_FTR_NOEXECUTE ASM_CONST(0x0000000800000000)
113#define CPU_FTR_IABR ASM_CONST(0x0000002000000000) 113#define CPU_FTR_IABR ASM_CONST(0x0000002000000000)
114#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000) 114#define CPU_FTR_MMCRA ASM_CONST(0x0000004000000000)
115#define CPU_FTR_CTRL ASM_CONST(0x0000008000000000) 115#define CPU_FTR_CTRL ASM_CONST(0x0000008000000000)
116#define CPU_FTR_SMT ASM_CONST(0x0000010000000000) 116#define CPU_FTR_SMT ASM_CONST(0x0000010000000000)
117#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000) 117#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0000020000000000)
118#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000) 118#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0000040000000000)
119#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000) 119#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0000080000000000)
120#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000) 120#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0000100000000000)
121#define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000) 121#define CPU_FTR_PAUSE_ZERO ASM_CONST(0x0000200000000000)
122#define CPU_FTR_PURR ASM_CONST(0x0000400000000000)
122#else 123#else
123/* ensure on 32b processors the flags are available for compiling but 124/* ensure on 32b processors the flags are available for compiling but
124 * don't do anything */ 125 * don't do anything */
125#define CPU_FTR_SLB ASM_CONST(0x0) 126#define CPU_FTR_SLB ASM_CONST(0x0)
126#define CPU_FTR_16M_PAGE ASM_CONST(0x0) 127#define CPU_FTR_16M_PAGE ASM_CONST(0x0)
127#define CPU_FTR_TLBIEL ASM_CONST(0x0) 128#define CPU_FTR_TLBIEL ASM_CONST(0x0)
128#define CPU_FTR_NOEXECUTE ASM_CONST(0x0) 129#define CPU_FTR_NOEXECUTE ASM_CONST(0x0)
129#define CPU_FTR_IABR ASM_CONST(0x0) 130#define CPU_FTR_IABR ASM_CONST(0x0)
130#define CPU_FTR_MMCRA ASM_CONST(0x0) 131#define CPU_FTR_MMCRA ASM_CONST(0x0)
131#define CPU_FTR_CTRL ASM_CONST(0x0) 132#define CPU_FTR_CTRL ASM_CONST(0x0)
132#define CPU_FTR_SMT ASM_CONST(0x0) 133#define CPU_FTR_SMT ASM_CONST(0x0)
133#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0) 134#define CPU_FTR_COHERENT_ICACHE ASM_CONST(0x0)
134#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0) 135#define CPU_FTR_LOCKLESS_TLBIE ASM_CONST(0x0)
135#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0) 136#define CPU_FTR_MMCRA_SIHV ASM_CONST(0x0)
136#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0) 137#define CPU_FTR_CI_LARGE_PAGE ASM_CONST(0x0)
138#define CPU_FTR_PURR ASM_CONST(0x0)
137#endif 139#endif
138 140
139#ifndef __ASSEMBLY__ 141#ifndef __ASSEMBLY__
@@ -186,153 +188,154 @@ extern void do_cpu_ftr_fixups(unsigned long offset);
186 !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \ 188 !defined(CONFIG_POWER3) && !defined(CONFIG_POWER4) && \
187 !defined(CONFIG_BOOKE)) 189 !defined(CONFIG_BOOKE))
188 190
189enum { 191#define CPU_FTRS_PPC601 (CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE)
190 CPU_FTRS_PPC601 = CPU_FTR_COMMON | CPU_FTR_601 | CPU_FTR_HPTE_TABLE, 192#define CPU_FTRS_603 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
191 CPU_FTRS_603 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 193 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | \
192 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | 194 CPU_FTR_MAYBE_CAN_NAP)
193 CPU_FTR_MAYBE_CAN_NAP, 195#define CPU_FTRS_604 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
194 CPU_FTRS_604 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 196 CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE)
195 CPU_FTR_USE_TB | CPU_FTR_604_PERF_MON | CPU_FTR_HPTE_TABLE, 197#define CPU_FTRS_740_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
196 CPU_FTRS_740_NOTAU = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 198 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
197 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 199 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP)
198 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, 200#define CPU_FTRS_740 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
199 CPU_FTRS_740 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 201 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
200 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 202 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP)
201 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, 203#define CPU_FTRS_750 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
202 CPU_FTRS_750 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 204 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
203 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 205 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP)
204 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP, 206#define CPU_FTRS_750FX1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
205 CPU_FTRS_750FX1 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 207 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
206 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 208 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
207 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | 209 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM)
208 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_NO_DPM, 210#define CPU_FTRS_750FX2 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
209 CPU_FTRS_750FX2 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 211 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
210 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 212 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
211 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | 213 CPU_FTR_NO_DPM)
212 CPU_FTR_NO_DPM, 214#define CPU_FTRS_750FX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
213 CPU_FTRS_750FX = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 215 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
214 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 216 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
215 CPU_FTR_TAU | CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | 217 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS)
216 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, 218#define CPU_FTRS_750GX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
217 CPU_FTRS_750GX = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 219 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | \
218 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_TAU | 220 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | \
219 CPU_FTR_HPTE_TABLE | CPU_FTR_MAYBE_CAN_NAP | 221 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS)
220 CPU_FTR_DUAL_PLL_750FX | CPU_FTR_HAS_HIGH_BATS, 222#define CPU_FTRS_7400_NOTAU (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
221 CPU_FTRS_7400_NOTAU = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 223 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
222 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 224 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \
223 CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | 225 CPU_FTR_MAYBE_CAN_NAP)
224 CPU_FTR_MAYBE_CAN_NAP, 226#define CPU_FTRS_7400 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
225 CPU_FTRS_7400 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 227 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | \
226 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB | CPU_FTR_L2CR | 228 CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | \
227 CPU_FTR_TAU | CPU_FTR_ALTIVEC_COMP | CPU_FTR_HPTE_TABLE | 229 CPU_FTR_MAYBE_CAN_NAP)
228 CPU_FTR_MAYBE_CAN_NAP, 230#define CPU_FTRS_7450_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
229 CPU_FTRS_7450_20 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 231 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
230 CPU_FTR_USE_TB | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 232 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
231 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 233 CPU_FTR_NEED_COHERENT)
232 CPU_FTR_NEED_COHERENT, 234#define CPU_FTRS_7450_21 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
233 CPU_FTRS_7450_21 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 235 CPU_FTR_USE_TB | \
234 CPU_FTR_USE_TB | 236 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
235 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 237 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
236 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 238 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
237 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | 239 CPU_FTR_NEED_COHERENT)
238 CPU_FTR_NEED_COHERENT, 240#define CPU_FTRS_7450_23 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
239 CPU_FTRS_7450_23 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 241 CPU_FTR_USE_TB | \
240 CPU_FTR_USE_TB | 242 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
241 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 243 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
242 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 244 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT)
243 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_NEED_COHERENT, 245#define CPU_FTRS_7455_1 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
244 CPU_FTRS_7455_1 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 246 CPU_FTR_USE_TB | \
245 CPU_FTR_USE_TB | 247 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | \
246 CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | CPU_FTR_L3CR | 248 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | \
247 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | CPU_FTR_HAS_HIGH_BATS | 249 CPU_FTR_NEED_COHERENT)
248 CPU_FTR_NEED_COHERENT, 250#define CPU_FTRS_7455_20 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
249 CPU_FTRS_7455_20 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 251 CPU_FTR_USE_TB | \
250 CPU_FTR_USE_TB | 252 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
251 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 253 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
252 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 254 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | \
253 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_L3_DISABLE_NAP | 255 CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS)
254 CPU_FTR_NEED_COHERENT | CPU_FTR_HAS_HIGH_BATS, 256#define CPU_FTRS_7455 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
255 CPU_FTRS_7455 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 257 CPU_FTR_USE_TB | \
256 CPU_FTR_USE_TB | 258 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
257 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 259 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
258 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 260 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
259 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | 261 CPU_FTR_NEED_COHERENT)
260 CPU_FTR_NEED_COHERENT, 262#define CPU_FTRS_7447_10 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
261 CPU_FTRS_7447_10 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 263 CPU_FTR_USE_TB | \
262 CPU_FTR_USE_TB | 264 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
263 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 265 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
264 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 266 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
265 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | 267 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC)
266 CPU_FTR_NEED_COHERENT | CPU_FTR_NO_BTIC, 268#define CPU_FTRS_7447 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
267 CPU_FTRS_7447 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 269 CPU_FTR_USE_TB | \
268 CPU_FTR_USE_TB | 270 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
269 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 271 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
270 CPU_FTR_L3CR | CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 272 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
271 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | 273 CPU_FTR_NEED_COHERENT)
272 CPU_FTR_NEED_COHERENT, 274#define CPU_FTRS_7447A (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
273 CPU_FTRS_7447A = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 275 CPU_FTR_USE_TB | \
274 CPU_FTR_USE_TB | 276 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | \
275 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_L2CR | CPU_FTR_ALTIVEC_COMP | 277 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | \
276 CPU_FTR_HPTE_TABLE | CPU_FTR_SPEC7450 | 278 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | \
277 CPU_FTR_NAP_DISABLE_L2_PR | CPU_FTR_HAS_HIGH_BATS | 279 CPU_FTR_NEED_COHERENT)
278 CPU_FTR_NEED_COHERENT, 280#define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
279 CPU_FTRS_82XX = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 281 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB)
280 CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_USE_TB, 282#define CPU_FTRS_G2_LE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
281 CPU_FTRS_G2_LE = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 283 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS)
282 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS, 284#define CPU_FTRS_E300 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | \
283 CPU_FTRS_E300 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_MAYBE_CAN_DOZE | 285 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | \
284 CPU_FTR_USE_TB | CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_HAS_HIGH_BATS | 286 CPU_FTR_COMMON)
285 CPU_FTR_COMMON, 287#define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
286 CPU_FTRS_CLASSIC32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 288 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
287 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, 289#define CPU_FTRS_POWER3_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
288 CPU_FTRS_POWER3_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 290 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE)
289 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE, 291#define CPU_FTRS_POWER4_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
290 CPU_FTRS_POWER4_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 292 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN)
291 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_NODSISRALIGN, 293#define CPU_FTRS_970_32 (CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | \
292 CPU_FTRS_970_32 = CPU_FTR_COMMON | CPU_FTR_SPLIT_ID_CACHE | 294 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | \
293 CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE | CPU_FTR_ALTIVEC_COMP | 295 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN)
294 CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NODSISRALIGN, 296#define CPU_FTRS_8XX (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB)
295 CPU_FTRS_8XX = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB, 297#define CPU_FTRS_40X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
296 CPU_FTRS_40X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 298 CPU_FTR_NODSISRALIGN)
297 CPU_FTR_NODSISRALIGN, 299#define CPU_FTRS_44X (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
298 CPU_FTRS_44X = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 300 CPU_FTR_NODSISRALIGN)
299 CPU_FTR_NODSISRALIGN, 301#define CPU_FTRS_E200 (CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN)
300 CPU_FTRS_E200 = CPU_FTR_USE_TB | CPU_FTR_NODSISRALIGN, 302#define CPU_FTRS_E500 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
301 CPU_FTRS_E500 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 303 CPU_FTR_NODSISRALIGN)
302 CPU_FTR_NODSISRALIGN, 304#define CPU_FTRS_E500_2 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
303 CPU_FTRS_E500_2 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 305 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN)
304 CPU_FTR_BIG_PHYS | CPU_FTR_NODSISRALIGN, 306#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
305 CPU_FTRS_GENERIC_32 = CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN,
306#ifdef __powerpc64__ 307#ifdef __powerpc64__
307 CPU_FTRS_POWER3 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 308#define CPU_FTRS_POWER3 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
308 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR, 309 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR)
309 CPU_FTRS_RS64 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 310#define CPU_FTRS_RS64 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
310 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | 311 CPU_FTR_HPTE_TABLE | CPU_FTR_IABR | \
311 CPU_FTR_MMCRA | CPU_FTR_CTRL, 312 CPU_FTR_MMCRA | CPU_FTR_CTRL)
312 CPU_FTRS_POWER4 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 313#define CPU_FTRS_POWER4 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
313 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA, 314 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_MMCRA)
314 CPU_FTRS_PPC970 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 315#define CPU_FTRS_PPC970 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
315 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | 316 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
316 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA, 317 CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP | CPU_FTR_MMCRA)
317 CPU_FTRS_POWER5 = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 318#define CPU_FTRS_POWER5 (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
318 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | 319 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
319 CPU_FTR_MMCRA | CPU_FTR_SMT | 320 CPU_FTR_MMCRA | CPU_FTR_SMT | \
320 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | 321 CPU_FTR_COHERENT_ICACHE | CPU_FTR_LOCKLESS_TLBIE | \
321 CPU_FTR_MMCRA_SIHV, 322 CPU_FTR_MMCRA_SIHV | CPU_FTR_PURR)
322 CPU_FTRS_CELL = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 323#define CPU_FTRS_CELL (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
323 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | 324 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2 | \
324 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | 325 CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \
325 CPU_FTR_CTRL | CPU_FTR_PAUSE_ZERO, 326 CPU_FTR_CTRL | CPU_FTR_PAUSE_ZERO)
326 CPU_FTRS_COMPATIBLE = CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | 327#define CPU_FTRS_COMPATIBLE (CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | \
327 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2, 328 CPU_FTR_HPTE_TABLE | CPU_FTR_PPCAS_ARCH_V2)
328#endif 329#endif
329 330
330 CPU_FTRS_POSSIBLE =
331#ifdef __powerpc64__ 331#ifdef __powerpc64__
332 CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | 332#define CPU_FTRS_POSSIBLE \
333 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_CELL | 333 (CPU_FTRS_POWER3 | CPU_FTRS_RS64 | CPU_FTRS_POWER4 | \
334 CPU_FTR_CI_LARGE_PAGE | 334 CPU_FTRS_PPC970 | CPU_FTRS_POWER5 | CPU_FTRS_CELL | \
335 CPU_FTR_CI_LARGE_PAGE)
335#else 336#else
337enum {
338 CPU_FTRS_POSSIBLE =
336#if CLASSIC_PPC 339#if CLASSIC_PPC
337 CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU | 340 CPU_FTRS_PPC601 | CPU_FTRS_603 | CPU_FTRS_604 | CPU_FTRS_740_NOTAU |
338 CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 | 341 CPU_FTRS_740 | CPU_FTRS_750 | CPU_FTRS_750FX1 |
@@ -366,14 +369,18 @@ enum {
366#ifdef CONFIG_E500 369#ifdef CONFIG_E500
367 CPU_FTRS_E500 | CPU_FTRS_E500_2 | 370 CPU_FTRS_E500 | CPU_FTRS_E500_2 |
368#endif 371#endif
369#endif /* __powerpc64__ */
370 0, 372 0,
373};
374#endif /* __powerpc64__ */
371 375
372 CPU_FTRS_ALWAYS =
373#ifdef __powerpc64__ 376#ifdef __powerpc64__
374 CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & 377#define CPU_FTRS_ALWAYS \
375 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_CELL & 378 (CPU_FTRS_POWER3 & CPU_FTRS_RS64 & CPU_FTRS_POWER4 & \
379 CPU_FTRS_PPC970 & CPU_FTRS_POWER5 & CPU_FTRS_CELL & \
380 CPU_FTRS_POSSIBLE)
376#else 381#else
382enum {
383 CPU_FTRS_ALWAYS =
377#if CLASSIC_PPC 384#if CLASSIC_PPC
378 CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU & 385 CPU_FTRS_PPC601 & CPU_FTRS_603 & CPU_FTRS_604 & CPU_FTRS_740_NOTAU &
379 CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 & 386 CPU_FTRS_740 & CPU_FTRS_750 & CPU_FTRS_750FX1 &
@@ -407,9 +414,9 @@ enum {
407#ifdef CONFIG_E500 414#ifdef CONFIG_E500
408 CPU_FTRS_E500 & CPU_FTRS_E500_2 & 415 CPU_FTRS_E500 & CPU_FTRS_E500_2 &
409#endif 416#endif
410#endif /* __powerpc64__ */
411 CPU_FTRS_POSSIBLE, 417 CPU_FTRS_POSSIBLE,
412}; 418};
419#endif /* __powerpc64__ */
413 420
414static inline int cpu_has_feature(unsigned long feature) 421static inline int cpu_has_feature(unsigned long feature)
415{ 422{
diff --git a/include/asm-powerpc/cputime.h b/include/asm-powerpc/cputime.h
index 6d68ad7e0ea3..a21185d47883 100644
--- a/include/asm-powerpc/cputime.h
+++ b/include/asm-powerpc/cputime.h
@@ -1 +1,203 @@
1/*
2 * Definitions for measuring cputime on powerpc machines.
3 *
4 * Copyright (C) 2006 Paul Mackerras, IBM Corp.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 * If we have CONFIG_VIRT_CPU_ACCOUNTING, we measure cpu time in
12 * the same units as the timebase. Otherwise we measure cpu time
13 * in jiffies using the generic definitions.
14 */
15
16#ifndef __POWERPC_CPUTIME_H
17#define __POWERPC_CPUTIME_H
18
19#ifndef CONFIG_VIRT_CPU_ACCOUNTING
1#include <asm-generic/cputime.h> 20#include <asm-generic/cputime.h>
21#else
22
23#include <linux/types.h>
24#include <linux/time.h>
25#include <asm/div64.h>
26#include <asm/time.h>
27#include <asm/param.h>
28
29typedef u64 cputime_t;
30typedef u64 cputime64_t;
31
32#define cputime_zero ((cputime_t)0)
33#define cputime_max ((~((cputime_t)0) >> 1) - 1)
34#define cputime_add(__a, __b) ((__a) + (__b))
35#define cputime_sub(__a, __b) ((__a) - (__b))
36#define cputime_div(__a, __n) ((__a) / (__n))
37#define cputime_halve(__a) ((__a) >> 1)
38#define cputime_eq(__a, __b) ((__a) == (__b))
39#define cputime_gt(__a, __b) ((__a) > (__b))
40#define cputime_ge(__a, __b) ((__a) >= (__b))
41#define cputime_lt(__a, __b) ((__a) < (__b))
42#define cputime_le(__a, __b) ((__a) <= (__b))
43
44#define cputime64_zero ((cputime64_t)0)
45#define cputime64_add(__a, __b) ((__a) + (__b))
46#define cputime_to_cputime64(__ct) (__ct)
47
48#ifdef __KERNEL__
49
50/*
51 * Convert cputime <-> jiffies
52 */
53extern u64 __cputime_jiffies_factor;
54
55static inline unsigned long cputime_to_jiffies(const cputime_t ct)
56{
57 return mulhdu(ct, __cputime_jiffies_factor);
58}
59
60static inline cputime_t jiffies_to_cputime(const unsigned long jif)
61{
62 cputime_t ct;
63 unsigned long sec;
64
65 /* have to be a little careful about overflow */
66 ct = jif % HZ;
67 sec = jif / HZ;
68 if (ct) {
69 ct *= tb_ticks_per_sec;
70 do_div(ct, HZ);
71 }
72 if (sec)
73 ct += (cputime_t) sec * tb_ticks_per_sec;
74 return ct;
75}
76
77static inline u64 cputime64_to_jiffies64(const cputime_t ct)
78{
79 return mulhdu(ct, __cputime_jiffies_factor);
80}
81
82/*
83 * Convert cputime <-> milliseconds
84 */
85extern u64 __cputime_msec_factor;
86
87static inline unsigned long cputime_to_msecs(const cputime_t ct)
88{
89 return mulhdu(ct, __cputime_msec_factor);
90}
91
92static inline cputime_t msecs_to_cputime(const unsigned long ms)
93{
94 cputime_t ct;
95 unsigned long sec;
96
97 /* have to be a little careful about overflow */
98 ct = ms % 1000;
99 sec = ms / 1000;
100 if (ct) {
101 ct *= tb_ticks_per_sec;
102 do_div(ct, 1000);
103 }
104 if (sec)
105 ct += (cputime_t) sec * tb_ticks_per_sec;
106 return ct;
107}
108
109/*
110 * Convert cputime <-> seconds
111 */
112extern u64 __cputime_sec_factor;
113
114static inline unsigned long cputime_to_secs(const cputime_t ct)
115{
116 return mulhdu(ct, __cputime_sec_factor);
117}
118
119static inline cputime_t secs_to_cputime(const unsigned long sec)
120{
121 return (cputime_t) sec * tb_ticks_per_sec;
122}
123
124/*
125 * Convert cputime <-> timespec
126 */
127static inline void cputime_to_timespec(const cputime_t ct, struct timespec *p)
128{
129 u64 x = ct;
130 unsigned int frac;
131
132 frac = do_div(x, tb_ticks_per_sec);
133 p->tv_sec = x;
134 x = (u64) frac * 1000000000;
135 do_div(x, tb_ticks_per_sec);
136 p->tv_nsec = x;
137}
138
139static inline cputime_t timespec_to_cputime(const struct timespec *p)
140{
141 cputime_t ct;
142
143 ct = (u64) p->tv_nsec * tb_ticks_per_sec;
144 do_div(ct, 1000000000);
145 return ct + (u64) p->tv_sec * tb_ticks_per_sec;
146}
147
148/*
149 * Convert cputime <-> timeval
150 */
151static inline void cputime_to_timeval(const cputime_t ct, struct timeval *p)
152{
153 u64 x = ct;
154 unsigned int frac;
155
156 frac = do_div(x, tb_ticks_per_sec);
157 p->tv_sec = x;
158 x = (u64) frac * 1000000;
159 do_div(x, tb_ticks_per_sec);
160 p->tv_usec = x;
161}
162
163static inline cputime_t timeval_to_cputime(const struct timeval *p)
164{
165 cputime_t ct;
166
167 ct = (u64) p->tv_usec * tb_ticks_per_sec;
168 do_div(ct, 1000000);
169 return ct + (u64) p->tv_sec * tb_ticks_per_sec;
170}
171
172/*
173 * Convert cputime <-> clock_t (units of 1/USER_HZ seconds)
174 */
175extern u64 __cputime_clockt_factor;
176
177static inline unsigned long cputime_to_clock_t(const cputime_t ct)
178{
179 return mulhdu(ct, __cputime_clockt_factor);
180}
181
182static inline cputime_t clock_t_to_cputime(const unsigned long clk)
183{
184 cputime_t ct;
185 unsigned long sec;
186
187 /* have to be a little careful about overflow */
188 ct = clk % USER_HZ;
189 sec = clk / USER_HZ;
190 if (ct) {
191 ct *= tb_ticks_per_sec;
192 do_div(ct, USER_HZ);
193 }
194 if (sec)
195 ct += (cputime_t) sec * tb_ticks_per_sec;
196 return ct;
197}
198
199#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct))
200
201#endif /* __KERNEL__ */
202#endif /* CONFIG_VIRT_CPU_ACCOUNTING */
203#endif /* __POWERPC_CPUTIME_H */
diff --git a/include/asm-powerpc/firmware.h b/include/asm-powerpc/firmware.h
index f804b34cf06a..77069df92bf8 100644
--- a/include/asm-powerpc/firmware.h
+++ b/include/asm-powerpc/firmware.h
@@ -41,6 +41,7 @@
41#define FW_FEATURE_MULTITCE (1UL<<19) 41#define FW_FEATURE_MULTITCE (1UL<<19)
42#define FW_FEATURE_SPLPAR (1UL<<20) 42#define FW_FEATURE_SPLPAR (1UL<<20)
43#define FW_FEATURE_ISERIES (1UL<<21) 43#define FW_FEATURE_ISERIES (1UL<<21)
44#define FW_FEATURE_LPAR (1UL<<22)
44 45
45enum { 46enum {
46#ifdef CONFIG_PPC64 47#ifdef CONFIG_PPC64
@@ -51,10 +52,10 @@ enum {
51 FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ | 52 FW_FEATURE_MIGRATE | FW_FEATURE_PERFMON | FW_FEATURE_CRQ |
52 FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN | 53 FW_FEATURE_VIO | FW_FEATURE_RDMA | FW_FEATURE_LLAN |
53 FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE | 54 FW_FEATURE_BULK | FW_FEATURE_XDABR | FW_FEATURE_MULTITCE |
54 FW_FEATURE_SPLPAR, 55 FW_FEATURE_SPLPAR | FW_FEATURE_LPAR,
55 FW_FEATURE_PSERIES_ALWAYS = 0, 56 FW_FEATURE_PSERIES_ALWAYS = 0,
56 FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES, 57 FW_FEATURE_ISERIES_POSSIBLE = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
57 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES, 58 FW_FEATURE_ISERIES_ALWAYS = FW_FEATURE_ISERIES | FW_FEATURE_LPAR,
58 FW_FEATURE_POSSIBLE = 59 FW_FEATURE_POSSIBLE =
59#ifdef CONFIG_PPC_PSERIES 60#ifdef CONFIG_PPC_PSERIES
60 FW_FEATURE_PSERIES_POSSIBLE | 61 FW_FEATURE_PSERIES_POSSIBLE |
@@ -81,22 +82,11 @@ enum {
81/* This is used to identify firmware features which are available 82/* This is used to identify firmware features which are available
82 * to the kernel. 83 * to the kernel.
83 */ 84 */
84extern unsigned long ppc64_firmware_features; 85extern unsigned long powerpc_firmware_features;
85 86
86static inline unsigned long firmware_has_feature(unsigned long feature) 87#define firmware_has_feature(feature) \
87{ 88 ((FW_FEATURE_ALWAYS & (feature)) || \
88 return (FW_FEATURE_ALWAYS & feature) || 89 (FW_FEATURE_POSSIBLE & powerpc_firmware_features & (feature)))
89 (FW_FEATURE_POSSIBLE & ppc64_firmware_features & feature);
90}
91
92#ifdef CONFIG_PPC_PSERIES
93typedef struct {
94 unsigned long val;
95 char * name;
96} firmware_feature_t;
97
98extern firmware_feature_t firmware_features_table[];
99#endif
100 90
101extern void system_reset_fwnmi(void); 91extern void system_reset_fwnmi(void);
102extern void machine_check_fwnmi(void); 92extern void machine_check_fwnmi(void);
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h
index e258778ca429..608164c39efb 100644
--- a/include/asm-powerpc/floppy.h
+++ b/include/asm-powerpc/floppy.h
@@ -35,6 +35,7 @@
35#ifdef CONFIG_PCI 35#ifdef CONFIG_PCI
36 36
37#include <linux/pci.h> 37#include <linux/pci.h>
38#include <asm/ppc-pci.h> /* for ppc64_isabridge_dev */
38 39
39#define fd_dma_setup(addr,size,mode,io) powerpc_fd_dma_setup(addr,size,mode,io) 40#define fd_dma_setup(addr,size,mode,io) powerpc_fd_dma_setup(addr,size,mode,io)
40 41
@@ -52,12 +53,12 @@ static __inline__ int powerpc_fd_dma_setup(char *addr, unsigned long size,
52 if (bus_addr 53 if (bus_addr
53 && (addr != prev_addr || size != prev_size || dir != prev_dir)) { 54 && (addr != prev_addr || size != prev_size || dir != prev_dir)) {
54 /* different from last time -- unmap prev */ 55 /* different from last time -- unmap prev */
55 pci_unmap_single(NULL, bus_addr, prev_size, prev_dir); 56 pci_unmap_single(ppc64_isabridge_dev, bus_addr, prev_size, prev_dir);
56 bus_addr = 0; 57 bus_addr = 0;
57 } 58 }
58 59
59 if (!bus_addr) /* need to map it */ 60 if (!bus_addr) /* need to map it */
60 bus_addr = pci_map_single(NULL, addr, size, dir); 61 bus_addr = pci_map_single(ppc64_isabridge_dev, addr, size, dir);
61 62
62 /* remember this one as prev */ 63 /* remember this one as prev */
63 prev_addr = addr; 64 prev_addr = addr;
diff --git a/include/asm-powerpc/futex.h b/include/asm-powerpc/futex.h
index 39e85f320a76..f1b3c00bc1ce 100644
--- a/include/asm-powerpc/futex.h
+++ b/include/asm-powerpc/futex.h
@@ -81,5 +81,11 @@ static inline int futex_atomic_op_inuser (int encoded_op, int __user *uaddr)
81 return ret; 81 return ret;
82} 82}
83 83
84static inline int
85futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
86{
87 return -ENOSYS;
88}
89
84#endif /* __KERNEL__ */ 90#endif /* __KERNEL__ */
85#endif /* _ASM_POWERPC_FUTEX_H */ 91#endif /* _ASM_POWERPC_FUTEX_H */
diff --git a/include/asm-powerpc/hvcall.h b/include/asm-powerpc/hvcall.h
index 38ca9ad6110d..b72c04f3f551 100644
--- a/include/asm-powerpc/hvcall.h
+++ b/include/asm-powerpc/hvcall.h
@@ -9,6 +9,7 @@
9#define H_Closed 2 /* Resource closed */ 9#define H_Closed 2 /* Resource closed */
10#define H_Constrained 4 /* Resource request constrained to max allowed */ 10#define H_Constrained 4 /* Resource request constrained to max allowed */
11#define H_InProgress 14 /* Kind of like busy */ 11#define H_InProgress 14 /* Kind of like busy */
12#define H_Pending 17 /* returned from H_POLL_PENDING */
12#define H_Continue 18 /* Returned from H_Join on success */ 13#define H_Continue 18 /* Returned from H_Join on success */
13#define H_LongBusyStartRange 9900 /* Start of long busy range */ 14#define H_LongBusyStartRange 9900 /* Start of long busy range */
14#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */ 15#define H_LongBusyOrder1msec 9900 /* Long busy, hint that 1msec is a good time to retry */
diff --git a/include/asm-powerpc/hvconsole.h b/include/asm-powerpc/hvconsole.h
index 34daf7b9b62f..35ea69e8121f 100644
--- a/include/asm-powerpc/hvconsole.h
+++ b/include/asm-powerpc/hvconsole.h
@@ -24,28 +24,18 @@
24#ifdef __KERNEL__ 24#ifdef __KERNEL__
25 25
26/* 26/*
27 * This is the max number of console adapters that can/will be found as 27 * PSeries firmware will only send/recv up to 16 bytes of character data per
28 * console devices on first stage console init. Any number beyond this range 28 * hcall.
29 * can't be used as a console device but is still a valid tty device.
30 */ 29 */
31#define MAX_NR_HVC_CONSOLES 16 30#define MAX_VIO_PUT_CHARS 16
31#define SIZE_VIO_GET_CHARS 16
32 32
33/* implemented by a low level driver */ 33/*
34struct hv_ops { 34 * Vio firmware always attempts to fetch MAX_VIO_GET_CHARS chars. The 'count'
35 int (*get_chars)(uint32_t vtermno, char *buf, int count); 35 * parm is included to conform to put_chars() function pointer template
36 int (*put_chars)(uint32_t vtermno, const char *buf, int count); 36 */
37};
38extern int hvc_get_chars(uint32_t vtermno, char *buf, int count); 37extern int hvc_get_chars(uint32_t vtermno, char *buf, int count);
39extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count); 38extern int hvc_put_chars(uint32_t vtermno, const char *buf, int count);
40 39
41struct hvc_struct;
42
43/* Register a vterm and a slot index for use as a console (console_init) */
44extern int hvc_instantiate(uint32_t vtermno, int index, struct hv_ops *ops);
45/* register a vterm for hvc tty operation (module_init or hotplug add) */
46extern struct hvc_struct * __devinit hvc_alloc(uint32_t vtermno, int irq,
47 struct hv_ops *ops);
48/* remove a vterm from hvc tty operation (modele_exit or hotplug remove) */
49extern int __devexit hvc_remove(struct hvc_struct *hp);
50#endif /* __KERNEL__ */ 40#endif /* __KERNEL__ */
51#endif /* _PPC64_HVCONSOLE_H */ 41#endif /* _PPC64_HVCONSOLE_H */
diff --git a/include/asm-powerpc/irq.h b/include/asm-powerpc/irq.h
index 8eb7e857ec4c..51f87d9993b6 100644
--- a/include/asm-powerpc/irq.h
+++ b/include/asm-powerpc/irq.h
@@ -479,6 +479,10 @@ extern int distribute_irqs;
479struct irqaction; 479struct irqaction;
480struct pt_regs; 480struct pt_regs;
481 481
482#define __ARCH_HAS_DO_SOFTIRQ
483
484extern void __do_softirq(void);
485
482#ifdef CONFIG_IRQSTACKS 486#ifdef CONFIG_IRQSTACKS
483/* 487/*
484 * Per-cpu stacks for handling hard and soft interrupts. 488 * Per-cpu stacks for handling hard and soft interrupts.
@@ -491,8 +495,6 @@ extern void call_do_softirq(struct thread_info *tp);
491extern int call___do_IRQ(int irq, struct pt_regs *regs, 495extern int call___do_IRQ(int irq, struct pt_regs *regs,
492 struct thread_info *tp); 496 struct thread_info *tp);
493 497
494#define __ARCH_HAS_DO_SOFTIRQ
495
496#else 498#else
497#define irq_ctx_init() 499#define irq_ctx_init()
498 500
diff --git a/include/asm-powerpc/iseries/mf.h b/include/asm-powerpc/iseries/mf.h
index 857e5202fc78..eb851a9c9e5c 100644
--- a/include/asm-powerpc/iseries/mf.h
+++ b/include/asm-powerpc/iseries/mf.h
@@ -41,16 +41,11 @@ extern void mf_deallocate_lp_events(HvLpIndex targetLp, HvLpEvent_Type type,
41 unsigned count, MFCompleteHandler hdlr, void *userToken); 41 unsigned count, MFCompleteHandler hdlr, void *userToken);
42 42
43extern void mf_power_off(void); 43extern void mf_power_off(void);
44extern void mf_reboot(void); 44extern void mf_reboot(char *cmd);
45 45
46extern void mf_display_src(u32 word); 46extern void mf_display_src(u32 word);
47extern void mf_display_progress(u16 value); 47extern void mf_display_progress(u16 value);
48extern void mf_clear_src(void);
49 48
50extern void mf_init(void); 49extern void mf_init(void);
51 50
52extern int mf_get_rtc(struct rtc_time *tm);
53extern int mf_get_boot_rtc(struct rtc_time *tm);
54extern int mf_set_rtc(struct rtc_time *tm);
55
56#endif /* _ASM_POWERPC_ISERIES_MF_H */ 51#endif /* _ASM_POWERPC_ISERIES_MF_H */
diff --git a/include/asm-powerpc/kdebug.h b/include/asm-powerpc/kdebug.h
index 7c16265568e0..c01786ab5fa6 100644
--- a/include/asm-powerpc/kdebug.h
+++ b/include/asm-powerpc/kdebug.h
@@ -16,13 +16,9 @@ struct die_args {
16 int signr; 16 int signr;
17}; 17};
18 18
19/* 19extern int register_die_notifier(struct notifier_block *);
20 Note - you should never unregister because that can race with NMIs. 20extern int unregister_die_notifier(struct notifier_block *);
21 If you really want to do it first unregister - then synchronize_sched - 21extern struct atomic_notifier_head powerpc_die_chain;
22 then free.
23 */
24int register_die_notifier(struct notifier_block *nb);
25extern struct notifier_block *powerpc_die_chain;
26 22
27/* Grossly misnamed. */ 23/* Grossly misnamed. */
28enum die_val { 24enum die_val {
@@ -37,7 +33,7 @@ enum die_val {
37static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig) 33static inline int notify_die(enum die_val val,char *str,struct pt_regs *regs,long err,int trap, int sig)
38{ 34{
39 struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig }; 35 struct die_args args = { .regs=regs, .str=str, .err=err, .trapnr=trap,.signr=sig };
40 return notifier_call_chain(&powerpc_die_chain, val, &args); 36 return atomic_notifier_call_chain(&powerpc_die_chain, val, &args);
41} 37}
42 38
43#endif /* __KERNEL__ */ 39#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/lmb.h b/include/asm-powerpc/lmb.h
index d3546c4c9f46..0c5880f70225 100644
--- a/include/asm-powerpc/lmb.h
+++ b/include/asm-powerpc/lmb.h
@@ -19,8 +19,6 @@
19 19
20#define MAX_LMB_REGIONS 128 20#define MAX_LMB_REGIONS 128
21 21
22#define LMB_ALLOC_ANYWHERE 0
23
24struct lmb_property { 22struct lmb_property {
25 unsigned long base; 23 unsigned long base;
26 unsigned long size; 24 unsigned long size;
@@ -43,20 +41,19 @@ extern struct lmb lmb;
43 41
44extern void __init lmb_init(void); 42extern void __init lmb_init(void);
45extern void __init lmb_analyze(void); 43extern void __init lmb_analyze(void);
46extern long __init lmb_add(unsigned long, unsigned long); 44extern long __init lmb_add(unsigned long base, unsigned long size);
47extern long __init lmb_reserve(unsigned long, unsigned long); 45extern long __init lmb_reserve(unsigned long base, unsigned long size);
48extern unsigned long __init lmb_alloc(unsigned long, unsigned long); 46extern unsigned long __init lmb_alloc(unsigned long size, unsigned long align);
49extern unsigned long __init lmb_alloc_base(unsigned long, unsigned long, 47extern unsigned long __init lmb_alloc_base(unsigned long size,
50 unsigned long); 48 unsigned long align, unsigned long max_addr);
49extern unsigned long __init __lmb_alloc_base(unsigned long size,
50 unsigned long align, unsigned long max_addr);
51extern unsigned long __init lmb_phys_mem_size(void); 51extern unsigned long __init lmb_phys_mem_size(void);
52extern unsigned long __init lmb_end_of_DRAM(void); 52extern unsigned long __init lmb_end_of_DRAM(void);
53extern unsigned long __init lmb_abs_to_phys(unsigned long); 53extern void __init lmb_enforce_memory_limit(unsigned long memory_limit);
54extern void __init lmb_enforce_memory_limit(unsigned long);
55 54
56extern void lmb_dump_all(void); 55extern void lmb_dump_all(void);
57 56
58extern unsigned long io_hole_start;
59
60static inline unsigned long 57static inline unsigned long
61lmb_size_bytes(struct lmb_region *type, unsigned long region_nr) 58lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
62{ 59{
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 5348b820788c..5ed847680754 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -47,6 +47,7 @@ struct smp_ops_t {
47#endif 47#endif
48 48
49struct machdep_calls { 49struct machdep_calls {
50 char *name;
50#ifdef CONFIG_PPC64 51#ifdef CONFIG_PPC64
51 void (*hpte_invalidate)(unsigned long slot, 52 void (*hpte_invalidate)(unsigned long slot,
52 unsigned long va, 53 unsigned long va,
@@ -85,9 +86,9 @@ struct machdep_calls {
85 void (*iommu_dev_setup)(struct pci_dev *dev); 86 void (*iommu_dev_setup)(struct pci_dev *dev);
86 void (*iommu_bus_setup)(struct pci_bus *bus); 87 void (*iommu_bus_setup)(struct pci_bus *bus);
87 void (*irq_bus_setup)(struct pci_bus *bus); 88 void (*irq_bus_setup)(struct pci_bus *bus);
88#endif 89#endif /* CONFIG_PPC64 */
89 90
90 int (*probe)(int platform); 91 int (*probe)(void);
91 void (*setup_arch)(void); 92 void (*setup_arch)(void);
92 void (*init_early)(void); 93 void (*init_early)(void);
93 /* Optional, may be NULL. */ 94 /* Optional, may be NULL. */
@@ -158,6 +159,12 @@ struct machdep_calls {
158 /* Idle loop for this platform, leave empty for default idle loop */ 159 /* Idle loop for this platform, leave empty for default idle loop */
159 void (*idle_loop)(void); 160 void (*idle_loop)(void);
160 161
162 /*
163 * Function for waiting for work with reduced power in idle loop;
164 * called with interrupts disabled.
165 */
166 void (*power_save)(void);
167
161 /* Function to enable performance monitor counters for this 168 /* Function to enable performance monitor counters for this
162 platform, called once per cpu. */ 169 platform, called once per cpu. */
163 void (*enable_pmcs)(void); 170 void (*enable_pmcs)(void);
@@ -170,13 +177,6 @@ struct machdep_calls {
170 May be NULL. */ 177 May be NULL. */
171 void (*init)(void); 178 void (*init)(void);
172 179
173 void (*idle)(void);
174 void (*power_save)(void);
175
176 void (*heartbeat)(void);
177 unsigned long heartbeat_reset;
178 unsigned long heartbeat_count;
179
180 void (*setup_io_mappings)(void); 180 void (*setup_io_mappings)(void);
181 181
182 void (*early_serial_map)(void); 182 void (*early_serial_map)(void);
@@ -208,8 +208,6 @@ struct machdep_calls {
208 /* Called at then very end of pcibios_init() */ 208 /* Called at then very end of pcibios_init() */
209 void (*pcibios_after_init)(void); 209 void (*pcibios_after_init)(void);
210 210
211 /* this is for modules, since _machine can be a define -- Cort */
212 int ppc_machine;
213#endif /* CONFIG_PPC32 */ 211#endif /* CONFIG_PPC32 */
214 212
215 /* Called to shutdown machine specific hardware not already controlled 213 /* Called to shutdown machine specific hardware not already controlled
@@ -242,10 +240,29 @@ struct machdep_calls {
242#endif /* CONFIG_KEXEC */ 240#endif /* CONFIG_KEXEC */
243}; 241};
244 242
245extern void default_idle(void); 243extern void power4_idle(void);
246extern void native_idle(void); 244extern void ppc6xx_idle(void);
247 245
246/*
247 * ppc_md contains a copy of the machine description structure for the
248 * current platform. machine_id contains the initial address where the
249 * description was found during boot.
250 */
248extern struct machdep_calls ppc_md; 251extern struct machdep_calls ppc_md;
252extern struct machdep_calls *machine_id;
253
254#define __machine_desc __attribute__ ((__section__ (".machine.desc")))
255
256#define define_machine(name) struct machdep_calls mach_##name __machine_desc =
257#define machine_is(name) \
258 ({ \
259 extern struct machdep_calls mach_##name \
260 __attribute__((weak)); \
261 machine_id == &mach_##name; \
262 })
263
264extern void probe_machine(void);
265
249extern char cmd_line[COMMAND_LINE_SIZE]; 266extern char cmd_line[COMMAND_LINE_SIZE];
250 267
251#ifdef CONFIG_PPC_PMAC 268#ifdef CONFIG_PPC_PMAC
diff --git a/include/asm-powerpc/mmu.h b/include/asm-powerpc/mmu.h
index b0b9a3f8cdc2..31f721994bd8 100644
--- a/include/asm-powerpc/mmu.h
+++ b/include/asm-powerpc/mmu.h
@@ -236,7 +236,6 @@ extern void htab_initialize_secondary(void);
236extern void hpte_init_native(void); 236extern void hpte_init_native(void);
237extern void hpte_init_lpar(void); 237extern void hpte_init_lpar(void);
238extern void hpte_init_iSeries(void); 238extern void hpte_init_iSeries(void);
239extern void mm_init_ppc64(void);
240 239
241extern long pSeries_lpar_hpte_insert(unsigned long hpte_group, 240extern long pSeries_lpar_hpte_insert(unsigned long hpte_group,
242 unsigned long va, unsigned long prpn, 241 unsigned long va, unsigned long prpn,
diff --git a/include/asm-powerpc/oprofile_impl.h b/include/asm-powerpc/oprofile_impl.h
index 338e6a7cff4a..5b33994cd488 100644
--- a/include/asm-powerpc/oprofile_impl.h
+++ b/include/asm-powerpc/oprofile_impl.h
@@ -17,9 +17,6 @@
17 17
18/* Per-counter configuration as set via oprofilefs. */ 18/* Per-counter configuration as set via oprofilefs. */
19struct op_counter_config { 19struct op_counter_config {
20#ifdef __powerpc64__
21 unsigned long valid;
22#endif
23 unsigned long enabled; 20 unsigned long enabled;
24 unsigned long event; 21 unsigned long event;
25 unsigned long count; 22 unsigned long count;
@@ -38,9 +35,6 @@ struct op_system_config {
38#endif 35#endif
39 unsigned long enable_kernel; 36 unsigned long enable_kernel;
40 unsigned long enable_user; 37 unsigned long enable_user;
41#ifdef CONFIG_PPC64
42 unsigned long backtrace_spinlocks;
43#endif
44}; 38};
45 39
46/* Per-arch configuration */ 40/* Per-arch configuration */
@@ -56,17 +50,12 @@ struct op_powerpc_model {
56 int num_counters; 50 int num_counters;
57}; 51};
58 52
59#ifdef CONFIG_FSL_BOOKE
60extern struct op_powerpc_model op_model_fsl_booke; 53extern struct op_powerpc_model op_model_fsl_booke;
61#else /* Otherwise, it's classic */
62
63#ifdef CONFIG_PPC64
64extern struct op_powerpc_model op_model_rs64; 54extern struct op_powerpc_model op_model_rs64;
65extern struct op_powerpc_model op_model_power4; 55extern struct op_powerpc_model op_model_power4;
66
67#else /* Otherwise, CONFIG_PPC32 */
68extern struct op_powerpc_model op_model_7450; 56extern struct op_powerpc_model op_model_7450;
69#endif 57
58#ifndef CONFIG_FSL_BOOKE
70 59
71/* All the classic PPC parts use these */ 60/* All the classic PPC parts use these */
72static inline unsigned int ctr_read(unsigned int i) 61static inline unsigned int ctr_read(unsigned int i)
@@ -134,5 +123,7 @@ static inline void ctr_write(unsigned int i, unsigned int val)
134} 123}
135#endif /* !CONFIG_FSL_BOOKE */ 124#endif /* !CONFIG_FSL_BOOKE */
136 125
126extern void op_powerpc_backtrace(struct pt_regs * const regs, unsigned int depth);
127
137#endif /* __KERNEL__ */ 128#endif /* __KERNEL__ */
138#endif /* _ASM_POWERPC_OPROFILE_IMPL_H */ 129#endif /* _ASM_POWERPC_OPROFILE_IMPL_H */
diff --git a/include/asm-powerpc/paca.h b/include/asm-powerpc/paca.h
index c9add8f1ad94..706325f99a84 100644
--- a/include/asm-powerpc/paca.h
+++ b/include/asm-powerpc/paca.h
@@ -54,7 +54,7 @@ struct paca_struct {
54#endif /* CONFIG_PPC_ISERIES */ 54#endif /* CONFIG_PPC_ISERIES */
55 55
56 /* 56 /*
57 * MAGIC: the spinlock functions in arch/ppc64/lib/locks.c 57 * MAGIC: the spinlock functions in arch/powerpc/lib/locks.c
58 * load lock_token and paca_index with a single lwz 58 * load lock_token and paca_index with a single lwz
59 * instruction. They must travel together and be properly 59 * instruction. They must travel together and be properly
60 * aligned. 60 * aligned.
@@ -96,9 +96,16 @@ struct paca_struct {
96 u64 saved_r1; /* r1 save for RTAS calls */ 96 u64 saved_r1; /* r1 save for RTAS calls */
97 u64 saved_msr; /* MSR saved here by enter_rtas */ 97 u64 saved_msr; /* MSR saved here by enter_rtas */
98 u8 proc_enabled; /* irq soft-enable flag */ 98 u8 proc_enabled; /* irq soft-enable flag */
99
100 /* Stuff for accurate time accounting */
101 u64 user_time; /* accumulated usermode TB ticks */
102 u64 system_time; /* accumulated system TB ticks */
103 u64 startpurr; /* PURR/TB value snapshot */
99}; 104};
100 105
101extern struct paca_struct paca[]; 106extern struct paca_struct paca[];
102 107
108void setup_boot_paca(void);
109
103#endif /* __KERNEL__ */ 110#endif /* __KERNEL__ */
104#endif /* _ASM_POWERPC_PACA_H */ 111#endif /* _ASM_POWERPC_PACA_H */
diff --git a/include/asm-powerpc/page.h b/include/asm-powerpc/page.h
index 0b82df483f7f..2fbecebe1c92 100644
--- a/include/asm-powerpc/page.h
+++ b/include/asm-powerpc/page.h
@@ -69,8 +69,6 @@
69#endif 69#endif
70 70
71#ifdef CONFIG_FLATMEM 71#ifdef CONFIG_FLATMEM
72#define pfn_to_page(pfn) (mem_map + (pfn))
73#define page_to_pfn(page) ((unsigned long)((page) - mem_map))
74#define pfn_valid(pfn) ((pfn) < max_mapnr) 72#define pfn_valid(pfn) ((pfn) < max_mapnr)
75#endif 73#endif
76 74
@@ -200,6 +198,7 @@ extern void copy_user_page(void *to, void *from, unsigned long vaddr,
200 struct page *p); 198 struct page *p);
201extern int page_is_ram(unsigned long pfn); 199extern int page_is_ram(unsigned long pfn);
202 200
201#include <asm-generic/memory_model.h>
203#endif /* __ASSEMBLY__ */ 202#endif /* __ASSEMBLY__ */
204 203
205#endif /* __KERNEL__ */ 204#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/percpu.h b/include/asm-powerpc/percpu.h
index e31922c50e53..184a7a4d2fdf 100644
--- a/include/asm-powerpc/percpu.h
+++ b/include/asm-powerpc/percpu.h
@@ -27,10 +27,9 @@
27#define percpu_modcopy(pcpudst, src, size) \ 27#define percpu_modcopy(pcpudst, src, size) \
28do { \ 28do { \
29 unsigned int __i; \ 29 unsigned int __i; \
30 for (__i = 0; __i < NR_CPUS; __i++) \ 30 for_each_possible_cpu(__i) \
31 if (cpu_possible(__i)) \ 31 memcpy((pcpudst)+__per_cpu_offset(__i), \
32 memcpy((pcpudst)+__per_cpu_offset(__i), \ 32 (src), (size)); \
33 (src), (size)); \
34} while (0) 33} while (0)
35 34
36extern void setup_per_cpu_areas(void); 35extern void setup_per_cpu_areas(void);
diff --git a/include/asm-powerpc/pgtable-4k.h b/include/asm-powerpc/pgtable-4k.h
index 80a7832d2721..b2e18629932a 100644
--- a/include/asm-powerpc/pgtable-4k.h
+++ b/include/asm-powerpc/pgtable-4k.h
@@ -62,9 +62,14 @@
62/* shift to put page number into pte */ 62/* shift to put page number into pte */
63#define PTE_RPN_SHIFT (17) 63#define PTE_RPN_SHIFT (17)
64 64
65#define __real_pte(e,p) ((real_pte_t)(e)) 65#ifdef STRICT_MM_TYPECHECKS
66#define __rpte_to_pte(r) (r) 66#define __real_pte(e,p) ((real_pte_t){(e)})
67#define __rpte_to_hidx(r,index) (pte_val((r)) >> 12) 67#define __rpte_to_pte(r) ((r).pte)
68#else
69#define __real_pte(e,p) (e)
70#define __rpte_to_pte(r) (__pte(r))
71#endif
72#define __rpte_to_hidx(r,index) (pte_val(__rpte_to_pte(r)) >> 12)
68 73
69#define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \ 74#define pte_iterate_hashed_subpages(rpte, psize, va, index, shift) \
70 do { \ 75 do { \
diff --git a/include/asm-powerpc/pgtable.h b/include/asm-powerpc/pgtable.h
index e38931379a72..e9f1f4627e6b 100644
--- a/include/asm-powerpc/pgtable.h
+++ b/include/asm-powerpc/pgtable.h
@@ -188,9 +188,13 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
188#define pte_pfn(x) ((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT))) 188#define pte_pfn(x) ((unsigned long)((pte_val(x)>>PTE_RPN_SHIFT)))
189#define pte_page(x) pfn_to_page(pte_pfn(x)) 189#define pte_page(x) pfn_to_page(pte_pfn(x))
190 190
191#define PMD_BAD_BITS (PTE_TABLE_SIZE-1)
192#define PUD_BAD_BITS (PMD_TABLE_SIZE-1)
193
191#define pmd_set(pmdp, pmdval) (pmd_val(*(pmdp)) = (pmdval)) 194#define pmd_set(pmdp, pmdval) (pmd_val(*(pmdp)) = (pmdval))
192#define pmd_none(pmd) (!pmd_val(pmd)) 195#define pmd_none(pmd) (!pmd_val(pmd))
193#define pmd_bad(pmd) (pmd_val(pmd) == 0) 196#define pmd_bad(pmd) (!is_kernel_addr(pmd_val(pmd)) \
197 || (pmd_val(pmd) & PMD_BAD_BITS))
194#define pmd_present(pmd) (pmd_val(pmd) != 0) 198#define pmd_present(pmd) (pmd_val(pmd) != 0)
195#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0) 199#define pmd_clear(pmdp) (pmd_val(*(pmdp)) = 0)
196#define pmd_page_kernel(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS) 200#define pmd_page_kernel(pmd) (pmd_val(pmd) & ~PMD_MASKED_BITS)
@@ -198,7 +202,8 @@ static inline pte_t pfn_pte(unsigned long pfn, pgprot_t pgprot)
198 202
199#define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval)) 203#define pud_set(pudp, pudval) (pud_val(*(pudp)) = (pudval))
200#define pud_none(pud) (!pud_val(pud)) 204#define pud_none(pud) (!pud_val(pud))
201#define pud_bad(pud) ((pud_val(pud)) == 0) 205#define pud_bad(pud) (!is_kernel_addr(pud_val(pud)) \
206 || (pud_val(pud) & PUD_BAD_BITS))
202#define pud_present(pud) (pud_val(pud) != 0) 207#define pud_present(pud) (pud_val(pud) != 0)
203#define pud_clear(pudp) (pud_val(*(pudp)) = 0) 208#define pud_clear(pudp) (pud_val(*(pudp)) = 0)
204#define pud_page(pud) (pud_val(pud) & ~PUD_MASKED_BITS) 209#define pud_page(pud) (pud_val(pud) & ~PUD_MASKED_BITS)
@@ -468,11 +473,6 @@ extern pgd_t swapper_pg_dir[];
468 473
469extern void paging_init(void); 474extern void paging_init(void);
470 475
471#ifdef CONFIG_HUGETLB_PAGE
472#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \
473 free_pgd_range(tlb, addr, end, floor, ceiling)
474#endif
475
476/* 476/*
477 * This gets called at the end of handling a page fault, when 477 * This gets called at the end of handling a page fault, when
478 * the kernel has put a new PTE into the page table for the process. 478 * the kernel has put a new PTE into the page table for the process.
diff --git a/include/asm-powerpc/pmac_feature.h b/include/asm-powerpc/pmac_feature.h
index 3221628130c4..d3599cc9aa74 100644
--- a/include/asm-powerpc/pmac_feature.h
+++ b/include/asm-powerpc/pmac_feature.h
@@ -305,7 +305,7 @@ extern void pmac_feature_init(void);
305extern void pmac_set_early_video_resume(void (*proc)(void *data), void *data); 305extern void pmac_set_early_video_resume(void (*proc)(void *data), void *data);
306extern void pmac_call_early_video_resume(void); 306extern void pmac_call_early_video_resume(void);
307 307
308#define PMAC_FTR_DEF(x) ((_MACH_Pmac << 16) | (x)) 308#define PMAC_FTR_DEF(x) ((0x6660000) | (x))
309 309
310/* The AGP driver registers itself here */ 310/* The AGP driver registers itself here */
311extern void pmac_register_agp_pm(struct pci_dev *bridge, 311extern void pmac_register_agp_pm(struct pci_dev *bridge,
diff --git a/include/asm-powerpc/poll.h b/include/asm-powerpc/poll.h
index edd2054da86b..9c7d12631033 100644
--- a/include/asm-powerpc/poll.h
+++ b/include/asm-powerpc/poll.h
@@ -13,6 +13,7 @@
13#define POLLWRBAND 0x0200 13#define POLLWRBAND 0x0200
14#define POLLMSG 0x0400 14#define POLLMSG 0x0400
15#define POLLREMOVE 0x1000 15#define POLLREMOVE 0x1000
16#define POLLRDHUP 0x2000
16 17
17struct pollfd { 18struct pollfd {
18 int fd; 19 int fd;
diff --git a/include/asm-powerpc/ppc-pci.h b/include/asm-powerpc/ppc-pci.h
index f80482c7231f..cf79bc7ebb55 100644
--- a/include/asm-powerpc/ppc-pci.h
+++ b/include/asm-powerpc/ppc-pci.h
@@ -38,6 +38,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
38 38
39void pci_devs_phb_init(void); 39void pci_devs_phb_init(void);
40void pci_devs_phb_init_dynamic(struct pci_controller *phb); 40void pci_devs_phb_init_dynamic(struct pci_controller *phb);
41int setup_phb(struct device_node *dev, struct pci_controller *phb);
41void __devinit scan_phb(struct pci_controller *hose); 42void __devinit scan_phb(struct pci_controller *hose);
42 43
43/* From rtas_pci.h */ 44/* From rtas_pci.h */
diff --git a/include/asm-powerpc/ppc_asm.h b/include/asm-powerpc/ppc_asm.h
index ab8688d39024..dd1c0a913d5f 100644
--- a/include/asm-powerpc/ppc_asm.h
+++ b/include/asm-powerpc/ppc_asm.h
@@ -15,6 +15,48 @@
15#define SZL (BITS_PER_LONG/8) 15#define SZL (BITS_PER_LONG/8)
16 16
17/* 17/*
18 * Stuff for accurate CPU time accounting.
19 * These macros handle transitions between user and system state
20 * in exception entry and exit and accumulate time to the
21 * user_time and system_time fields in the paca.
22 */
23
24#ifndef CONFIG_VIRT_CPU_ACCOUNTING
25#define ACCOUNT_CPU_USER_ENTRY(ra, rb)
26#define ACCOUNT_CPU_USER_EXIT(ra, rb)
27#else
28#define ACCOUNT_CPU_USER_ENTRY(ra, rb) \
29 beq 2f; /* if from kernel mode */ \
30BEGIN_FTR_SECTION; \
31 mfspr ra,SPRN_PURR; /* get processor util. reg */ \
32END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
33BEGIN_FTR_SECTION; \
34 mftb ra; /* or get TB if no PURR */ \
35END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
36 ld rb,PACA_STARTPURR(r13); \
37 std ra,PACA_STARTPURR(r13); \
38 subf rb,rb,ra; /* subtract start value */ \
39 ld ra,PACA_USER_TIME(r13); \
40 add ra,ra,rb; /* add on to user time */ \
41 std ra,PACA_USER_TIME(r13); \
422:
43
44#define ACCOUNT_CPU_USER_EXIT(ra, rb) \
45BEGIN_FTR_SECTION; \
46 mfspr ra,SPRN_PURR; /* get processor util. reg */ \
47END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
48BEGIN_FTR_SECTION; \
49 mftb ra; /* or get TB if no PURR */ \
50END_FTR_SECTION_IFCLR(CPU_FTR_PURR); \
51 ld rb,PACA_STARTPURR(r13); \
52 std ra,PACA_STARTPURR(r13); \
53 subf rb,rb,ra; /* subtract start value */ \
54 ld ra,PACA_SYSTEM_TIME(r13); \
55 add ra,ra,rb; /* add on to user time */ \
56 std ra,PACA_SYSTEM_TIME(r13);
57#endif
58
59/*
18 * Macros for storing registers into and loading registers from 60 * Macros for storing registers into and loading registers from
19 * exception frames. 61 * exception frames.
20 */ 62 */
diff --git a/include/asm-powerpc/processor.h b/include/asm-powerpc/processor.h
index 415fa393b00c..93f83efeb310 100644
--- a/include/asm-powerpc/processor.h
+++ b/include/asm-powerpc/processor.h
@@ -22,22 +22,6 @@
22 * -- BenH. 22 * -- BenH.
23 */ 23 */
24 24
25/* Platforms codes (to be obsoleted) */
26#define PLATFORM_PSERIES 0x0100
27#define PLATFORM_PSERIES_LPAR 0x0101
28#define PLATFORM_ISERIES_LPAR 0x0201
29#define PLATFORM_LPAR 0x0001
30#define PLATFORM_POWERMAC 0x0400
31#define PLATFORM_MAPLE 0x0500
32#define PLATFORM_PREP 0x0600
33#define PLATFORM_CHRP 0x0700
34#define PLATFORM_CELL 0x1000
35
36/* Compat platform codes for 32 bits */
37#define _MACH_prep PLATFORM_PREP
38#define _MACH_Pmac PLATFORM_POWERMAC
39#define _MACH_chrp PLATFORM_CHRP
40
41/* PREP sub-platform types see residual.h for these */ 25/* PREP sub-platform types see residual.h for these */
42#define _PREP_Motorola 0x01 /* motorola prep */ 26#define _PREP_Motorola 0x01 /* motorola prep */
43#define _PREP_Firm 0x02 /* firmworks prep */ 27#define _PREP_Firm 0x02 /* firmworks prep */
@@ -49,19 +33,14 @@
49#define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */ 33#define _CHRP_IBM 0x05 /* IBM chrp, the longtrail and longtrail 2 */
50#define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */ 34#define _CHRP_Pegasos 0x06 /* Genesi/bplan's Pegasos and Pegasos2 */
51 35
52#ifdef __KERNEL__ 36#if defined(__KERNEL__) && defined(CONFIG_PPC32)
53#define platform_is_pseries() (_machine == PLATFORM_PSERIES || \
54 _machine == PLATFORM_PSERIES_LPAR)
55#define platform_is_lpar() (!!(_machine & PLATFORM_LPAR))
56 37
57#if defined(CONFIG_PPC_MULTIPLATFORM) 38extern int _chrp_type;
58extern int _machine;
59 39
60#ifdef CONFIG_PPC32 40#ifdef CONFIG_PPC_PREP
61 41
62/* what kind of prep workstation we are */ 42/* what kind of prep workstation we are */
63extern int _prep_type; 43extern int _prep_type;
64extern int _chrp_type;
65 44
66/* 45/*
67 * This is used to identify the board type from a given PReP board 46 * This is used to identify the board type from a given PReP board
@@ -71,17 +50,14 @@ extern int _chrp_type;
71extern unsigned char ucBoardRev; 50extern unsigned char ucBoardRev;
72extern unsigned char ucBoardRevMaj, ucBoardRevMin; 51extern unsigned char ucBoardRevMaj, ucBoardRevMin;
73 52
74#endif /* CONFIG_PPC32 */ 53#endif /* CONFIG_PPC_PREP */
75 54
76#elif defined(CONFIG_PPC_ISERIES) 55#ifndef CONFIG_PPC_MULTIPLATFORM
77/*
78 * iSeries is soon to become MULTIPLATFORM hopefully ...
79 */
80#define _machine PLATFORM_ISERIES_LPAR
81#else
82#define _machine 0 56#define _machine 0
83#endif /* CONFIG_PPC_MULTIPLATFORM */ 57#endif /* CONFIG_PPC_MULTIPLATFORM */
84#endif /* __KERNEL__ */ 58
59#endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */
60
85/* 61/*
86 * Default implementation of macro that returns current 62 * Default implementation of macro that returns current
87 * instruction pointer ("program counter"). 63 * instruction pointer ("program counter").
@@ -252,6 +228,10 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
252#define cpu_relax() barrier() 228#define cpu_relax() barrier()
253#endif 229#endif
254 230
231/* Check that a certain kernel stack pointer is valid in task_struct p */
232int validate_sp(unsigned long sp, struct task_struct *p,
233 unsigned long nbytes);
234
255/* 235/*
256 * Prefetch macros. 236 * Prefetch macros.
257 */ 237 */
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index cbd297f44cce..97ef1cd71a4d 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -126,8 +126,14 @@ extern struct device_node *find_all_nodes(void);
126/* New style node lookup */ 126/* New style node lookup */
127extern struct device_node *of_find_node_by_name(struct device_node *from, 127extern struct device_node *of_find_node_by_name(struct device_node *from,
128 const char *name); 128 const char *name);
129#define for_each_node_by_name(dn, name) \
130 for (dn = of_find_node_by_name(NULL, name); dn; \
131 dn = of_find_node_by_name(dn, name))
129extern struct device_node *of_find_node_by_type(struct device_node *from, 132extern struct device_node *of_find_node_by_type(struct device_node *from,
130 const char *type); 133 const char *type);
134#define for_each_node_by_type(dn, type) \
135 for (dn = of_find_node_by_type(NULL, type); dn; \
136 dn = of_find_node_by_type(dn, type))
131extern struct device_node *of_find_compatible_node(struct device_node *from, 137extern struct device_node *of_find_compatible_node(struct device_node *from,
132 const char *type, const char *compat); 138 const char *type, const char *compat);
133extern struct device_node *of_find_node_by_path(const char *path); 139extern struct device_node *of_find_node_by_path(const char *path);
@@ -143,12 +149,14 @@ extern struct device_node *of_node_get(struct device_node *node);
143extern void of_node_put(struct device_node *node); 149extern void of_node_put(struct device_node *node);
144 150
145/* For scanning the flat device-tree at boot time */ 151/* For scanning the flat device-tree at boot time */
146int __init of_scan_flat_dt(int (*it)(unsigned long node, 152extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
147 const char *uname, int depth, 153 const char *uname, int depth,
148 void *data), 154 void *data),
149 void *data); 155 void *data);
150void* __init of_get_flat_dt_prop(unsigned long node, const char *name, 156extern void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
151 unsigned long *size); 157 unsigned long *size);
158extern int __init of_flat_dt_is_compatible(unsigned long node, const char *name);
159extern unsigned long __init of_get_flat_dt_root(void);
152 160
153/* For updating the device tree at runtime */ 161/* For updating the device tree at runtime */
154extern void of_attach_node(struct device_node *); 162extern void of_attach_node(struct device_node *);
diff --git a/include/asm-powerpc/reg.h b/include/asm-powerpc/reg.h
index 72bfe3af0460..bd467bf5cf5a 100644
--- a/include/asm-powerpc/reg.h
+++ b/include/asm-powerpc/reg.h
@@ -622,6 +622,10 @@ extern void ppc64_runlatch_off(void);
622extern unsigned long scom970_read(unsigned int address); 622extern unsigned long scom970_read(unsigned int address);
623extern void scom970_write(unsigned int address, unsigned long value); 623extern void scom970_write(unsigned int address, unsigned long value);
624 624
625#else
626#define ppc64_runlatch_on()
627#define ppc64_runlatch_off()
628
625#endif /* CONFIG_PPC64 */ 629#endif /* CONFIG_PPC64 */
626 630
627#define __get_SP() ({unsigned long sp; \ 631#define __get_SP() ({unsigned long sp; \
diff --git a/include/asm-powerpc/rwsem.h b/include/asm-powerpc/rwsem.h
index 79bae4933b73..2c2fe9647595 100644
--- a/include/asm-powerpc/rwsem.h
+++ b/include/asm-powerpc/rwsem.h
@@ -4,7 +4,7 @@
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6/* 6/*
7 * include/asm-ppc64/rwsem.h: R/W semaphores for PPC using the stuff 7 * include/asm-powerpc/rwsem.h: R/W semaphores for PPC using the stuff
8 * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h 8 * in lib/rwsem.c. Adapted largely from include/asm-i386/rwsem.h
9 * by Paul Mackerras <paulus@samba.org>. 9 * by Paul Mackerras <paulus@samba.org>.
10 */ 10 */
diff --git a/include/asm-powerpc/smp.h b/include/asm-powerpc/smp.h
index 98581e5a8279..4a716f707cf6 100644
--- a/include/asm-powerpc/smp.h
+++ b/include/asm-powerpc/smp.h
@@ -29,7 +29,6 @@
29#endif 29#endif
30 30
31extern int boot_cpuid; 31extern int boot_cpuid;
32extern int boot_cpuid_phys;
33 32
34extern void cpu_die(void); 33extern void cpu_die(void);
35 34
@@ -99,6 +98,7 @@ extern void smp_release_cpus(void);
99#else 98#else
100/* 32-bit */ 99/* 32-bit */
101#ifndef CONFIG_SMP 100#ifndef CONFIG_SMP
101extern int boot_cpuid_phys;
102#define get_hard_smp_processor_id(cpu) boot_cpuid_phys 102#define get_hard_smp_processor_id(cpu) boot_cpuid_phys
103#define set_hard_smp_processor_id(cpu, phys) 103#define set_hard_smp_processor_id(cpu, phys)
104#endif 104#endif
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h
index 38bacf2f6e0c..f431d8b0b651 100644
--- a/include/asm-powerpc/spu.h
+++ b/include/asm-powerpc/spu.h
@@ -110,6 +110,7 @@ struct spu {
110 char *name; 110 char *name;
111 unsigned long local_store_phys; 111 unsigned long local_store_phys;
112 u8 *local_store; 112 u8 *local_store;
113 unsigned long problem_phys;
113 struct spu_problem __iomem *problem; 114 struct spu_problem __iomem *problem;
114 struct spu_priv1 __iomem *priv1; 115 struct spu_priv1 __iomem *priv1;
115 struct spu_priv2 __iomem *priv2; 116 struct spu_priv2 __iomem *priv2;
@@ -137,6 +138,7 @@ struct spu {
137 void (* wbox_callback)(struct spu *spu); 138 void (* wbox_callback)(struct spu *spu);
138 void (* ibox_callback)(struct spu *spu); 139 void (* ibox_callback)(struct spu *spu);
139 void (* stop_callback)(struct spu *spu); 140 void (* stop_callback)(struct spu *spu);
141 void (* mfc_callback)(struct spu *spu);
140 142
141 char irq_c0[8]; 143 char irq_c0[8];
142 char irq_c1[8]; 144 char irq_c1[8];
@@ -149,6 +151,14 @@ int spu_irq_class_0_bottom(struct spu *spu);
149int spu_irq_class_1_bottom(struct spu *spu); 151int spu_irq_class_1_bottom(struct spu *spu);
150void spu_irq_setaffinity(struct spu *spu, int cpu); 152void spu_irq_setaffinity(struct spu *spu, int cpu);
151 153
154/* system callbacks from the SPU */
155struct spu_syscall_block {
156 u64 nr_ret;
157 u64 parm[6];
158};
159extern long spu_sys_callback(struct spu_syscall_block *s);
160
161/* syscalls implemented in spufs */
152extern struct spufs_calls { 162extern struct spufs_calls {
153 asmlinkage long (*create_thread)(const char __user *name, 163 asmlinkage long (*create_thread)(const char __user *name,
154 unsigned int flags, mode_t mode); 164 unsigned int flags, mode_t mode);
@@ -399,7 +409,6 @@ struct spu_priv1 {
399#define SPU_GET_REVISION_BITS(vr) (vr & SPU_REVISION_BITS) 409#define SPU_GET_REVISION_BITS(vr) (vr & SPU_REVISION_BITS)
400 u8 pad_0x28_0x100[0x100 - 0x28]; /* 0x28 */ 410 u8 pad_0x28_0x100[0x100 - 0x28]; /* 0x28 */
401 411
402
403 /* Interrupt Area */ 412 /* Interrupt Area */
404 u64 int_mask_RW[3]; /* 0x100 */ 413 u64 int_mask_RW[3]; /* 0x100 */
405#define CLASS0_ENABLE_DMA_ALIGNMENT_INTR 0x1L 414#define CLASS0_ENABLE_DMA_ALIGNMENT_INTR 0x1L
diff --git a/include/asm-powerpc/string.h b/include/asm-powerpc/string.h
index 8606a696c088..faa407f33c6b 100644
--- a/include/asm-powerpc/string.h
+++ b/include/asm-powerpc/string.h
@@ -15,7 +15,7 @@
15#define __HAVE_ARCH_MEMCHR 15#define __HAVE_ARCH_MEMCHR
16 16
17extern int strcasecmp(const char *, const char *); 17extern int strcasecmp(const char *, const char *);
18extern int strncasecmp(const char *, const char *, int); 18extern int strncasecmp(const char *, const char *, __kernel_size_t);
19extern char * strcpy(char *,const char *); 19extern char * strcpy(char *,const char *);
20extern char * strncpy(char *,const char *, __kernel_size_t); 20extern char * strncpy(char *,const char *, __kernel_size_t);
21extern __kernel_size_t strlen(const char *); 21extern __kernel_size_t strlen(const char *);
diff --git a/include/asm-powerpc/synch.h b/include/asm-powerpc/synch.h
index c90d9d9aae72..2cda3c38a9fa 100644
--- a/include/asm-powerpc/synch.h
+++ b/include/asm-powerpc/synch.h
@@ -15,7 +15,7 @@
15#endif 15#endif
16 16
17#ifdef CONFIG_SMP 17#ifdef CONFIG_SMP
18#define ISYNC_ON_SMP "\n\tisync" 18#define ISYNC_ON_SMP "\n\tisync\n"
19#define LWSYNC_ON_SMP __stringify(LWSYNC) "\n" 19#define LWSYNC_ON_SMP __stringify(LWSYNC) "\n"
20#else 20#else
21#define ISYNC_ON_SMP 21#define ISYNC_ON_SMP
diff --git a/include/asm-powerpc/syscalls.h b/include/asm-powerpc/syscalls.h
new file mode 100644
index 000000000000..c2fe79d4f90f
--- /dev/null
+++ b/include/asm-powerpc/syscalls.h
@@ -0,0 +1,58 @@
1#ifndef __ASM_POWERPC_SYSCALLS_H
2#define __ASM_POWERPC_SYSCALLS_H
3#ifdef __KERNEL__
4
5#include <linux/compiler.h>
6#include <linux/linkage.h>
7#include <linux/types.h>
8#include <asm/signal.h>
9
10struct new_utsname;
11struct pt_regs;
12struct rtas_args;
13struct sigaction;
14
15asmlinkage unsigned long sys_mmap(unsigned long addr, size_t len,
16 unsigned long prot, unsigned long flags,
17 unsigned long fd, off_t offset);
18asmlinkage unsigned long sys_mmap2(unsigned long addr, size_t len,
19 unsigned long prot, unsigned long flags,
20 unsigned long fd, unsigned long pgoff);
21asmlinkage int sys_execve(unsigned long a0, unsigned long a1,
22 unsigned long a2, unsigned long a3, unsigned long a4,
23 unsigned long a5, struct pt_regs *regs);
24asmlinkage int sys_clone(unsigned long clone_flags, unsigned long usp,
25 int __user *parent_tidp, void __user *child_threadptr,
26 int __user *child_tidp, int p6, struct pt_regs *regs);
27asmlinkage int sys_fork(unsigned long p1, unsigned long p2,
28 unsigned long p3, unsigned long p4, unsigned long p5,
29 unsigned long p6, struct pt_regs *regs);
30asmlinkage int sys_vfork(unsigned long p1, unsigned long p2,
31 unsigned long p3, unsigned long p4, unsigned long p5,
32 unsigned long p6, struct pt_regs *regs);
33asmlinkage int sys_pipe(int __user *fildes);
34asmlinkage long sys_rt_sigaction(int sig,
35 const struct sigaction __user *act,
36 struct sigaction __user *oact, size_t sigsetsize);
37asmlinkage int sys_ipc(uint call, int first, unsigned long second,
38 long third, void __user *ptr, long fifth);
39asmlinkage long ppc64_personality(unsigned long personality);
40asmlinkage int ppc_rtas(struct rtas_args __user *uargs);
41asmlinkage time_t sys64_time(time_t __user * tloc);
42asmlinkage long ppc_newuname(struct new_utsname __user * name);
43
44asmlinkage long sys_rt_sigsuspend(sigset_t __user *unewset,
45 size_t sigsetsize);
46
47#ifndef __powerpc64__
48asmlinkage long sys_sigaltstack(const stack_t __user *uss,
49 stack_t __user *uoss, int r5, int r6, int r7, int r8,
50 struct pt_regs *regs);
51#else /* __powerpc64__ */
52asmlinkage long sys_sigaltstack(const stack_t __user *uss,
53 stack_t __user *uoss, unsigned long r5, unsigned long r6,
54 unsigned long r7, unsigned long r8, struct pt_regs *regs);
55#endif /* __powerpc64__ */
56
57#endif /* __KERNEL__ */
58#endif /* __ASM_POWERPC_SYSCALLS_H */
diff --git a/include/asm-powerpc/system.h b/include/asm-powerpc/system.h
index d9bf53653b10..d075725bf444 100644
--- a/include/asm-powerpc/system.h
+++ b/include/asm-powerpc/system.h
@@ -171,6 +171,8 @@ extern u32 booke_wdt_period;
171 171
172/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */ 172/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */
173extern unsigned char e2a(unsigned char); 173extern unsigned char e2a(unsigned char);
174extern unsigned char* strne2a(unsigned char *dest,
175 const unsigned char *src, size_t n);
174 176
175struct device_node; 177struct device_node;
176extern void note_scsi_host(struct device_node *, void *); 178extern void note_scsi_host(struct device_node *, void *);
@@ -363,8 +365,11 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new,
363 * powers of 2 writes until it reaches sufficient alignment). 365 * powers of 2 writes until it reaches sufficient alignment).
364 * 366 *
365 * Based on this we disable the IP header alignment in network drivers. 367 * Based on this we disable the IP header alignment in network drivers.
368 * We also modify NET_SKB_PAD to be a cacheline in size, thus maintaining
369 * cacheline alignment of buffers.
366 */ 370 */
367#define NET_IP_ALIGN 0 371#define NET_IP_ALIGN 0
372#define NET_SKB_PAD L1_CACHE_BYTES
368#endif 373#endif
369 374
370#define arch_align_stack(x) (x) 375#define arch_align_stack(x) (x)
@@ -424,5 +429,9 @@ static inline void create_function_call(unsigned long addr, void * func)
424 create_branch(addr, func_addr, BRANCH_SET_LINK); 429 create_branch(addr, func_addr, BRANCH_SET_LINK);
425} 430}
426 431
432#ifdef CONFIG_VIRT_CPU_ACCOUNTING
433extern void account_system_vtime(struct task_struct *);
434#endif
435
427#endif /* __KERNEL__ */ 436#endif /* __KERNEL__ */
428#endif /* _ASM_POWERPC_SYSTEM_H */ 437#endif /* _ASM_POWERPC_SYSTEM_H */
diff --git a/include/asm-powerpc/time.h b/include/asm-powerpc/time.h
index baddc9ab57ad..912118db13ae 100644
--- a/include/asm-powerpc/time.h
+++ b/include/asm-powerpc/time.h
@@ -41,6 +41,7 @@ extern time_t last_rtc_update;
41 41
42extern void generic_calibrate_decr(void); 42extern void generic_calibrate_decr(void);
43extern void wakeup_decrementer(void); 43extern void wakeup_decrementer(void);
44extern void snapshot_timebase(void);
44 45
45/* Some sane defaults: 125 MHz timebase, 1GHz processor */ 46/* Some sane defaults: 125 MHz timebase, 1GHz processor */
46extern unsigned long ppc_proc_freq; 47extern unsigned long ppc_proc_freq;
@@ -221,5 +222,19 @@ struct cpu_usage {
221 222
222DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array); 223DECLARE_PER_CPU(struct cpu_usage, cpu_usage_array);
223 224
225#ifdef CONFIG_VIRT_CPU_ACCOUNTING
226extern void account_process_vtime(struct task_struct *tsk);
227#else
228#define account_process_vtime(tsk) do { } while (0)
229#endif
230
231#if defined(CONFIG_VIRT_CPU_ACCOUNTING) && defined(CONFIG_PPC_SPLPAR)
232extern void calculate_steal_time(void);
233extern void snapshot_timebases(void);
234#else
235#define calculate_steal_time() do { } while (0)
236#define snapshot_timebases() do { } while (0)
237#endif
238
224#endif /* __KERNEL__ */ 239#endif /* __KERNEL__ */
225#endif /* __PPC64_TIME_H */ 240#endif /* __PPC64_TIME_H */
diff --git a/include/asm-powerpc/types.h b/include/asm-powerpc/types.h
index ec3c2ee8bf86..baabba96e313 100644
--- a/include/asm-powerpc/types.h
+++ b/include/asm-powerpc/types.h
@@ -103,6 +103,11 @@ typedef u64 sector_t;
103#define HAVE_SECTOR_T 103#define HAVE_SECTOR_T
104#endif 104#endif
105 105
106#ifdef CONFIG_LSF
107typedef u64 blkcnt_t;
108#define HAVE_BLKCNT_T
109#endif
110
106#endif /* __ASSEMBLY__ */ 111#endif /* __ASSEMBLY__ */
107 112
108#endif /* __KERNEL__ */ 113#endif /* __KERNEL__ */
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h
index 35556993f066..536ba0873052 100644
--- a/include/asm-powerpc/unistd.h
+++ b/include/asm-powerpc/unistd.h
@@ -301,8 +301,9 @@
301#define __NR_pselect6 280 301#define __NR_pselect6 280
302#define __NR_ppoll 281 302#define __NR_ppoll 281
303#define __NR_unshare 282 303#define __NR_unshare 282
304#define __NR_splice 283
304 305
305#define __NR_syscalls 283 306#define __NR_syscalls 284
306 307
307#ifdef __KERNEL__ 308#ifdef __KERNEL__
308#define __NR__exit __NR_exit 309#define __NR__exit __NR_exit
@@ -425,6 +426,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
425#include <linux/types.h> 426#include <linux/types.h>
426#include <linux/compiler.h> 427#include <linux/compiler.h>
427#include <linux/linkage.h> 428#include <linux/linkage.h>
429#include <asm/syscalls.h>
428 430
429#define __ARCH_WANT_IPC_PARSE_VERSION 431#define __ARCH_WANT_IPC_PARSE_VERSION
430#define __ARCH_WANT_OLD_READDIR 432#define __ARCH_WANT_OLD_READDIR
@@ -460,44 +462,10 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6
460 * System call prototypes. 462 * System call prototypes.
461 */ 463 */
462#ifdef __KERNEL_SYSCALLS__ 464#ifdef __KERNEL_SYSCALLS__
463extern pid_t setsid(void);
464extern int write(int fd, const char *buf, off_t count);
465extern int read(int fd, char *buf, off_t count);
466extern off_t lseek(int fd, off_t offset, int count);
467extern int dup(int fd);
468extern int execve(const char *file, char **argv, char **envp); 465extern int execve(const char *file, char **argv, char **envp);
469extern int open(const char *file, int flag, int mode);
470extern int close(int fd);
471extern pid_t waitpid(pid_t pid, int *wait_stat, int options);
472#endif /* __KERNEL_SYSCALLS__ */ 466#endif /* __KERNEL_SYSCALLS__ */
473 467
474/* 468/*
475 * Functions that implement syscalls.
476 */
477unsigned long sys_mmap(unsigned long addr, size_t len, unsigned long prot,
478 unsigned long flags, unsigned long fd, off_t offset);
479unsigned long sys_mmap2(unsigned long addr, size_t len,
480 unsigned long prot, unsigned long flags,
481 unsigned long fd, unsigned long pgoff);
482struct pt_regs;
483int sys_execve(unsigned long a0, unsigned long a1, unsigned long a2,
484 unsigned long a3, unsigned long a4, unsigned long a5,
485 struct pt_regs *regs);
486int sys_clone(unsigned long clone_flags, unsigned long usp,
487 int __user *parent_tidp, void __user *child_threadptr,
488 int __user *child_tidp, int p6, struct pt_regs *regs);
489int sys_fork(unsigned long p1, unsigned long p2, unsigned long p3,
490 unsigned long p4, unsigned long p5, unsigned long p6,
491 struct pt_regs *regs);
492int sys_vfork(unsigned long p1, unsigned long p2, unsigned long p3,
493 unsigned long p4, unsigned long p5, unsigned long p6,
494 struct pt_regs *regs);
495int sys_pipe(int __user *fildes);
496struct sigaction;
497long sys_rt_sigaction(int sig, const struct sigaction __user *act,
498 struct sigaction __user *oact, size_t sigsetsize);
499
500/*
501 * "Conditional" syscalls 469 * "Conditional" syscalls
502 * 470 *
503 * What we want is __attribute__((weak,alias("sys_ni_syscall"))), 471 * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
diff --git a/include/asm-powerpc/vdso_datapage.h b/include/asm-powerpc/vdso_datapage.h
index 7aa92086c3fb..8a94f0eba5e9 100644
--- a/include/asm-powerpc/vdso_datapage.h
+++ b/include/asm-powerpc/vdso_datapage.h
@@ -55,6 +55,9 @@ struct vdso_data {
55 __u32 minor; /* Minor number 0x14 */ 55 __u32 minor; /* Minor number 0x14 */
56 } version; 56 } version;
57 57
58 /* Note about the platform flags: it now only contains the lpar
59 * bit. The actual platform number is dead and burried
60 */
58 __u32 platform; /* Platform flags 0x18 */ 61 __u32 platform; /* Platform flags 0x18 */
59 __u32 processor; /* Processor type 0x1C */ 62 __u32 processor; /* Processor type 0x1C */
60 __u64 processorCount; /* # of physical processors 0x20 */ 63 __u64 processorCount; /* # of physical processors 0x20 */