aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/mm/init.c3
-rw-r--r--include/asm-sparc64/percpu.h4
-rw-r--r--include/asm-sparc64/system.h26
3 files changed, 17 insertions, 16 deletions
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c
index c13e6cd279ac..a1bef07755a9 100644
--- a/arch/sparc/mm/init.c
+++ b/arch/sparc/mm/init.c
@@ -206,7 +206,8 @@ unsigned long __init bootmem_init(unsigned long *pages_avail)
206#ifdef CONFIG_BLK_DEV_INITRD 206#ifdef CONFIG_BLK_DEV_INITRD
207 /* Now have to check initial ramdisk, so that bootmap does not overwrite it */ 207 /* Now have to check initial ramdisk, so that bootmap does not overwrite it */
208 if (sparc_ramdisk_image) { 208 if (sparc_ramdisk_image) {
209 sparc_ramdisk_image -= KERNBASE; 209 if (sparc_ramdisk_image >= (unsigned long)&_end - 2 * PAGE_SIZE)
210 sparc_ramdisk_image -= KERNBASE;
210 initrd_start = sparc_ramdisk_image + phys_base; 211 initrd_start = sparc_ramdisk_image + phys_base;
211 initrd_end = initrd_start + sparc_ramdisk_size; 212 initrd_end = initrd_start + sparc_ramdisk_size;
212 if (initrd_end > end_of_phys_memory) { 213 if (initrd_end > end_of_phys_memory) {
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/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); \