History

Disintegrate asm/system.h for Sparc

Disintegrate asm/system.h for Sparc.

David Howells committed 14 years ago

Commit d550bbd1 parent e839ca584 files · +684 −669Browse files

Unified · Split

84 files
  1. arch/sparc/include/asm/atomic_32.h +1 −1
  2. arch/sparc/include/asm/atomic_64.h +1 −2
  3. arch/sparc/include/asm/auxio_32.h +0 −1
  4. arch/sparc/include/asm/barrier.h +8 −0
  5. arch/sparc/include/asm/barrier_32.h +15 −0
  6. arch/sparc/include/asm/barrier_64.h +56 −0
  7. arch/sparc/include/asm/bug.h +3 −0
  8. arch/sparc/include/asm/cacheflush_32.h +9 −0
  9. arch/sparc/include/asm/cacheflush_64.h +10 −0
  10. arch/sparc/include/asm/cmpxchg.h +8 −0
  11. arch/sparc/include/asm/cmpxchg_32.h +112 −0
  12. arch/sparc/include/asm/cmpxchg_64.h +145 −0
  13. arch/sparc/include/asm/cpu_type.h +34 −0
  14. arch/sparc/include/asm/exec.h +6 −0
  15. arch/sparc/include/asm/floppy_32.h +0 −1
  16. arch/sparc/include/asm/futex_64.h +0 −1
  17. arch/sparc/include/asm/io_32.h +0 −1
  18. arch/sparc/include/asm/io_64.h +0 −1
  19. arch/sparc/include/asm/irqflags_32.h +1 −0
  20. arch/sparc/include/asm/mmu_context_64.h +0 −1
  21. arch/sparc/include/asm/ns87303.h +0 −1
  22. arch/sparc/include/asm/perfctr.h +23 −0
  23. arch/sparc/include/asm/pgtable_32.h +1 −1
  24. arch/sparc/include/asm/pgtable_64.h +0 −1
  25. arch/sparc/include/asm/processor.h +3 −0
  26. arch/sparc/include/asm/processor_64.h +3 −0
  27. arch/sparc/include/asm/ptrace.h +2 −3
  28. arch/sparc/include/asm/setup.h +16 −0
  29. arch/sparc/include/asm/switch_to.h +8 −0
  30. arch/sparc/include/asm/switch_to_32.h +106 −0
  31. arch/sparc/include/asm/switch_to_64.h +72 −0
  32. arch/sparc/include/asm/system.h +6 −8
  33. arch/sparc/include/asm/system_32.h +0 −284
  34. arch/sparc/include/asm/system_64.h +0 −331
  35. arch/sparc/include/asm/timer_32.h +2 −1
  36. arch/sparc/include/asm/uaccess_64.h +0 −1
  37. arch/sparc/kernel/auxio_32.c +1 −0
  38. arch/sparc/kernel/devices.c +1 −1
  39. arch/sparc/kernel/irq.h +1 −0
  40. arch/sparc/kernel/irq_64.c +0 −1
  41. arch/sparc/kernel/kgdb_32.c +1 −0
  42. arch/sparc/kernel/module.c +1 −0
  43. arch/sparc/kernel/muldiv.c +0 −1
  44. arch/sparc/kernel/nmi.c +1 −0
  45. arch/sparc/kernel/pcr.c +1 −0
  46. arch/sparc/kernel/perf_event.c +2 −0
  47. arch/sparc/kernel/process_32.c +1 −1
  48. arch/sparc/kernel/process_64.c +0 −1
  49. arch/sparc/kernel/ptrace_32.c +1 −1
  50. arch/sparc/kernel/ptrace_64.c +0 −1
  51. arch/sparc/kernel/reboot.c +1 −1
  52. arch/sparc/kernel/setup_32.c +1 −1
  53. arch/sparc/kernel/setup_64.c +1 −1
  54. arch/sparc/kernel/signal32.c +1 −0
  55. arch/sparc/kernel/signal_32.c +1 −0
  56. arch/sparc/kernel/signal_64.c +2 −0
  57. arch/sparc/kernel/sigutil_32.c +1 −0
  58. arch/sparc/kernel/sigutil_64.c +1 −0
  59. arch/sparc/kernel/sparc_ksyms_64.c +1 −1
  60. arch/sparc/kernel/time_32.c +0 −1
  61. arch/sparc/kernel/traps_32.c +0 −1
  62. arch/sparc/kernel/traps_64.c +1 −1
  63. arch/sparc/kernel/unaligned_32.c +0 −1
  64. arch/sparc/kernel/unaligned_64.c +1 −1
  65. arch/sparc/kernel/visemul.c +1 −1
  66. arch/sparc/math-emu/math_64.c +1 −0
  67. arch/sparc/mm/btfixup.c +0 −1
  68. arch/sparc/mm/fault_32.c +0 −1
  69. arch/sparc/mm/init_32.c +0 −1
  70. arch/sparc/mm/init_64.c +0 −1
  71. arch/sparc/mm/loadmmu.c +0 −1
  72. arch/sparc/mm/tsb.c +0 −1
  73. arch/sparc/prom/console_32.c +0 −1
  74. arch/sparc/prom/console_64.c +0 −1
  75. arch/sparc/prom/misc_32.c +0 −1
  76. arch/sparc/prom/misc_64.c +0 −1
  77. arch/sparc/prom/p1275.c +0 −1
  78. arch/sparc/prom/ranges.c +0 −1
  79. drivers/tty/serial/sunhv.c +1 −0
  80. drivers/tty/serial/sunsab.c +1 −0
  81. drivers/tty/serial/sunsu.c +1 −0
  82. drivers/tty/serial/sunzilog.c +1 −0
  83. kernel/signal.c +1 −0
  84. kernel/sysctl.c +3 −0
arch/sparc/include/asm/atomic_32.h+1−1
@@ -13,9 +13,9 @@ · 12 unmodified lines
1313
1414 #include <linux/types.h>
1515
16+#include <asm/cmpxchg.h>
1617 #include <asm-generic/atomic64.h>
1718
18−#include <asm/system.h>
1919
2020 #define ATOMIC_INIT(i) { (i) }
2121
arch/sparc/include/asm/atomic_64.h+1−2
@@ -8,7 +8,7 @@ · 7 unmodified lines
88 #define __ARCH_SPARC64_ATOMIC__
99
1010 #include <linux/types.h>
11−#include <asm/system.h>
11+#include <asm/cmpxchg.h>
1212
1313 #define ATOMIC_INIT(i) { (i) }
1414 #define ATOMIC64_INIT(i) { (i) }
@@ -85,7 +85,6 @@ static inline int __atomic_add_unless(atomic_t *v, int a, int u) · 70 unmodified lines
8585 return c;
8686 }
8787
88−
8988 #define atomic64_cmpxchg(v, o, n) \
9089 ((__typeof__((v)->counter))cmpxchg(&((v)->counter), (o), (n)))
9190 #define atomic64_xchg(v, new) (xchg(&((v)->counter), new))
arch/sparc/include/asm/auxio_32.h+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #ifndef _SPARC_AUXIO_H
77 #define _SPARC_AUXIO_H
88
9−#include <asm/system.h>
109 #include <asm/vaddrs.h>
1110
1211 /* This register is an unsigned char in IO space. It does two things.
arch/sparc/include/asm/barrier.h+8−0
@@ -0,0 +1,8 @@
1+#ifndef ___ASM_SPARC_BARRIER_H
2+#define ___ASM_SPARC_BARRIER_H
3+#if defined(__sparc__) && defined(__arch64__)
4+#include <asm/barrier_64.h>
5+#else
6+#include <asm/barrier_32.h>
7+#endif
8+#endif
arch/sparc/include/asm/barrier_32.h+15−0
@@ -0,0 +1,15 @@
1+#ifndef __SPARC_BARRIER_H
2+#define __SPARC_BARRIER_H
3+
4+/* XXX Change this if we ever use a PSO mode kernel. */
5+#define mb() __asm__ __volatile__ ("" : : : "memory")
6+#define rmb() mb()
7+#define wmb() mb()
8+#define read_barrier_depends() do { } while(0)
9+#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
10+#define smp_mb() __asm__ __volatile__("":::"memory")
11+#define smp_rmb() __asm__ __volatile__("":::"memory")
12+#define smp_wmb() __asm__ __volatile__("":::"memory")
13+#define smp_read_barrier_depends() do { } while(0)
14+
15+#endif /* !(__SPARC_BARRIER_H) */
arch/sparc/include/asm/barrier_64.h+56−0
@@ -0,0 +1,56 @@
1+#ifndef __SPARC64_BARRIER_H
2+#define __SPARC64_BARRIER_H
3+
4+/* These are here in an effort to more fully work around Spitfire Errata
5+ * #51. Essentially, if a memory barrier occurs soon after a mispredicted
6+ * branch, the chip can stop executing instructions until a trap occurs.
7+ * Therefore, if interrupts are disabled, the chip can hang forever.
8+ *
9+ * It used to be believed that the memory barrier had to be right in the
10+ * delay slot, but a case has been traced recently wherein the memory barrier
11+ * was one instruction after the branch delay slot and the chip still hung.
12+ * The offending sequence was the following in sym_wakeup_done() of the
13+ * sym53c8xx_2 driver:
14+ *
15+ * call sym_ccb_from_dsa, 0
16+ * movge %icc, 0, %l0
17+ * brz,pn %o0, .LL1303
18+ * mov %o0, %l2
19+ * membar #LoadLoad
20+ *
21+ * The branch has to be mispredicted for the bug to occur. Therefore, we put
22+ * the memory barrier explicitly into a "branch always, predicted taken"
23+ * delay slot to avoid the problem case.
24+ */
25+#define membar_safe(type) \
26+do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
27+ " membar " type "\n" \
28+ "1:\n" \
29+ : : : "memory"); \
30+} while (0)
31+
32+/* The kernel always executes in TSO memory model these days,
33+ * and furthermore most sparc64 chips implement more stringent
34+ * memory ordering than required by the specifications.
35+ */
36+#define mb() membar_safe("#StoreLoad")
37+#define rmb() __asm__ __volatile__("":::"memory")
38+#define wmb() __asm__ __volatile__("":::"memory")
39+
40+#define read_barrier_depends() do { } while(0)
41+#define set_mb(__var, __value) \
42+ do { __var = __value; membar_safe("#StoreLoad"); } while(0)
43+
44+#ifdef CONFIG_SMP
45+#define smp_mb() mb()
46+#define smp_rmb() rmb()
47+#define smp_wmb() wmb()
48+#else
49+#define smp_mb() __asm__ __volatile__("":::"memory")
50+#define smp_rmb() __asm__ __volatile__("":::"memory")
51+#define smp_wmb() __asm__ __volatile__("":::"memory")
52+#endif
53+
54+#define smp_read_barrier_depends() do { } while(0)
55+
56+#endif /* !(__SPARC64_BARRIER_H) */
arch/sparc/include/asm/bug.h+3−0
@@ -19,4 +19,7 @@ extern void do_BUG(const char *file, int line); · 18 unmodified lines
1919
2020 #include <asm-generic/bug.h>
2121
22+struct pt_regs;
23+extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn));
24+
2225 #endif
arch/sparc/include/asm/cacheflush_32.h+9−0
@@ -83,4 +83,13 @@ extern void sparc_flush_page_to_ram(struct page *page); · 82 unmodified lines
8383 #define flush_cache_vmap(start, end) flush_cache_all()
8484 #define flush_cache_vunmap(start, end) flush_cache_all()
8585
86+/* When a context switch happens we must flush all user windows so that
87+ * the windows of the current process are flushed onto its stack. This
88+ * way the windows are all clean for the next process and the stack
89+ * frames are up to date.
90+ */
91+extern void flush_user_windows(void);
92+extern void kill_user_windows(void);
93+extern void flushw_all(void);
94+
8695 #endif /* _SPARC_CACHEFLUSH_H */
arch/sparc/include/asm/cacheflush_64.h+10−0
@@ -9,6 +9,16 @@ · 8 unmodified lines
99
1010 /* Cache flush operations. */
1111
12+
13+#define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
14+#define flushw_all() __asm__ __volatile__("flushw")
15+
16+extern void __flushw_user(void);
17+#define flushw_user() __flushw_user()
18+
19+#define flush_user_windows flushw_user
20+#define flush_register_windows flushw_all
21+
1222 /* These are the same regardless of whether this is an SMP kernel or not. */
1323 #define flush_cache_mm(__mm) \
1424 do { if ((__mm) == current->mm) flushw_user(); } while(0)
arch/sparc/include/asm/cmpxchg.h+8−0
@@ -0,0 +1,8 @@
1+#ifndef ___ASM_SPARC_CMPXCHG_H
2+#define ___ASM_SPARC_CMPXCHG_H
3+#if defined(__sparc__) && defined(__arch64__)
4+#include <asm/cmpxchg_64.h>
5+#else
6+#include <asm/cmpxchg_32.h>
7+#endif
8+#endif
arch/sparc/include/asm/cmpxchg_32.h+112−0
@@ -0,0 +1,112 @@
1+/* 32-bit atomic xchg() and cmpxchg() definitions.
2+ *
3+ * Copyright (C) 1996 David S. Miller (davem@davemloft.net)
4+ * Copyright (C) 2000 Anton Blanchard (anton@linuxcare.com.au)
5+ * Copyright (C) 2007 Kyle McMartin (kyle@parisc-linux.org)
6+ *
7+ * Additions by Keith M Wesolowski (wesolows@foobazco.org) based
8+ * on asm-parisc/atomic.h Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>.
9+ */
10+
11+#ifndef __ARCH_SPARC_CMPXCHG__
12+#define __ARCH_SPARC_CMPXCHG__
13+
14+#include <asm/btfixup.h>
15+
16+/* This has special calling conventions */
17+#ifndef CONFIG_SMP
18+BTFIXUPDEF_CALL(void, ___xchg32, void)
19+#endif
20+
21+static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val)
22+{
23+#ifdef CONFIG_SMP
24+ __asm__ __volatile__("swap [%2], %0"
25+ : "=&r" (val)
26+ : "0" (val), "r" (m)
27+ : "memory");
28+ return val;
29+#else
30+ register unsigned long *ptr asm("g1");
31+ register unsigned long ret asm("g2");
32+
33+ ptr = (unsigned long *) m;
34+ ret = val;
35+
36+ /* Note: this is magic and the nop there is
37+ really needed. */
38+ __asm__ __volatile__(
39+ "mov %%o7, %%g4\n\t"
40+ "call ___f____xchg32\n\t"
41+ " nop\n\t"
42+ : "=&r" (ret)
43+ : "0" (ret), "r" (ptr)
44+ : "g3", "g4", "g7", "memory", "cc");
45+
46+ return ret;
47+#endif
48+}
49+
50+extern void __xchg_called_with_bad_pointer(void);
51+
52+static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size)
53+{
54+ switch (size) {
55+ case 4:
56+ return xchg_u32(ptr, x);
57+ }
58+ __xchg_called_with_bad_pointer();
59+ return x;
60+}
61+
62+#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
63+
64+/* Emulate cmpxchg() the same way we emulate atomics,
65+ * by hashing the object address and indexing into an array
66+ * of spinlocks to get a bit of performance...
67+ *
68+ * See arch/sparc/lib/atomic32.c for implementation.
69+ *
70+ * Cribbed from <asm-parisc/atomic.h>
71+ */
72+#define __HAVE_ARCH_CMPXCHG 1
73+
74+/* bug catcher for when unsupported size is used - won't link */
75+extern void __cmpxchg_called_with_bad_pointer(void);
76+/* we only need to support cmpxchg of a u32 on sparc */
77+extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
78+
79+/* don't worry...optimizer will get rid of most of this */
80+static inline unsigned long
81+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
82+{
83+ switch (size) {
84+ case 4:
85+ return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_);
86+ default:
87+ __cmpxchg_called_with_bad_pointer();
88+ break;
89+ }
90+ return old;
91+}
92+
93+#define cmpxchg(ptr, o, n) \
94+({ \
95+ __typeof__(*(ptr)) _o_ = (o); \
96+ __typeof__(*(ptr)) _n_ = (n); \
97+ (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
98+ (unsigned long)_n_, sizeof(*(ptr))); \
99+})
100+
101+#include <asm-generic/cmpxchg-local.h>
102+
103+/*
104+ * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
105+ * them available.
106+ */
107+#define cmpxchg_local(ptr, o, n) \
108+ ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
109+ (unsigned long)(n), sizeof(*(ptr))))
110+#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
111+
112+#endif /* __ARCH_SPARC_CMPXCHG__ */
arch/sparc/include/asm/cmpxchg_64.h+145−0
@@ -0,0 +1,145 @@
1+/* 64-bit atomic xchg() and cmpxchg() definitions.
2+ *
3+ * Copyright (C) 1996, 1997, 2000 David S. Miller (davem@redhat.com)
4+ */
5+
6+#ifndef __ARCH_SPARC64_CMPXCHG__
7+#define __ARCH_SPARC64_CMPXCHG__
8+
9+static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
10+{
11+ unsigned long tmp1, tmp2;
12+
13+ __asm__ __volatile__(
14+" mov %0, %1\n"
15+"1: lduw [%4], %2\n"
16+" cas [%4], %2, %0\n"
17+" cmp %2, %0\n"
18+" bne,a,pn %%icc, 1b\n"
19+" mov %1, %0\n"
20+ : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
21+ : "0" (val), "r" (m)
22+ : "cc", "memory");
23+ return val;
24+}
25+
26+static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
27+{
28+ unsigned long tmp1, tmp2;
29+
30+ __asm__ __volatile__(
31+" mov %0, %1\n"
32+"1: ldx [%4], %2\n"
33+" casx [%4], %2, %0\n"
34+" cmp %2, %0\n"
35+" bne,a,pn %%xcc, 1b\n"
36+" mov %1, %0\n"
37+ : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
38+ : "0" (val), "r" (m)
39+ : "cc", "memory");
40+ return val;
41+}
42+
43+#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
44+
45+extern void __xchg_called_with_bad_pointer(void);
46+
47+static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
48+ int size)
49+{
50+ switch (size) {
51+ case 4:
52+ return xchg32(ptr, x);
53+ case 8:
54+ return xchg64(ptr, x);
55+ }
56+ __xchg_called_with_bad_pointer();
57+ return x;
58+}
59+
60+/*
61+ * Atomic compare and exchange. Compare OLD with MEM, if identical,
62+ * store NEW in MEM. Return the initial value in MEM. Success is
63+ * indicated by comparing RETURN with OLD.
64+ */
65+
66+#include <asm-generic/cmpxchg-local.h>
67+
68+#define __HAVE_ARCH_CMPXCHG 1
69+
70+static inline unsigned long
71+__cmpxchg_u32(volatile int *m, int old, int new)
72+{
73+ __asm__ __volatile__("cas [%2], %3, %0"
74+ : "=&r" (new)
75+ : "0" (new), "r" (m), "r" (old)
76+ : "memory");
77+
78+ return new;
79+}
80+
81+static inline unsigned long
82+__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
83+{
84+ __asm__ __volatile__("casx [%2], %3, %0"
85+ : "=&r" (new)
86+ : "0" (new), "r" (m), "r" (old)
87+ : "memory");
88+
89+ return new;
90+}
91+
92+/* This function doesn't exist, so you'll get a linker error
93+ if something tries to do an invalid cmpxchg(). */
94+extern void __cmpxchg_called_with_bad_pointer(void);
95+
96+static inline unsigned long
97+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
98+{
99+ switch (size) {
100+ case 4:
101+ return __cmpxchg_u32(ptr, old, new);
102+ case 8:
103+ return __cmpxchg_u64(ptr, old, new);
104+ }
105+ __cmpxchg_called_with_bad_pointer();
106+ return old;
107+}
108+
109+#define cmpxchg(ptr,o,n) \
110+ ({ \
111+ __typeof__(*(ptr)) _o_ = (o); \
112+ __typeof__(*(ptr)) _n_ = (n); \
113+ (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
114+ (unsigned long)_n_, sizeof(*(ptr))); \
115+ })
116+
117+/*
118+ * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
119+ * them available.
120+ */
121+
122+static inline unsigned long __cmpxchg_local(volatile void *ptr,
123+ unsigned long old,
124+ unsigned long new, int size)
125+{
126+ switch (size) {
127+ case 4:
128+ case 8: return __cmpxchg(ptr, old, new, size);
129+ default:
130+ return __cmpxchg_local_generic(ptr, old, new, size);
131+ }
132+
133+ return old;
134+}
135+
136+#define cmpxchg_local(ptr, o, n) \
137+ ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
138+ (unsigned long)(n), sizeof(*(ptr))))
139+#define cmpxchg64_local(ptr, o, n) \
140+ ({ \
141+ BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
142+ cmpxchg_local((ptr), (o), (n)); \
143+ })
144+
145+#endif /* __ARCH_SPARC64_CMPXCHG__ */
arch/sparc/include/asm/cpu_type.h+34−0
@@ -0,0 +1,34 @@
1+#ifndef __ASM_CPU_TYPE_H
2+#define __ASM_CPU_TYPE_H
3+
4+/*
5+ * Sparc (general) CPU types
6+ */
7+enum sparc_cpu {
8+ sun4 = 0x00,
9+ sun4c = 0x01,
10+ sun4m = 0x02,
11+ sun4d = 0x03,
12+ sun4e = 0x04,
13+ sun4u = 0x05, /* V8 ploos ploos */
14+ sun_unknown = 0x06,
15+ ap1000 = 0x07, /* almost a sun4m */
16+ sparc_leon = 0x08, /* Leon SoC */
17+};
18+
19+#ifdef CONFIG_SPARC32
20+extern enum sparc_cpu sparc_cpu_model;
21+
22+#define ARCH_SUN4C (sparc_cpu_model==sun4c)
23+
24+#define SUN4M_NCPUS 4 /* Architectural limit of sun4m. */
25+
26+#else
27+
28+#define sparc_cpu_model sun4u
29+
30+/* This cannot ever be a sun4c :) That's just history. */
31+#define ARCH_SUN4C 0
32+#endif
33+
34+#endif /* __ASM_CPU_TYPE_H */
arch/sparc/include/asm/exec.h+6−0
@@ -0,0 +1,6 @@
1+#ifndef __SPARC_EXEC_H
2+#define __SPARC_EXEC_H
3+
4+#define arch_align_stack(x) (x)
5+
6+#endif /* __SPARC_EXEC_H */
arch/sparc/include/asm/floppy_32.h+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111
1212 #include <asm/page.h>
1313 #include <asm/pgtable.h>
14−#include <asm/system.h>
1514 #include <asm/idprom.h>
1615 #include <asm/machines.h>
1716 #include <asm/oplib.h>
arch/sparc/include/asm/futex_64.h+0−1
@@ -4,7 +4,6 @@ · 3 unmodified lines
44 #include <linux/futex.h>
55 #include <linux/uaccess.h>
66 #include <asm/errno.h>
7−#include <asm/system.h>
87
98 #define __futex_cas_op(insn, ret, oldval, uaddr, oparg) \
109 __asm__ __volatile__( \
arch/sparc/include/asm/io_32.h+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/ioport.h> /* struct resource */
77
88 #include <asm/page.h> /* IO address mapping routines need this */
9−#include <asm/system.h>
109 #include <asm-generic/pci_iomap.h>
1110
1211 #define page_to_phys(page) (page_to_pfn(page) << PAGE_SHIFT)
arch/sparc/include/asm/io_64.h+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/types.h>
77
88 #include <asm/page.h> /* IO address mapping routines need this */
9−#include <asm/system.h>
109 #include <asm/asi.h>
1110 #include <asm-generic/pci_iomap.h>
1211
arch/sparc/include/asm/irqflags_32.h+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #ifndef __ASSEMBLY__
1414
1515 #include <linux/types.h>
16+#include <asm/psr.h>
1617
1718 extern void arch_local_irq_restore(unsigned long);
1819 extern unsigned long arch_local_irq_save(void);
arch/sparc/include/asm/mmu_context_64.h+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #ifndef __ASSEMBLY__
77
88 #include <linux/spinlock.h>
9−#include <asm/system.h>
109 #include <asm/spitfire.h>
1110 #include <asm-generic/mm_hooks.h>
1211
arch/sparc/include/asm/ns87303.h+0−1
@@ -79,7 +79,6 @@ · 78 unmodified lines
7979
8080 #include <linux/spinlock.h>
8181
82−#include <asm/system.h>
8382 #include <asm/io.h>
8483
8584 extern spinlock_t ns87303_lock;
arch/sparc/include/asm/perfctr.h+23−0
@@ -168,6 +168,29 @@ struct vcounter_struct { · 167 unmodified lines
168168 unsigned long long vcnt1;
169169 };
170170
171+#else /* !(__KERNEL__) */
172+
173+#ifndef CONFIG_SPARC32
174+
175+/* Performance counter register access. */
176+#define read_pcr(__p) __asm__ __volatile__("rd %%pcr, %0" : "=r" (__p))
177+#define write_pcr(__p) __asm__ __volatile__("wr %0, 0x0, %%pcr" : : "r" (__p))
178+#define read_pic(__p) __asm__ __volatile__("rd %%pic, %0" : "=r" (__p))
179+
180+/* Blackbird errata workaround. See commentary in
181+ * arch/sparc64/kernel/smp.c:smp_percpu_timer_interrupt()
182+ * for more information.
183+ */
184+#define write_pic(__p) \
185+ __asm__ __volatile__("ba,pt %%xcc, 99f\n\t" \
186+ " nop\n\t" \
187+ ".align 64\n" \
188+ "99:wr %0, 0x0, %%pic\n\t" \
189+ "rd %%pic, %%g0" : : "r" (__p))
190+#define reset_pic() write_pic(0)
191+
192+#endif /* !CONFIG_SPARC32 */
193+
171194 #endif /* !(__KERNEL__) */
172195
173196 #endif /* !(PERF_COUNTER_API) */
arch/sparc/include/asm/pgtable_32.h+1−1
@@ -21,7 +21,7 @@ · 20 unmodified lines
2121 #include <asm/vac-ops.h>
2222 #include <asm/oplib.h>
2323 #include <asm/btfixup.h>
24−#include <asm/system.h>
24+#include <asm/cpu_type.h>
2525
2626
2727 struct vm_area_struct;
arch/sparc/include/asm/pgtable_64.h+0−1
@@ -19,7 +19,6 @@ · 18 unmodified lines
1919 #include <asm/types.h>
2020 #include <asm/spitfire.h>
2121 #include <asm/asi.h>
22−#include <asm/system.h>
2322 #include <asm/page.h>
2423 #include <asm/processor.h>
2524
arch/sparc/include/asm/processor.h+3−0
@@ -5,4 +5,7 @@ · 4 unmodified lines
55 #else
66 #include <asm/processor_32.h>
77 #endif
8+
9+#define nop() __asm__ __volatile__ ("nop")
10+
811 #endif
arch/sparc/include/asm/processor_64.h+3−0
@@ -18,6 +18,9 @@ · 17 unmodified lines
1818 #include <asm/ptrace.h>
1919 #include <asm/page.h>
2020
21+/* Don't hold the runqueue lock over context switch */
22+#define __ARCH_WANT_UNLOCKED_CTXSW
23+
2124 /* The sparc has no problems with write protection */
2225 #define wp_works_ok 1
2326 #define wp_works_ok__is_a_macro /* for versions in ksyms.c */
arch/sparc/include/asm/ptrace.h+2−3
@@ -98,6 +98,8 @@ struct sparc_trapf { · 97 unmodified lines
9898 */
9999 #ifndef __ASSEMBLY__
100100
101+#include <linux/types.h>
102+
101103 struct pt_regs {
102104 unsigned long psr;
103105 unsigned long pc;
@@ -163,7 +165,6 @@ struct sparc_stackf { · 59 unmodified lines
163165 #ifdef __KERNEL__
164166
165167 #include <linux/threads.h>
166−#include <asm/system.h>
167168
168169 static inline int pt_regs_trap_type(struct pt_regs *regs)
169170 {
@@ -240,8 +241,6 @@ extern unsigned long profile_pc(struct pt_regs *); · 70 unmodified lines
240241
241242 #ifdef __KERNEL__
242243
243−#include <asm/system.h>
244−
245244 static inline bool pt_regs_is_syscall(struct pt_regs *regs)
246245 {
247246 return (regs->psr & PSR_SYSCALL);
arch/sparc/include/asm/setup.h+16−0
@@ -13,14 +13,30 @@ · 12 unmodified lines
1313
1414 #ifdef __KERNEL__
1515
16+extern char reboot_command[];
17+
1618 #ifdef CONFIG_SPARC32
1719 /* The CPU that was used for booting
1820 * Only sun4d + leon may have boot_cpu_id != 0
1921 */
2022 extern unsigned char boot_cpu_id;
2123 extern unsigned char boot_cpu_id4;
24+
25+extern unsigned long empty_bad_page;
26+extern unsigned long empty_bad_page_table;
27+extern unsigned long empty_zero_page;
28+
29+extern int serial_console;
30+static inline int con_is_present(void)
31+{
32+ return serial_console ? 0 : 1;
33+}
2234 #endif
2335
36+extern void sun_do_break(void);
37+extern int stop_a_enabled;
38+extern int scons_pwroff;
39+
2440 #endif /* __KERNEL__ */
2541
2642 #endif /* _SPARC_SETUP_H */
arch/sparc/include/asm/switch_to.h+8−0
@@ -0,0 +1,8 @@
1+#ifndef ___ASM_SPARC_SWITCH_TO_H
2+#define ___ASM_SPARC_SWITCH_TO_H
3+#if defined(__sparc__) && defined(__arch64__)
4+#include <asm/switch_to_64.h>
5+#else
6+#include <asm/switch_to_32.h>
7+#endif
8+#endif
arch/sparc/include/asm/switch_to_32.h+106−0
@@ -0,0 +1,106 @@
1+#ifndef __SPARC_SWITCH_TO_H
2+#define __SPARC_SWITCH_TO_H
3+
4+#include <asm/smp.h>
5+
6+extern struct thread_info *current_set[NR_CPUS];
7+
8+/*
9+ * Flush windows so that the VM switch which follows
10+ * would not pull the stack from under us.
11+ *
12+ * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work)
13+ * XXX WTF is the above comment? Found in late teen 2.4.x.
14+ */
15+#ifdef CONFIG_SMP
16+#define SWITCH_ENTER(prv) \
17+ do { \
18+ if (test_tsk_thread_flag(prv, TIF_USEDFPU)) { \
19+ put_psr(get_psr() | PSR_EF); \
20+ fpsave(&(prv)->thread.float_regs[0], &(prv)->thread.fsr, \
21+ &(prv)->thread.fpqueue[0], &(prv)->thread.fpqdepth); \
22+ clear_tsk_thread_flag(prv, TIF_USEDFPU); \
23+ (prv)->thread.kregs->psr &= ~PSR_EF; \
24+ } \
25+ } while(0)
26+
27+#define SWITCH_DO_LAZY_FPU(next) /* */
28+#else
29+#define SWITCH_ENTER(prv) /* */
30+#define SWITCH_DO_LAZY_FPU(nxt) \
31+ do { \
32+ if (last_task_used_math != (nxt)) \
33+ (nxt)->thread.kregs->psr&=~PSR_EF; \
34+ } while(0)
35+#endif
36+
37+#define prepare_arch_switch(next) do { \
38+ __asm__ __volatile__( \
39+ ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \
40+ "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
41+ "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
42+ "save %sp, -0x40, %sp\n\t" \
43+ "restore; restore; restore; restore; restore; restore; restore"); \
44+} while(0)
45+
46+ /* Much care has gone into this code, do not touch it.
47+ *
48+ * We need to loadup regs l0/l1 for the newly forked child
49+ * case because the trap return path relies on those registers
50+ * holding certain values, gcc is told that they are clobbered.
51+ * Gcc needs registers for 3 values in and 1 value out, so we
52+ * clobber every non-fixed-usage register besides l2/l3/o4/o5. -DaveM
53+ *
54+ * Hey Dave, that do not touch sign is too much of an incentive
55+ * - Anton & Pete
56+ */
57+#define switch_to(prev, next, last) do { \
58+ SWITCH_ENTER(prev); \
59+ SWITCH_DO_LAZY_FPU(next); \
60+ cpumask_set_cpu(smp_processor_id(), mm_cpumask(next->active_mm)); \
61+ __asm__ __volatile__( \
62+ "sethi %%hi(here - 0x8), %%o7\n\t" \
63+ "mov %%g6, %%g3\n\t" \
64+ "or %%o7, %%lo(here - 0x8), %%o7\n\t" \
65+ "rd %%psr, %%g4\n\t" \
66+ "std %%sp, [%%g6 + %4]\n\t" \
67+ "rd %%wim, %%g5\n\t" \
68+ "wr %%g4, 0x20, %%psr\n\t" \
69+ "nop\n\t" \
70+ "std %%g4, [%%g6 + %3]\n\t" \
71+ "ldd [%2 + %3], %%g4\n\t" \
72+ "mov %2, %%g6\n\t" \
73+ ".globl patchme_store_new_current\n" \
74+"patchme_store_new_current:\n\t" \
75+ "st %2, [%1]\n\t" \
76+ "wr %%g4, 0x20, %%psr\n\t" \
77+ "nop\n\t" \
78+ "nop\n\t" \
79+ "nop\n\t" /* LEON needs all 3 nops: load to %sp depends on CWP. */ \
80+ "ldd [%%g6 + %4], %%sp\n\t" \
81+ "wr %%g5, 0x0, %%wim\n\t" \
82+ "ldd [%%sp + 0x00], %%l0\n\t" \
83+ "ldd [%%sp + 0x38], %%i6\n\t" \
84+ "wr %%g4, 0x0, %%psr\n\t" \
85+ "nop\n\t" \
86+ "nop\n\t" \
87+ "jmpl %%o7 + 0x8, %%g0\n\t" \
88+ " ld [%%g3 + %5], %0\n\t" \
89+ "here:\n" \
90+ : "=&r" (last) \
91+ : "r" (&(current_set[hard_smp_processor_id()])), \
92+ "r" (task_thread_info(next)), \
93+ "i" (TI_KPSR), \
94+ "i" (TI_KSP), \
95+ "i" (TI_TASK) \
96+ : "g1", "g2", "g3", "g4", "g5", "g7", \
97+ "l0", "l1", "l3", "l4", "l5", "l6", "l7", \
98+ "i0", "i1", "i2", "i3", "i4", "i5", \
99+ "o0", "o1", "o2", "o3", "o7"); \
100+ } while(0)
101+
102+extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
103+ void *fpqueue, unsigned long *fpqdepth);
104+extern void synchronize_user_stack(void);
105+
106+#endif /* __SPARC_SWITCH_TO_H */
arch/sparc/include/asm/switch_to_64.h+72−0
@@ -0,0 +1,72 @@
1+#ifndef __SPARC64_SWITCH_TO_64_H
2+#define __SPARC64_SWITCH_TO_64_H
3+
4+#include <asm/visasm.h>
5+
6+#define prepare_arch_switch(next) \
7+do { \
8+ flushw_all(); \
9+} while (0)
10+
11+ /* See what happens when you design the chip correctly?
12+ *
13+ * We tell gcc we clobber all non-fixed-usage registers except
14+ * for l0/l1. It will use one for 'next' and the other to hold
15+ * the output value of 'last'. 'next' is not referenced again
16+ * past the invocation of switch_to in the scheduler, so we need
17+ * not preserve it's value. Hairy, but it lets us remove 2 loads
18+ * and 2 stores in this critical code path. -DaveM
19+ */
20+#define switch_to(prev, next, last) \
21+do { flush_tlb_pending(); \
22+ save_and_clear_fpu(); \
23+ /* If you are tempted to conditionalize the following */ \
24+ /* so that ASI is only written if it changes, think again. */ \
25+ __asm__ __volatile__("wr %%g0, %0, %%asi" \
26+ : : "r" (__thread_flag_byte_ptr(task_thread_info(next))[TI_FLAG_BYTE_CURRENT_DS]));\
27+ trap_block[current_thread_info()->cpu].thread = \
28+ task_thread_info(next); \
29+ __asm__ __volatile__( \
30+ "mov %%g4, %%g7\n\t" \
31+ "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \
32+ "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
33+ "rdpr %%wstate, %%o5\n\t" \
34+ "stx %%o6, [%%g6 + %6]\n\t" \
35+ "stb %%o5, [%%g6 + %5]\n\t" \
36+ "rdpr %%cwp, %%o5\n\t" \
37+ "stb %%o5, [%%g6 + %8]\n\t" \
38+ "wrpr %%g0, 15, %%pil\n\t" \
39+ "mov %4, %%g6\n\t" \
40+ "ldub [%4 + %8], %%g1\n\t" \
41+ "wrpr %%g1, %%cwp\n\t" \
42+ "ldx [%%g6 + %6], %%o6\n\t" \
43+ "ldub [%%g6 + %5], %%o5\n\t" \
44+ "ldub [%%g6 + %7], %%o7\n\t" \
45+ "wrpr %%o5, 0x0, %%wstate\n\t" \
46+ "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
47+ "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
48+ "ldx [%%g6 + %9], %%g4\n\t" \
49+ "wrpr %%g0, 14, %%pil\n\t" \
50+ "brz,pt %%o7, switch_to_pc\n\t" \
51+ " mov %%g7, %0\n\t" \
52+ "sethi %%hi(ret_from_syscall), %%g1\n\t" \
53+ "jmpl %%g1 + %%lo(ret_from_syscall), %%g0\n\t" \
54+ " nop\n\t" \
55+ ".globl switch_to_pc\n\t" \
56+ "switch_to_pc:\n\t" \
57+ : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
58+ "=r" (__local_per_cpu_offset) \
59+ : "0" (task_thread_info(next)), \
60+ "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
61+ "i" (TI_CWP), "i" (TI_TASK) \
62+ : "cc", \
63+ "g1", "g2", "g3", "g7", \
64+ "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
65+ "i0", "i1", "i2", "i3", "i4", "i5", \
66+ "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
67+} while(0)
68+
69+extern void synchronize_user_stack(void);
70+extern void fault_in_user_windows(void);
71+
72+#endif /* __SPARC64_SWITCH_TO_64_H */
arch/sparc/include/asm/system.h+6−8
@@ -1,8 +1,6 @@
1−#ifndef ___ASM_SPARC_SYSTEM_H
2−#define ___ASM_SPARC_SYSTEM_H
3−#if defined(__sparc__) && defined(__arch64__)
4−#include <asm/system_64.h>
5−#else
6−#include <asm/system_32.h>
7−#endif
8−#endif
1+/* FILE TO BE DELETED. DO NOT ADD STUFF HERE! */
2+#include <asm/barrier.h>
3+#include <asm/cpu_type.h>
4+#include <asm/cmpxchg.h>
5+#include <asm/exec.h>
6+#include <asm/switch_to.h>
arch/sparc/include/asm/system_32.h+0−284
@@ -1,284 +0,0 @@
1−#ifndef __SPARC_SYSTEM_H
2−#define __SPARC_SYSTEM_H
3−
4−#include <linux/kernel.h>
5−#include <linux/threads.h> /* NR_CPUS */
6−#include <linux/thread_info.h>
7−
8−#include <asm/page.h>
9−#include <asm/psr.h>
10−#include <asm/ptrace.h>
11−#include <asm/btfixup.h>
12−#include <asm/smp.h>
13−
14−#ifndef __ASSEMBLY__
15−
16−#include <linux/irqflags.h>
17−
18−/*
19− * Sparc (general) CPU types
20− */
21−enum sparc_cpu {
22− sun4 = 0x00,
23− sun4c = 0x01,
24− sun4m = 0x02,
25− sun4d = 0x03,
26− sun4e = 0x04,
27− sun4u = 0x05, /* V8 ploos ploos */
28− sun_unknown = 0x06,
29− ap1000 = 0x07, /* almost a sun4m */
30− sparc_leon = 0x08, /* Leon SoC */
31−};
32−
33−/* Really, userland should not be looking at any of this... */
34−#ifdef __KERNEL__
35−
36−extern enum sparc_cpu sparc_cpu_model;
37−
38−#define ARCH_SUN4C (sparc_cpu_model==sun4c)
39−
40−#define SUN4M_NCPUS 4 /* Architectural limit of sun4m. */
41−
42−extern char reboot_command[];
43−
44−extern struct thread_info *current_set[NR_CPUS];
45−
46−extern unsigned long empty_bad_page;
47−extern unsigned long empty_bad_page_table;
48−extern unsigned long empty_zero_page;
49−
50−extern void sun_do_break(void);
51−extern int serial_console;
52−extern int stop_a_enabled;
53−extern int scons_pwroff;
54−
55−static inline int con_is_present(void)
56−{
57− return serial_console ? 0 : 1;
58−}
59−
60−/* When a context switch happens we must flush all user windows so that
61− * the windows of the current process are flushed onto its stack. This
62− * way the windows are all clean for the next process and the stack
63− * frames are up to date.
64− */
65−extern void flush_user_windows(void);
66−extern void kill_user_windows(void);
67−extern void synchronize_user_stack(void);
68−extern void fpsave(unsigned long *fpregs, unsigned long *fsr,
69− void *fpqueue, unsigned long *fpqdepth);
70−
71−#ifdef CONFIG_SMP
72−#define SWITCH_ENTER(prv) \
73− do { \
74− if (test_tsk_thread_flag(prv, TIF_USEDFPU)) { \
75− put_psr(get_psr() | PSR_EF); \
76− fpsave(&(prv)->thread.float_regs[0], &(prv)->thread.fsr, \
77− &(prv)->thread.fpqueue[0], &(prv)->thread.fpqdepth); \
78− clear_tsk_thread_flag(prv, TIF_USEDFPU); \
79− (prv)->thread.kregs->psr &= ~PSR_EF; \
80− } \
81− } while(0)
82−
83−#define SWITCH_DO_LAZY_FPU(next) /* */
84−#else
85−#define SWITCH_ENTER(prv) /* */
86−#define SWITCH_DO_LAZY_FPU(nxt) \
87− do { \
88− if (last_task_used_math != (nxt)) \
89− (nxt)->thread.kregs->psr&=~PSR_EF; \
90− } while(0)
91−#endif
92−
93−extern void flushw_all(void);
94−
95−/*
96− * Flush windows so that the VM switch which follows
97− * would not pull the stack from under us.
98− *
99− * SWITCH_ENTER and SWITH_DO_LAZY_FPU do not work yet (e.g. SMP does not work)
100− * XXX WTF is the above comment? Found in late teen 2.4.x.
101− */
102−#define prepare_arch_switch(next) do { \
103− __asm__ __volatile__( \
104− ".globl\tflush_patch_switch\nflush_patch_switch:\n\t" \
105− "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
106− "save %sp, -0x40, %sp; save %sp, -0x40, %sp; save %sp, -0x40, %sp\n\t" \
107− "save %sp, -0x40, %sp\n\t" \
108− "restore; restore; restore; restore; restore; restore; restore"); \
109−} while(0)
110−
111− /* Much care has gone into this code, do not touch it.
112− *
113− * We need to loadup regs l0/l1 for the newly forked child
114− * case because the trap return path relies on those registers
115− * holding certain values, gcc is told that they are clobbered.
116− * Gcc needs registers for 3 values in and 1 value out, so we
117− * clobber every non-fixed-usage register besides l2/l3/o4/o5. -DaveM
118− *
119− * Hey Dave, that do not touch sign is too much of an incentive
120− * - Anton & Pete
121− */
122−#define switch_to(prev, next, last) do { \
123− SWITCH_ENTER(prev); \
124− SWITCH_DO_LAZY_FPU(next); \
125− cpumask_set_cpu(smp_processor_id(), mm_cpumask(next->active_mm)); \
126− __asm__ __volatile__( \
127− "sethi %%hi(here - 0x8), %%o7\n\t" \
128− "mov %%g6, %%g3\n\t" \
129− "or %%o7, %%lo(here - 0x8), %%o7\n\t" \
130− "rd %%psr, %%g4\n\t" \
131− "std %%sp, [%%g6 + %4]\n\t" \
132− "rd %%wim, %%g5\n\t" \
133− "wr %%g4, 0x20, %%psr\n\t" \
134− "nop\n\t" \
135− "std %%g4, [%%g6 + %3]\n\t" \
136− "ldd [%2 + %3], %%g4\n\t" \
137− "mov %2, %%g6\n\t" \
138− ".globl patchme_store_new_current\n" \
139−"patchme_store_new_current:\n\t" \
140− "st %2, [%1]\n\t" \
141− "wr %%g4, 0x20, %%psr\n\t" \
142− "nop\n\t" \
143− "nop\n\t" \
144− "nop\n\t" /* LEON needs all 3 nops: load to %sp depends on CWP. */ \
145− "ldd [%%g6 + %4], %%sp\n\t" \
146− "wr %%g5, 0x0, %%wim\n\t" \
147− "ldd [%%sp + 0x00], %%l0\n\t" \
148− "ldd [%%sp + 0x38], %%i6\n\t" \
149− "wr %%g4, 0x0, %%psr\n\t" \
150− "nop\n\t" \
151− "nop\n\t" \
152− "jmpl %%o7 + 0x8, %%g0\n\t" \
153− " ld [%%g3 + %5], %0\n\t" \
154− "here:\n" \
155− : "=&r" (last) \
156− : "r" (&(current_set[hard_smp_processor_id()])), \
157− "r" (task_thread_info(next)), \
158− "i" (TI_KPSR), \
159− "i" (TI_KSP), \
160− "i" (TI_TASK) \
161− : "g1", "g2", "g3", "g4", "g5", "g7", \
162− "l0", "l1", "l3", "l4", "l5", "l6", "l7", \
163− "i0", "i1", "i2", "i3", "i4", "i5", \
164− "o0", "o1", "o2", "o3", "o7"); \
165− } while(0)
166−
167−/* XXX Change this if we ever use a PSO mode kernel. */
168−#define mb() __asm__ __volatile__ ("" : : : "memory")
169−#define rmb() mb()
170−#define wmb() mb()
171−#define read_barrier_depends() do { } while(0)
172−#define set_mb(__var, __value) do { __var = __value; mb(); } while(0)
173−#define smp_mb() __asm__ __volatile__("":::"memory")
174−#define smp_rmb() __asm__ __volatile__("":::"memory")
175−#define smp_wmb() __asm__ __volatile__("":::"memory")
176−#define smp_read_barrier_depends() do { } while(0)
177−
178−#define nop() __asm__ __volatile__ ("nop")
179−
180−/* This has special calling conventions */
181−#ifndef CONFIG_SMP
182−BTFIXUPDEF_CALL(void, ___xchg32, void)
183−#endif
184−
185−static inline unsigned long xchg_u32(__volatile__ unsigned long *m, unsigned long val)
186−{
187−#ifdef CONFIG_SMP
188− __asm__ __volatile__("swap [%2], %0"
189− : "=&r" (val)
190− : "0" (val), "r" (m)
191− : "memory");
192− return val;
193−#else
194− register unsigned long *ptr asm("g1");
195− register unsigned long ret asm("g2");
196−
197− ptr = (unsigned long *) m;
198− ret = val;
199−
200− /* Note: this is magic and the nop there is
201− really needed. */
202− __asm__ __volatile__(
203− "mov %%o7, %%g4\n\t"
204− "call ___f____xchg32\n\t"
205− " nop\n\t"
206− : "=&r" (ret)
207− : "0" (ret), "r" (ptr)
208− : "g3", "g4", "g7", "memory", "cc");
209−
210− return ret;
211−#endif
212−}
213−
214−#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
215−
216−extern void __xchg_called_with_bad_pointer(void);
217−
218−static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr, int size)
219−{
220− switch (size) {
221− case 4:
222− return xchg_u32(ptr, x);
223− }
224− __xchg_called_with_bad_pointer();
225− return x;
226−}
227−
228−/* Emulate cmpxchg() the same way we emulate atomics,
229− * by hashing the object address and indexing into an array
230− * of spinlocks to get a bit of performance...
231− *
232− * See arch/sparc/lib/atomic32.c for implementation.
233− *
234− * Cribbed from <asm-parisc/atomic.h>
235− */
236−#define __HAVE_ARCH_CMPXCHG 1
237−
238−/* bug catcher for when unsupported size is used - won't link */
239−extern void __cmpxchg_called_with_bad_pointer(void);
240−/* we only need to support cmpxchg of a u32 on sparc */
241−extern unsigned long __cmpxchg_u32(volatile u32 *m, u32 old, u32 new_);
242−
243−/* don't worry...optimizer will get rid of most of this */
244−static inline unsigned long
245−__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
246−{
247− switch (size) {
248− case 4:
249− return __cmpxchg_u32((u32 *)ptr, (u32)old, (u32)new_);
250− default:
251− __cmpxchg_called_with_bad_pointer();
252− break;
253− }
254− return old;
255−}
256−
257−#define cmpxchg(ptr, o, n) \
258−({ \
259− __typeof__(*(ptr)) _o_ = (o); \
260− __typeof__(*(ptr)) _n_ = (n); \
261− (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
262− (unsigned long)_n_, sizeof(*(ptr))); \
263−})
264−
265−#include <asm-generic/cmpxchg-local.h>
266−
267−/*
268− * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
269− * them available.
270− */
271−#define cmpxchg_local(ptr, o, n) \
272− ((__typeof__(*(ptr)))__cmpxchg_local_generic((ptr), (unsigned long)(o),\
273− (unsigned long)(n), sizeof(*(ptr))))
274−#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
275−
276−extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn));
277−
278−#endif /* __KERNEL__ */
279−
280−#endif /* __ASSEMBLY__ */
281−
282−#define arch_align_stack(x) (x)
283−
284−#endif /* !(__SPARC_SYSTEM_H) */
arch/sparc/include/asm/system_64.h+0−331
@@ -1,331 +0,0 @@
1−#ifndef __SPARC64_SYSTEM_H
2−#define __SPARC64_SYSTEM_H
3−
4−#include <asm/ptrace.h>
5−#include <asm/processor.h>
6−#include <asm/visasm.h>
7−
8−#ifndef __ASSEMBLY__
9−
10−#include <linux/irqflags.h>
11−#include <asm-generic/cmpxchg-local.h>
12−
13−/*
14− * Sparc (general) CPU types
15− */
16−enum sparc_cpu {
17− sun4 = 0x00,
18− sun4c = 0x01,
19− sun4m = 0x02,
20− sun4d = 0x03,
21− sun4e = 0x04,
22− sun4u = 0x05, /* V8 ploos ploos */
23− sun_unknown = 0x06,
24− ap1000 = 0x07, /* almost a sun4m */
25−};
26−
27−#define sparc_cpu_model sun4u
28−
29−/* This cannot ever be a sun4c :) That's just history. */
30−#define ARCH_SUN4C 0
31−
32−extern char reboot_command[];
33−
34−/* These are here in an effort to more fully work around Spitfire Errata
35− * #51. Essentially, if a memory barrier occurs soon after a mispredicted
36− * branch, the chip can stop executing instructions until a trap occurs.
37− * Therefore, if interrupts are disabled, the chip can hang forever.
38− *
39− * It used to be believed that the memory barrier had to be right in the
40− * delay slot, but a case has been traced recently wherein the memory barrier
41− * was one instruction after the branch delay slot and the chip still hung.
42− * The offending sequence was the following in sym_wakeup_done() of the
43− * sym53c8xx_2 driver:
44− *
45− * call sym_ccb_from_dsa, 0
46− * movge %icc, 0, %l0
47− * brz,pn %o0, .LL1303
48− * mov %o0, %l2
49− * membar #LoadLoad
50− *
51− * The branch has to be mispredicted for the bug to occur. Therefore, we put
52− * the memory barrier explicitly into a "branch always, predicted taken"
53− * delay slot to avoid the problem case.
54− */
55−#define membar_safe(type) \
56−do { __asm__ __volatile__("ba,pt %%xcc, 1f\n\t" \
57− " membar " type "\n" \
58− "1:\n" \
59− : : : "memory"); \
60−} while (0)
61−
62−/* The kernel always executes in TSO memory model these days,
63− * and furthermore most sparc64 chips implement more stringent
64− * memory ordering than required by the specifications.
65− */
66−#define mb() membar_safe("#StoreLoad")
67−#define rmb() __asm__ __volatile__("":::"memory")
68−#define wmb() __asm__ __volatile__("":::"memory")
69−
70−#endif
71−
72−#define nop() __asm__ __volatile__ ("nop")
73−
74−#define read_barrier_depends() do { } while(0)
75−#define set_mb(__var, __value) \
76− do { __var = __value; membar_safe("#StoreLoad"); } while(0)
77−
78−#ifdef CONFIG_SMP
79−#define smp_mb() mb()
80−#define smp_rmb() rmb()
81−#define smp_wmb() wmb()
82−#else
83−#define smp_mb() __asm__ __volatile__("":::"memory")
84−#define smp_rmb() __asm__ __volatile__("":::"memory")
85−#define smp_wmb() __asm__ __volatile__("":::"memory")
86−#endif
87−
88−#define smp_read_barrier_depends() do { } while(0)
89−
90−#define flushi(addr) __asm__ __volatile__ ("flush %0" : : "r" (addr) : "memory")
91−
92−#define flushw_all() __asm__ __volatile__("flushw")
93−
94−/* Performance counter register access. */
95−#define read_pcr(__p) __asm__ __volatile__("rd %%pcr, %0" : "=r" (__p))
96−#define write_pcr(__p) __asm__ __volatile__("wr %0, 0x0, %%pcr" : : "r" (__p))
97−#define read_pic(__p) __asm__ __volatile__("rd %%pic, %0" : "=r" (__p))
98−
99−/* Blackbird errata workaround. See commentary in
100− * arch/sparc64/kernel/smp.c:smp_percpu_timer_interrupt()
101− * for more information.
102− */
103−#define write_pic(__p) \
104− __asm__ __volatile__("ba,pt %%xcc, 99f\n\t" \
105− " nop\n\t" \
106− ".align 64\n" \
107− "99:wr %0, 0x0, %%pic\n\t" \
108− "rd %%pic, %%g0" : : "r" (__p))
109−#define reset_pic() write_pic(0)
110−
111−#ifndef __ASSEMBLY__
112−
113−extern void sun_do_break(void);
114−extern int stop_a_enabled;
115−extern int scons_pwroff;
116−
117−extern void fault_in_user_windows(void);
118−extern void synchronize_user_stack(void);
119−
120−extern void __flushw_user(void);
121−#define flushw_user() __flushw_user()
122−
123−#define flush_user_windows flushw_user
124−#define flush_register_windows flushw_all
125−
126−/* Don't hold the runqueue lock over context switch */
127−#define __ARCH_WANT_UNLOCKED_CTXSW
128−#define prepare_arch_switch(next) \
129−do { \
130− flushw_all(); \
131−} while (0)
132−
133− /* See what happens when you design the chip correctly?
134− *
135− * We tell gcc we clobber all non-fixed-usage registers except
136− * for l0/l1. It will use one for 'next' and the other to hold
137− * the output value of 'last'. 'next' is not referenced again
138− * past the invocation of switch_to in the scheduler, so we need
139− * not preserve it's value. Hairy, but it lets us remove 2 loads
140− * and 2 stores in this critical code path. -DaveM
141− */
142−#define switch_to(prev, next, last) \
143−do { flush_tlb_pending(); \
144− save_and_clear_fpu(); \
145− /* If you are tempted to conditionalize the following */ \
146− /* so that ASI is only written if it changes, think again. */ \
147− __asm__ __volatile__("wr %%g0, %0, %%asi" \
148− : : "r" (__thread_flag_byte_ptr(task_thread_info(next))[TI_FLAG_BYTE_CURRENT_DS]));\
149− trap_block[current_thread_info()->cpu].thread = \
150− task_thread_info(next); \
151− __asm__ __volatile__( \
152− "mov %%g4, %%g7\n\t" \
153− "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \
154− "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
155− "rdpr %%wstate, %%o5\n\t" \
156− "stx %%o6, [%%g6 + %6]\n\t" \
157− "stb %%o5, [%%g6 + %5]\n\t" \
158− "rdpr %%cwp, %%o5\n\t" \
159− "stb %%o5, [%%g6 + %8]\n\t" \
160− "wrpr %%g0, 15, %%pil\n\t" \
161− "mov %4, %%g6\n\t" \
162− "ldub [%4 + %8], %%g1\n\t" \
163− "wrpr %%g1, %%cwp\n\t" \
164− "ldx [%%g6 + %6], %%o6\n\t" \
165− "ldub [%%g6 + %5], %%o5\n\t" \
166− "ldub [%%g6 + %7], %%o7\n\t" \
167− "wrpr %%o5, 0x0, %%wstate\n\t" \
168− "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
169− "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
170− "ldx [%%g6 + %9], %%g4\n\t" \
171− "wrpr %%g0, 14, %%pil\n\t" \
172− "brz,pt %%o7, switch_to_pc\n\t" \
173− " mov %%g7, %0\n\t" \
174− "sethi %%hi(ret_from_syscall), %%g1\n\t" \
175− "jmpl %%g1 + %%lo(ret_from_syscall), %%g0\n\t" \
176− " nop\n\t" \
177− ".globl switch_to_pc\n\t" \
178− "switch_to_pc:\n\t" \
179− : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
180− "=r" (__local_per_cpu_offset) \
181− : "0" (task_thread_info(next)), \
182− "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
183− "i" (TI_CWP), "i" (TI_TASK) \
184− : "cc", \
185− "g1", "g2", "g3", "g7", \
186− "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
187− "i0", "i1", "i2", "i3", "i4", "i5", \
188− "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
189−} while(0)
190−
191−static inline unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
192−{
193− unsigned long tmp1, tmp2;
194−
195− __asm__ __volatile__(
196−" mov %0, %1\n"
197−"1: lduw [%4], %2\n"
198−" cas [%4], %2, %0\n"
199−" cmp %2, %0\n"
200−" bne,a,pn %%icc, 1b\n"
201−" mov %1, %0\n"
202− : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
203− : "0" (val), "r" (m)
204− : "cc", "memory");
205− return val;
206−}
207−
208−static inline unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
209−{
210− unsigned long tmp1, tmp2;
211−
212− __asm__ __volatile__(
213−" mov %0, %1\n"
214−"1: ldx [%4], %2\n"
215−" casx [%4], %2, %0\n"
216−" cmp %2, %0\n"
217−" bne,a,pn %%xcc, 1b\n"
218−" mov %1, %0\n"
219− : "=&r" (val), "=&r" (tmp1), "=&r" (tmp2)
220− : "0" (val), "r" (m)
221− : "cc", "memory");
222− return val;
223−}
224−
225−#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
226−
227−extern void __xchg_called_with_bad_pointer(void);
228−
229−static inline unsigned long __xchg(unsigned long x, __volatile__ void * ptr,
230− int size)
231−{
232− switch (size) {
233− case 4:
234− return xchg32(ptr, x);
235− case 8:
236− return xchg64(ptr, x);
237− }
238− __xchg_called_with_bad_pointer();
239− return x;
240−}
241−
242−extern void die_if_kernel(char *str, struct pt_regs *regs) __attribute__ ((noreturn));
243−
244−/*
245− * Atomic compare and exchange. Compare OLD with MEM, if identical,
246− * store NEW in MEM. Return the initial value in MEM. Success is
247− * indicated by comparing RETURN with OLD.
248− */
249−
250−#define __HAVE_ARCH_CMPXCHG 1
251−
252−static inline unsigned long
253−__cmpxchg_u32(volatile int *m, int old, int new)
254−{
255− __asm__ __volatile__("cas [%2], %3, %0"
256− : "=&r" (new)
257− : "0" (new), "r" (m), "r" (old)
258− : "memory");
259−
260− return new;
261−}
262−
263−static inline unsigned long
264−__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
265−{
266− __asm__ __volatile__("casx [%2], %3, %0"
267− : "=&r" (new)
268− : "0" (new), "r" (m), "r" (old)
269− : "memory");
270−
271− return new;
272−}
273−
274−/* This function doesn't exist, so you'll get a linker error
275− if something tries to do an invalid cmpxchg(). */
276−extern void __cmpxchg_called_with_bad_pointer(void);
277−
278−static inline unsigned long
279−__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
280−{
281− switch (size) {
282− case 4:
283− return __cmpxchg_u32(ptr, old, new);
284− case 8:
285− return __cmpxchg_u64(ptr, old, new);
286− }
287− __cmpxchg_called_with_bad_pointer();
288− return old;
289−}
290−
291−#define cmpxchg(ptr,o,n) \
292− ({ \
293− __typeof__(*(ptr)) _o_ = (o); \
294− __typeof__(*(ptr)) _n_ = (n); \
295− (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \
296− (unsigned long)_n_, sizeof(*(ptr))); \
297− })
298−
299−/*
300− * cmpxchg_local and cmpxchg64_local are atomic wrt current CPU. Always make
301− * them available.
302− */
303−
304−static inline unsigned long __cmpxchg_local(volatile void *ptr,
305− unsigned long old,
306− unsigned long new, int size)
307−{
308− switch (size) {
309− case 4:
310− case 8: return __cmpxchg(ptr, old, new, size);
311− default:
312− return __cmpxchg_local_generic(ptr, old, new, size);
313− }
314−
315− return old;
316−}
317−
318−#define cmpxchg_local(ptr, o, n) \
319− ((__typeof__(*(ptr)))__cmpxchg_local((ptr), (unsigned long)(o), \
320− (unsigned long)(n), sizeof(*(ptr))))
321−#define cmpxchg64_local(ptr, o, n) \
322− ({ \
323− BUILD_BUG_ON(sizeof(*(ptr)) != 8); \
324− cmpxchg_local((ptr), (o), (n)); \
325− })
326−
327−#endif /* !(__ASSEMBLY__) */
328−
329−#define arch_align_stack(x) (x)
330−
331−#endif /* !(__SPARC64_SYSTEM_H) */
arch/sparc/include/asm/timer_32.h+2−1
@@ -8,12 +8,13 @@ · 7 unmodified lines
88 #ifndef _SPARC_TIMER_H
99 #define _SPARC_TIMER_H
1010
11−#include <asm/system.h> /* For SUN4M_NCPUS */
11+#include <asm/cpu_type.h> /* For SUN4M_NCPUS */
1212 #include <asm/btfixup.h>
1313
1414 extern __volatile__ unsigned int *master_l10_counter;
1515
1616 /* FIXME: Make do_[gs]ettimeofday btfixup calls */
17+struct timespec;
1718 BTFIXUPDEF_CALL(int, bus_do_settimeofday, struct timespec *tv)
1819 #define bus_do_settimeofday(tv) BTFIXUP_CALL(bus_do_settimeofday)(tv)
1920
arch/sparc/include/asm/uaccess_64.h+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <linux/string.h>
1212 #include <linux/thread_info.h>
1313 #include <asm/asi.h>
14−#include <asm/system.h>
1514 #include <asm/spitfire.h>
1615 #include <asm-generic/uaccess-unaligned.h>
1716 #endif
arch/sparc/kernel/auxio_32.c+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 #include <asm/io.h>
1414 #include <asm/auxio.h>
1515 #include <asm/string.h> /* memset(), Linux has no bzero() */
16+#include <asm/cpu_type.h>
1617
1718 /* Probe and map in the Auxiliary I/O register */
1819
arch/sparc/kernel/devices.c+1−1
@@ -17,8 +17,8 @@ · 16 unmodified lines
1717 #include <asm/oplib.h>
1818 #include <asm/prom.h>
1919 #include <asm/smp.h>
20−#include <asm/system.h>
2120 #include <asm/cpudata.h>
21+#include <asm/cpu_type.h>
2222
2323 extern void clock_stop_probe(void); /* tadpole.c */
2424 extern void sun4c_probe_memerr_reg(void);
arch/sparc/kernel/irq.h+1−0
@@ -1,6 +1,7 @@
11 #include <linux/platform_device.h>
22
33 #include <asm/btfixup.h>
4+#include <asm/cpu_type.h>
45
56 struct irq_bucket {
67 struct irq_bucket *next;
arch/sparc/kernel/irq_64.c+0−1
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 #include <asm/ptrace.h>
2727 #include <asm/processor.h>
2828 #include <linux/atomic.h>
29−#include <asm/system.h>
3029 #include <asm/irq.h>
3130 #include <asm/io.h>
3231 #include <asm/iommu.h>
arch/sparc/kernel/kgdb_32.c+1−0
@@ -9,6 +9,7 @@ · 8 unmodified lines
99 #include <asm/kdebug.h>
1010 #include <asm/ptrace.h>
1111 #include <asm/irq.h>
12+#include <asm/cacheflush.h>
1213
1314 extern unsigned long trapbase;
1415
arch/sparc/kernel/module.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616
1717 #include <asm/processor.h>
1818 #include <asm/spitfire.h>
19+#include <asm/cacheflush.h>
1920
2021 #include "entry.h"
2122
arch/sparc/kernel/muldiv.c+0−1
@@ -14,7 +14,6 @@ · 13 unmodified lines
1414 #include <linux/mm.h>
1515 #include <asm/ptrace.h>
1616 #include <asm/processor.h>
17−#include <asm/system.h>
1817 #include <asm/uaccess.h>
1918
2019 #include "kernel.h"
arch/sparc/kernel/nmi.c+1−0
@@ -22,6 +22,7 @@ · 21 unmodified lines
2222 #include <asm/perf_event.h>
2323 #include <asm/ptrace.h>
2424 #include <asm/pcr.h>
25+#include <asm/perfctr.h>
2526
2627 #include "kstack.h"
2728
arch/sparc/kernel/pcr.c+1−0
@@ -14,6 +14,7 @@ · 13 unmodified lines
1414 #include <asm/pcr.h>
1515 #include <asm/nmi.h>
1616 #include <asm/spitfire.h>
17+#include <asm/perfctr.h>
1718
1819 /* This code is shared between various users of the performance
1920 * counters. Users will be oprofile, pseudo-NMI watchdog, and the
arch/sparc/kernel/perf_event.c+2−0
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 #include <linux/atomic.h>
2626 #include <asm/nmi.h>
2727 #include <asm/pcr.h>
28+#include <asm/perfctr.h>
29+#include <asm/cacheflush.h>
2830
2931 #include "kernel.h"
3032 #include "kstack.h"
arch/sparc/kernel/process_32.c+1−1
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828 #include <asm/auxio.h>
2929 #include <asm/oplib.h>
3030 #include <asm/uaccess.h>
31−#include <asm/system.h>
3231 #include <asm/page.h>
3332 #include <asm/pgalloc.h>
3433 #include <asm/pgtable.h>
@@ -38,6 +37,7 @@ · 3 unmodified lines
3837 #include <asm/elf.h>
3938 #include <asm/prom.h>
4039 #include <asm/unistd.h>
40+#include <asm/setup.h>
4141
4242 /*
4343 * Power management idle function
arch/sparc/kernel/process_64.c+0−1
@@ -32,7 +32,6 @@ · 31 unmodified lines
3232 #include <linux/nmi.h>
3333
3434 #include <asm/uaccess.h>
35−#include <asm/system.h>
3635 #include <asm/page.h>
3736 #include <asm/pgalloc.h>
3837 #include <asm/pgtable.h>
arch/sparc/kernel/ptrace_32.c+1−1
@@ -23,8 +23,8 @@ · 22 unmodified lines
2323 #include <linux/tracehook.h>
2424
2525 #include <asm/pgtable.h>
26−#include <asm/system.h>
2726 #include <asm/uaccess.h>
27+#include <asm/cacheflush.h>
2828
2929 /* #define ALLOW_INIT_TRACING */
3030
arch/sparc/kernel/ptrace_64.c+0−1
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929
3030 #include <asm/asi.h>
3131 #include <asm/pgtable.h>
32−#include <asm/system.h>
3332 #include <asm/uaccess.h>
3433 #include <asm/psrcompat.h>
3534 #include <asm/visasm.h>
arch/sparc/kernel/reboot.c+1−1
@@ -7,9 +7,9 @@ · 6 unmodified lines
77 #include <linux/export.h>
88 #include <linux/pm.h>
99
10−#include <asm/system.h>
1110 #include <asm/oplib.h>
1211 #include <asm/prom.h>
12+#include <asm/setup.h>
1313
1414 /* sysctl - toggle power-off restriction for serial console
1515 * systems in machine_power_off()
arch/sparc/kernel/setup_32.c+1−1
@@ -33,7 +33,6 @@ · 32 unmodified lines
3333 #include <linux/kdebug.h>
3434 #include <linux/export.h>
3535
36−#include <asm/system.h>
3736 #include <asm/io.h>
3837 #include <asm/processor.h>
3938 #include <asm/oplib.h>
@@ -46,6 +45,7 @@ · 6 unmodified lines
4645 #include <asm/machines.h>
4746 #include <asm/cpudata.h>
4847 #include <asm/setup.h>
48+#include <asm/cacheflush.h>
4949
5050 #include "kernel.h"
5151
arch/sparc/kernel/setup_64.c+1−1
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131 #include <linux/initrd.h>
3232 #include <linux/module.h>
3333
34−#include <asm/system.h>
3534 #include <asm/io.h>
3635 #include <asm/processor.h>
3736 #include <asm/oplib.h>
@@ -49,6 +48,7 @@ · 11 unmodified lines
4948 #include <asm/btext.h>
5049 #include <asm/elf.h>
5150 #include <asm/mdesc.h>
51+#include <asm/cacheflush.h>
5252
5353 #ifdef CONFIG_IP_PNP
5454 #include <net/ipconfig.h>
arch/sparc/kernel/signal32.c+1−0
@@ -28,6 +28,7 @@ · 27 unmodified lines
2828 #include <asm/fpumacro.h>
2929 #include <asm/visasm.h>
3030 #include <asm/compat_signal.h>
31+#include <asm/switch_to.h>
3132
3233 #include "sigutil.h"
3334
arch/sparc/kernel/signal_32.c+1−0
@@ -25,6 +25,7 @@ · 24 unmodified lines
2525 #include <asm/pgalloc.h>
2626 #include <asm/pgtable.h>
2727 #include <asm/cacheflush.h> /* flush_sig_insns */
28+#include <asm/switch_to.h>
2829
2930 #include "sigutil.h"
3031
arch/sparc/kernel/signal_64.c+2−0
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131 #include <asm/uctx.h>
3232 #include <asm/siginfo.h>
3333 #include <asm/visasm.h>
34+#include <asm/switch_to.h>
35+#include <asm/cacheflush.h>
3436
3537 #include "entry.h"
3638 #include "systbls.h"
arch/sparc/kernel/sigutil_32.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <asm/sigcontext.h>
88 #include <asm/fpumacro.h>
99 #include <asm/ptrace.h>
10+#include <asm/switch_to.h>
1011
1112 #include "sigutil.h"
1213
arch/sparc/kernel/sigutil_64.c+1−0
@@ -7,6 +7,7 @@ · 6 unmodified lines
77 #include <asm/sigcontext.h>
88 #include <asm/fpumacro.h>
99 #include <asm/ptrace.h>
10+#include <asm/switch_to.h>
1011
1112 #include "sigutil.h"
1213
arch/sparc/kernel/sparc_ksyms_64.c+1−1
@@ -10,12 +10,12 @@ · 9 unmodified lines
1010 #include <linux/init.h>
1111 #include <linux/bitops.h>
1212
13−#include <asm/system.h>
1413 #include <asm/cpudata.h>
1514 #include <asm/uaccess.h>
1615 #include <asm/spitfire.h>
1716 #include <asm/oplib.h>
1817 #include <asm/hypervisor.h>
18+#include <asm/cacheflush.h>
1919
2020 struct poll {
2121 int fd;
arch/sparc/kernel/time_32.c+0−1
@@ -37,7 +37,6 @@ · 36 unmodified lines
3737 #include <asm/oplib.h>
3838 #include <asm/timex.h>
3939 #include <asm/timer.h>
40−#include <asm/system.h>
4140 #include <asm/irq.h>
4241 #include <asm/io.h>
4342 #include <asm/idprom.h>
arch/sparc/kernel/traps_32.c+0−1
@@ -17,7 +17,6 @@ · 16 unmodified lines
1717 #include <linux/export.h>
1818
1919 #include <asm/delay.h>
20−#include <asm/system.h>
2120 #include <asm/ptrace.h>
2221 #include <asm/oplib.h>
2322 #include <asm/page.h>
arch/sparc/kernel/traps_64.c+1−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222
2323 #include <asm/smp.h>
2424 #include <asm/delay.h>
25−#include <asm/system.h>
2625 #include <asm/ptrace.h>
2726 #include <asm/oplib.h>
2827 #include <asm/page.h>
@@ -41,6 +40,7 @@ · 12 unmodified lines
4140 #include <asm/head.h>
4241 #include <asm/prom.h>
4342 #include <asm/memctrl.h>
43+#include <asm/cacheflush.h>
4444
4545 #include "entry.h"
4646 #include "kstack.h"
arch/sparc/kernel/unaligned_32.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 #include <linux/mm.h>
1313 #include <asm/ptrace.h>
1414 #include <asm/processor.h>
15−#include <asm/system.h>
1615 #include <asm/uaccess.h>
1716 #include <linux/smp.h>
1817 #include <linux/perf_event.h>
arch/sparc/kernel/unaligned_64.c+1−1
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 #include <asm/ptrace.h>
1717 #include <asm/pstate.h>
1818 #include <asm/processor.h>
19−#include <asm/system.h>
2019 #include <asm/uaccess.h>
2120 #include <linux/smp.h>
2221 #include <linux/bitops.h>
@@ -24,6 +23,7 @@ · 1 unmodified line
2423 #include <linux/ratelimit.h>
2524 #include <linux/bitops.h>
2625 #include <asm/fpumacro.h>
26+#include <asm/cacheflush.h>
2727
2828 enum direction {
2929 load, /* ld, ldd, ldh, ldsh */
arch/sparc/kernel/visemul.c+1−1
@@ -9,9 +9,9 @@ · 8 unmodified lines
99
1010 #include <asm/ptrace.h>
1111 #include <asm/pstate.h>
12−#include <asm/system.h>
1312 #include <asm/fpumacro.h>
1413 #include <asm/uaccess.h>
14+#include <asm/cacheflush.h>
1515
1616 /* OPF field of various VIS instructions. */
1717
arch/sparc/math-emu/math_64.c+1−0
@@ -16,6 +16,7 @@ · 15 unmodified lines
1616 #include <asm/fpumacro.h>
1717 #include <asm/ptrace.h>
1818 #include <asm/uaccess.h>
19+#include <asm/cacheflush.h>
1920
2021 #include "sfp-util_64.h"
2122 #include <math-emu/soft-fp.h>
arch/sparc/mm/btfixup.c+0−1
@@ -12,7 +12,6 @@ · 11 unmodified lines
1212 #include <asm/pgalloc.h>
1313 #include <asm/pgtable.h>
1414 #include <asm/oplib.h>
15−#include <asm/system.h>
1615 #include <asm/cacheflush.h>
1716
1817 #define BTFIXUP_OPTIMIZE_NOP
arch/sparc/mm/fault_32.c+0−1
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 #include <linux/interrupt.h>
2323 #include <linux/kdebug.h>
2424
25−#include <asm/system.h>
2625 #include <asm/page.h>
2726 #include <asm/pgtable.h>
2827 #include <asm/memreg.h>
arch/sparc/mm/init_32.c+0−1
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 #include <linux/gfp.h>
2828
2929 #include <asm/sections.h>
30−#include <asm/system.h>
3130 #include <asm/vac-ops.h>
3231 #include <asm/page.h>
3332 #include <asm/pgtable.h>
arch/sparc/mm/init_64.c+0−1
@@ -28,7 +28,6 @@ · 27 unmodified lines
2828 #include <linux/gfp.h>
2929
3030 #include <asm/head.h>
31−#include <asm/system.h>
3231 #include <asm/page.h>
3332 #include <asm/pgalloc.h>
3433 #include <asm/pgtable.h>
arch/sparc/mm/loadmmu.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <linux/mm.h>
1212 #include <linux/init.h>
1313
14−#include <asm/system.h>
1514 #include <asm/page.h>
1615 #include <asm/pgtable.h>
1716 #include <asm/mmu_context.h>
arch/sparc/mm/tsb.c+0−1
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 #include <linux/kernel.h>
77 #include <linux/preempt.h>
88 #include <linux/slab.h>
9−#include <asm/system.h>
109 #include <asm/page.h>
1110 #include <asm/tlbflush.h>
1211 #include <asm/tlb.h>
arch/sparc/prom/console_32.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <linux/sched.h>
1212 #include <asm/openprom.h>
1313 #include <asm/oplib.h>
14−#include <asm/system.h>
1514 #include <linux/string.h>
1615
1716 extern void restore_current(void);
arch/sparc/prom/console_64.c+0−1
@@ -10,7 +10,6 @@ · 9 unmodified lines
1010 #include <linux/sched.h>
1111 #include <asm/openprom.h>
1212 #include <asm/oplib.h>
13−#include <asm/system.h>
1413 #include <linux/string.h>
1514
1615 static int __prom_console_write_buf(const char *buf, int len)
arch/sparc/prom/misc_32.c+0−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313 #include <asm/openprom.h>
1414 #include <asm/oplib.h>
1515 #include <asm/auxio.h>
16−#include <asm/system.h>
1716
1817 extern void restore_current(void);
1918
arch/sparc/prom/misc_64.c+0−1
@@ -15,7 +15,6 @@ · 14 unmodified lines
1515
1616 #include <asm/openprom.h>
1717 #include <asm/oplib.h>
18−#include <asm/system.h>
1918 #include <asm/ldc.h>
2019
2120 static int prom_service_exists(const char *service_name)
arch/sparc/prom/p1275.c+0−1
@@ -13,7 +13,6 @@ · 12 unmodified lines
1313
1414 #include <asm/openprom.h>
1515 #include <asm/oplib.h>
16−#include <asm/system.h>
1716 #include <asm/spitfire.h>
1817 #include <asm/pstate.h>
1918 #include <asm/ldc.h>
arch/sparc/prom/ranges.c+0−1
@@ -11,7 +11,6 @@ · 10 unmodified lines
1111 #include <asm/openprom.h>
1212 #include <asm/oplib.h>
1313 #include <asm/types.h>
14−#include <asm/system.h>
1514
1615 static struct linux_prom_ranges promlib_obio_ranges[PROMREG_MAX];
1716 static int num_obio_ranges;
drivers/tty/serial/sunhv.c+1−0
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 #include <asm/spitfire.h>
2424 #include <asm/prom.h>
2525 #include <asm/irq.h>
26+#include <asm/setup.h>
2627
2728 #if defined(CONFIG_MAGIC_SYSRQ)
2829 #define SUPPORT_SYSRQ
drivers/tty/serial/sunsab.c+1−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include <asm/io.h>
3838 #include <asm/irq.h>
3939 #include <asm/prom.h>
40+#include <asm/setup.h>
4041
4142 #if defined(CONFIG_SERIAL_SUNSAB_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
4243 #define SUPPORT_SYSRQ
drivers/tty/serial/sunsu.c+1−0
@@ -41,6 +41,7 @@ · 40 unmodified lines
4141 #include <asm/io.h>
4242 #include <asm/irq.h>
4343 #include <asm/prom.h>
44+#include <asm/setup.h>
4445
4546 #if defined(CONFIG_SERIAL_SUNSU_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
4647 #define SUPPORT_SYSRQ
drivers/tty/serial/sunzilog.c+1−0
@@ -37,6 +37,7 @@ · 36 unmodified lines
3737 #include <asm/io.h>
3838 #include <asm/irq.h>
3939 #include <asm/prom.h>
40+#include <asm/setup.h>
4041
4142 #if defined(CONFIG_SERIAL_SUNZILOG_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
4243 #define SUPPORT_SYSRQ
kernel/signal.c+1−0
@@ -36,6 +36,7 @@ · 35 unmodified lines
3636 #include <asm/uaccess.h>
3737 #include <asm/unistd.h>
3838 #include <asm/siginfo.h>
39+#include <asm/cacheflush.h>
3940 #include "audit.h" /* audit_signal_info() */
4041
4142 /*
kernel/sysctl.c+3−0
@@ -68,6 +68,9 @@ · 67 unmodified lines
6868 #include <asm/stacktrace.h>
6969 #include <asm/io.h>
7070 #endif
71+#ifdef CONFIG_SPARC
72+#include <asm/setup.h>
73+#endif
7174 #ifdef CONFIG_BSD_PROCESS_ACCT
7275 #include <linux/acct.h>
7376 #endif

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t