aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-08-28 01:56:11 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-28 01:56:11 -0400
commit35438c4327df18dbf5e7f597b69299119f4a14de (patch)
treea4589d731015db93f2eba8f84ffb1f48a8084020 /include/asm-sparc64
parent2f6c9d961081dc7b109eb19166244bcb2a5dfc28 (diff)
parentb07d68b5ca4d55a16fab223d63d5fb36f89ff42f (diff)
Merge branch 'linux-2.6' into for-2.6.24
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r--include/asm-sparc64/elf.h10
-rw-r--r--include/asm-sparc64/percpu.h4
-rw-r--r--include/asm-sparc64/sfp-machine.h2
-rw-r--r--include/asm-sparc64/system.h26
4 files changed, 25 insertions, 17 deletions
diff --git a/include/asm-sparc64/elf.h b/include/asm-sparc64/elf.h
index 303d85e2f82e..8653e8665009 100644
--- a/include/asm-sparc64/elf.h
+++ b/include/asm-sparc64/elf.h
@@ -70,6 +70,7 @@
70#define HWCAP_SPARC_V9 16 70#define HWCAP_SPARC_V9 16
71#define HWCAP_SPARC_ULTRA3 32 71#define HWCAP_SPARC_ULTRA3 32
72#define HWCAP_SPARC_BLKINIT 64 72#define HWCAP_SPARC_BLKINIT 64
73#define HWCAP_SPARC_N2 128
73 74
74/* 75/*
75 * These are used to set parameters in the core dumps. 76 * These are used to set parameters in the core dumps.
@@ -155,8 +156,13 @@ static inline unsigned int sparc64_elf_hwcap(void)
155 156
156 if (tlb_type == cheetah || tlb_type == cheetah_plus) 157 if (tlb_type == cheetah || tlb_type == cheetah_plus)
157 cap |= HWCAP_SPARC_ULTRA3; 158 cap |= HWCAP_SPARC_ULTRA3;
158 else if (tlb_type == hypervisor) 159 else if (tlb_type == hypervisor) {
159 cap |= HWCAP_SPARC_BLKINIT; 160 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA1 ||
161 sun4v_chip_type == SUN4V_CHIP_NIAGARA2)
162 cap |= HWCAP_SPARC_BLKINIT;
163 if (sun4v_chip_type == SUN4V_CHIP_NIAGARA2)
164 cap |= HWCAP_SPARC_N2;
165 }
160 166
161 return cap; 167 return cap;
162} 168}
diff --git a/include/asm-sparc64/percpu.h b/include/asm-sparc64/percpu.h
index caf8750792ff..a1f53a4da405 100644
--- a/include/asm-sparc64/percpu.h
+++ b/include/asm-sparc64/percpu.h
@@ -3,6 +3,8 @@
3 3
4#include <linux/compiler.h> 4#include <linux/compiler.h>
5 5
6register unsigned long __local_per_cpu_offset asm("g5");
7
6#ifdef CONFIG_SMP 8#ifdef CONFIG_SMP
7 9
8#define setup_per_cpu_areas() do { } while (0) 10#define setup_per_cpu_areas() do { } while (0)
@@ -23,8 +25,6 @@ extern unsigned long __per_cpu_shift;
23 __typeof__(type) per_cpu__##name \ 25 __typeof__(type) per_cpu__##name \
24 ____cacheline_aligned_in_smp 26 ____cacheline_aligned_in_smp
25 27
26register unsigned long __local_per_cpu_offset asm("g5");
27
28/* var is in discarded region: offset to particular copy we want */ 28/* var is in discarded region: offset to particular copy we want */
29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu))) 29#define per_cpu(var, cpu) (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset(cpu)))
30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset)) 30#define __get_cpu_var(var) (*RELOC_HIDE(&per_cpu__##var, __local_per_cpu_offset))
diff --git a/include/asm-sparc64/sfp-machine.h b/include/asm-sparc64/sfp-machine.h
index 89d42431efb5..c9331b02d9c8 100644
--- a/include/asm-sparc64/sfp-machine.h
+++ b/include/asm-sparc64/sfp-machine.h
@@ -88,4 +88,6 @@
88 88
89#define FP_INHIBIT_RESULTS ((current_thread_info()->xfsr[0] >> 23) & _fex) 89#define FP_INHIBIT_RESULTS ((current_thread_info()->xfsr[0] >> 23) & _fex)
90 90
91#define FP_TRAPPING_EXCEPTIONS ((current_thread_info()->xfsr[0] >> 23) & 0x1f)
92
91#endif 93#endif
diff --git a/include/asm-sparc64/system.h b/include/asm-sparc64/system.h
index 64891cb10f05..3f175fa7e6d2 100644
--- a/include/asm-sparc64/system.h
+++ b/include/asm-sparc64/system.h
@@ -141,7 +141,6 @@ do { \
141 * not preserve it's value. Hairy, but it lets us remove 2 loads 141 * not preserve it's value. Hairy, but it lets us remove 2 loads
142 * and 2 stores in this critical code path. -DaveM 142 * and 2 stores in this critical code path. -DaveM
143 */ 143 */
144#define EXTRA_CLOBBER ,"%l1"
145#define switch_to(prev, next, last) \ 144#define switch_to(prev, next, last) \
146do { if (test_thread_flag(TIF_PERFCTR)) { \ 145do { if (test_thread_flag(TIF_PERFCTR)) { \
147 unsigned long __tmp; \ 146 unsigned long __tmp; \
@@ -164,33 +163,34 @@ do { if (test_thread_flag(TIF_PERFCTR)) { \
164 "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \ 163 "stx %%i6, [%%sp + 2047 + 0x70]\n\t" \
165 "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \ 164 "stx %%i7, [%%sp + 2047 + 0x78]\n\t" \
166 "rdpr %%wstate, %%o5\n\t" \ 165 "rdpr %%wstate, %%o5\n\t" \
167 "stx %%o6, [%%g6 + %3]\n\t" \ 166 "stx %%o6, [%%g6 + %6]\n\t" \
168 "stb %%o5, [%%g6 + %2]\n\t" \
169 "rdpr %%cwp, %%o5\n\t" \
170 "stb %%o5, [%%g6 + %5]\n\t" \ 167 "stb %%o5, [%%g6 + %5]\n\t" \
171 "mov %1, %%g6\n\t" \ 168 "rdpr %%cwp, %%o5\n\t" \
172 "ldub [%1 + %5], %%g1\n\t" \ 169 "stb %%o5, [%%g6 + %8]\n\t" \
170 "mov %4, %%g6\n\t" \
171 "ldub [%4 + %8], %%g1\n\t" \
173 "wrpr %%g1, %%cwp\n\t" \ 172 "wrpr %%g1, %%cwp\n\t" \
174 "ldx [%%g6 + %3], %%o6\n\t" \ 173 "ldx [%%g6 + %6], %%o6\n\t" \
175 "ldub [%%g6 + %2], %%o5\n\t" \ 174 "ldub [%%g6 + %5], %%o5\n\t" \
176 "ldub [%%g6 + %4], %%o7\n\t" \ 175 "ldub [%%g6 + %7], %%o7\n\t" \
177 "wrpr %%o5, 0x0, %%wstate\n\t" \ 176 "wrpr %%o5, 0x0, %%wstate\n\t" \
178 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \ 177 "ldx [%%sp + 2047 + 0x70], %%i6\n\t" \
179 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \ 178 "ldx [%%sp + 2047 + 0x78], %%i7\n\t" \
180 "ldx [%%g6 + %6], %%g4\n\t" \ 179 "ldx [%%g6 + %9], %%g4\n\t" \
181 "brz,pt %%o7, 1f\n\t" \ 180 "brz,pt %%o7, 1f\n\t" \
182 " mov %%g7, %0\n\t" \ 181 " mov %%g7, %0\n\t" \
183 "b,a ret_from_syscall\n\t" \ 182 "b,a ret_from_syscall\n\t" \
184 "1:\n\t" \ 183 "1:\n\t" \
185 : "=&r" (last) \ 184 : "=&r" (last), "=r" (current), "=r" (current_thread_info_reg), \
185 "=r" (__local_per_cpu_offset) \
186 : "0" (task_thread_info(next)), \ 186 : "0" (task_thread_info(next)), \
187 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \ 187 "i" (TI_WSTATE), "i" (TI_KSP), "i" (TI_NEW_CHILD), \
188 "i" (TI_CWP), "i" (TI_TASK) \ 188 "i" (TI_CWP), "i" (TI_TASK) \
189 : "cc", \ 189 : "cc", \
190 "g1", "g2", "g3", "g7", \ 190 "g1", "g2", "g3", "g7", \
191 "l2", "l3", "l4", "l5", "l6", "l7", \ 191 "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
192 "i0", "i1", "i2", "i3", "i4", "i5", \ 192 "i0", "i1", "i2", "i3", "i4", "i5", \
193 "o0", "o1", "o2", "o3", "o4", "o5", "o7" EXTRA_CLOBBER);\ 193 "o0", "o1", "o2", "o3", "o4", "o5", "o7"); \
194 /* If you fuck with this, update ret_from_syscall code too. */ \ 194 /* If you fuck with this, update ret_from_syscall code too. */ \
195 if (test_thread_flag(TIF_PERFCTR)) { \ 195 if (test_thread_flag(TIF_PERFCTR)) { \
196 write_pcr(current_thread_info()->pcr_reg); \ 196 write_pcr(current_thread_info()->pcr_reg); \