Subject: Re: [PATCH] gcc3 compatibility and debugger support

From: Franz Sirl <[email-masked]>
Date: Tue, 25 Sep 2001 00:09:55 +0200

On Monday 24 September 2001 04:39, Paul Mackerras wrote:
> Franz Sirl writes:
> >  	current_set[smp_processor_id()] = new;
> > +#else
> > +	current_set[0] = new;
> >  #endif /* CONFIG_SMP */
>
> Yuck.  Just put the #endif before the line that sets current_set[].
> smp_processor_id() is 0 on UP.

OK, here is the updated patch.

Franz.

===== arch/ppc/kernel/process.c 1.29 vs edited =====
--- 1.29/arch/ppc/kernel/process.c	Tue Sep 18 03:19:06 2001
+++ edited/arch/ppc/kernel/process.c	Mon Sep 24 19:59:28 2001
@@ -226,8 +226,10 @@
 	if ((prev->thread.regs && (prev->thread.regs->msr & MSR_VEC)))
 		giveup_altivec(prev);
 #endif /* CONFIG_ALTIVEC */
-	current_set[smp_processor_id()] = new;
 #endif /* CONFIG_SMP */
+
+	current_set[smp_processor_id()] = new;
+
 	/* Avoid the trap.  On smp this this never happens since
 	 * we don't set last_task_used_altivec -- Cort
 	 */
===== include/asm-ppc/prom.h 1.20 vs edited =====
--- 1.20/include/asm-ppc/prom.h	Wed Aug 29 00:49:25 2001
+++ edited/include/asm-ppc/prom.h	Thu Sep  6 21:13:57 2001
@@ -106,7 +106,7 @@

 #define PTRRELOC(x)	((typeof(x))((unsigned long)(x) + offset))
 #define PTRUNRELOC(x)	((typeof(x))((unsigned long)(x) - offset))
-#define RELOC(x)	(*PTRRELOC(&(x)))
+#define RELOC(x)	(*({ typeof(x) * __ptr  = PTRRELOC(&(x)); __asm__ ("" : "=r" (__ptr) : "0" (__ptr)); __ptr;}))

 #endif /* _PPC_PROM_H */
 #endif /* __KERNEL__ */