diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-08-18 03:07:40 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-08-21 02:40:00 -0400 |
commit | 195f7fd0a7e2b3179d52aa8ed6de3637203946c6 (patch) | |
tree | 7737c243489bed4bd23db45f3ced089ebf24a8ce /include/asm-sparc64 | |
parent | 848c4dd5153c7a0de55470ce99a8e13a63b4703f (diff) |
[SPARC64]: Need to clobber global reg vars in switch_to().
Otherwise the compiler can't see the things like the
per-cpu area base register are changing.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/asm-sparc64')
-rw-r--r-- | include/asm-sparc64/percpu.h | 4 | ||||
-rw-r--r-- | include/asm-sparc64/system.h | 26 |
2 files changed, 15 insertions, 15 deletions
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 | ||
6 | register 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 | ||
26 | register 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/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) \ |
146 | do { if (test_thread_flag(TIF_PERFCTR)) { \ | 145 | do { 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); \ |