linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] gcc3 compatibility and debugger support
       [not found] <200109061932.OAA12306@lists.linuxppc.org>
@ 2001-09-07 14:44 ` Kaoru Fukui
  2001-09-24  2:39 ` Paul Mackerras
  1 sibling, 0 replies; 3+ messages in thread
From: Kaoru Fukui @ 2001-09-07 14:44 UTC (permalink / raw)
  To: Franz Sirl; +Cc: linuxppc-dev


Great Franz!

I could rebuild working kernel(2.4 devel) with gcc-3.0.2 pre

Thanks
Kaoru

From: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
To: linuxppc-commit@source.mvista.com, linuxppc-dev@lists.linuxppc.org
Subject: [PATCH] gcc3 compatibility and debugger support
Date: Thu, 6 Sep 2001 21:32:59 +0200

> Hi,
>
> this patch fixes up the RELOC macro (which relies on implentation defined
> things in C), so it's possible again to boot a gcc3 compiled kernel. The
> patch guards the problematic code with a NOP inline asm, preventing the
> problematic (but legal) gcc3 optimization.
> The second part makes sure that the current task ends up in a known memory
> location even for UP. This helps JTAG/BDM debuggers a lot (it's very
> expensive to stop CPU/peek CPU reg/restart CPU).
>
> The patch is against 2_4. In 2_4_devel the gcc3 workaround in prom.c can
be
> removed too.
>
> Franz.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gcc3 compatibility and debugger support
       [not found] <200109061932.OAA12306@lists.linuxppc.org>
  2001-09-07 14:44 ` [PATCH] gcc3 compatibility and debugger support Kaoru Fukui
@ 2001-09-24  2:39 ` Paul Mackerras
  2001-09-24 22:09   ` Franz Sirl
  1 sibling, 1 reply; 3+ messages in thread
From: Paul Mackerras @ 2001-09-24  2:39 UTC (permalink / raw)
  To: Franz Sirl; +Cc: linuxppc-commit, linuxppc-dev


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.

Paul.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gcc3 compatibility and debugger support
  2001-09-24  2:39 ` Paul Mackerras
@ 2001-09-24 22:09   ` Franz Sirl
  0 siblings, 0 replies; 3+ messages in thread
From: Franz Sirl @ 2001-09-24 22:09 UTC (permalink / raw)
  To: paulus; +Cc: linuxppc-commit, linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

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.


[-- Attachment #2: bk-misc1a.diff --]
[-- Type: text/plain, Size: 1058 bytes --]

===== 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__ */

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-09-24 22:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200109061932.OAA12306@lists.linuxppc.org>
2001-09-07 14:44 ` [PATCH] gcc3 compatibility and debugger support Kaoru Fukui
2001-09-24  2:39 ` Paul Mackerras
2001-09-24 22:09   ` Franz Sirl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).