ppc multlibs and BSP removal was Re: powerpc altivec support

Sergei Organov osv at topconrd.ru
Fri Feb 11 16:07:05 UTC 2005


"Joel Sherrill <joel at OARcorp.com>" <joel.sherrill at OARcorp.com> writes:
> Could you submit a patch for the issues you comment on in this email?
> If it is for a BSP you can't test, I am happy if you will make a good
> faith attempt with a desk check and it compiles.

Well, below is the patch for _CPU_Install_interrupt_stack() in the
old exception processing.

As for the r2/r13 loading by the new exception processing code, sorry,
but I leave it as an exercise for those who believe new exception
processing is better than the old one. Let them change at least 5
separate files with almost identical code. Well, if somebody believes
something is inherently broken with such an approach to the software
development, ask Eric Valette about it, or just read what he answered to
a similar question before:

<http://www.rtems.com/rtems/maillistArchives/rtems-users/2002/november/msg00167.html>

Besides, when I've raised that same question (r2/r13 loading in ISR)
before, I've been told that it's not a problem as all the code in the
executable must be strictly EABI/SYSV ABI compatible, and if some code
is not, it should be fixed anyway. Though the question how to find and
identify a piece of code that is not compatible has been left
unanswered.

Overall, this code has been intentionally removed from the new exception
processing code and I don't feel myself in charge of returning it back.

If you use new exception processing, better make sure no code in your
executable tries to change r2/r13 even temporarily while interrupts are
enabled. I prefer to be on the safe side, so I stay with the old one for
now.

-- 
Sergei.

Index: c/src/lib/libbsp/powerpc/support/old_exception_processing/cpu.c
===================================================================
RCS file: /usr1/CVS/rtems/c/src/lib/libbsp/powerpc/support/old_exception_processing/cpu.c,v
retrieving revision 1.15
diff -u -r1.15 cpu.c
--- c/src/lib/libbsp/powerpc/support/old_exception_processing/cpu.c	20 Oct 2004 08:25:35 -0000	1.15
+++ c/src/lib/libbsp/powerpc/support/old_exception_processing/cpu.c	11 Feb 2005 15:30:40 -0000
@@ -356,11 +357,9 @@
 
 void _CPU_Install_interrupt_stack( void )
 {
-#if (PPC_ABI == PPC_ABI_POWEROPEN || PPC_ABI == PPC_ABI_GCC27)
-  _CPU_IRQ_info.Stack = _CPU_Interrupt_stack_high - 56;
-#else
-  _CPU_IRQ_info.Stack = _CPU_Interrupt_stack_high - 8;
-#endif
+  _CPU_IRQ_info.Stack = (void*)(((unsigned32)_CPU_Interrupt_stack_high
+    & ~(PPC_STACK_ALIGNMENT-1)) - CPU_MINIMUM_STACK_FRAME_SIZE);
+  *(unsigned32*)(_CPU_IRQ_info.Stack) = 0;
 }
 
 /* Handle a spurious interrupt */




More information about the users mailing list