Ticker problem on ppc405 - FIXED

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Tue Oct 19 17:45:04 UTC 2004


Hi,

just an small, but important bit:

I think things shoudl read "PPC_USE_SPRG", not 
"PPC_USE_SPGR". Is this a typo only in this mail? 
The long name for SPRG is "special purpose register 
general".

Thomas.


> Joel Sherrill <joel at OARcorp.com> wrote, On 10/19/2004 7:08 AM:
> 
> > Smith, Gene wrote:
> > 
> >>Figure out what the problem is but not why or how to correctly fix it. 
> >>The problem was due statements like this for selecting code:
> >>
> >>#if (PPC_USE_SPRG)
> >>    do this way
> >>#else
> >>    do that way
> >>#end
> >>
> >>In file old_exception_processing/cpu.c "do that way" is selected, while
> >>in old_exception_processing/irq_stub.S "do this way" is selected. The 
> >>conflict resulted in some bad memory accesses.  I don't see anywhere 
> >>that PPC_USE_SPRG is explicitly defined in the code except under 
> >>build-rtems there is a automatically generated file bspopts.h that contains
> >>#define PPC_USE_SPRG 1
> >>But the file that (I think) controls this, bspopts.h.in, contains
> >>#undef PPC_USE_SPRG
> >>
> >>The kluge fix was to just add
> >>#define PPC_USE_SPRG 0
> >>in irq_stub.S so both files generate "do that way" code.
> >>
> >>Anyhow, ticker now runs.
> > 
> > 
> > Ralf.. how is this happening?  This is one of those
> > macros from the BSP's configure.ac.  bspopts.h should
> > have it as a 1 if I am reading the configure code correctly.
> > 
> > Gene.. the installed bspopts.h has it undef'ed?
> > Where does the cpu.c get its define?
> 
> cpu.c is seeing it undefined (or zero?) as I would have expected. 
> irq_stub.S see it defined (non-zero?). (FWIW, the selectors are "#if x" 
> not "#ifdef x".)
> 
> On my system I see
> 
> #define PPC_USE_SPGR 1
> 
> in the /opt/rtems-4.6 and /build-rtems areas for the file bspopts.h for 
> all powerpc/*40x bsp's including mine which is a hybrid of gen405 and 
> helas403.
> 
> As a non-kluge solution I just went ahead and defined PPC_USE_SPGR as 1 in
> cpukit/score/cpu/powerpc/rtems/score/ppc.h
> which made it defined as 1 in both cpu.c and irq_stub.S. There was a 
> warning in the code about use of SPGR messing up some debuggers but it 
> seem to work ok for me when enabled
> -gene
> 
> > 
> > --joel
> 

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_keys.htm




More information about the users mailing list