A couple of BSP questions

Till Straumann strauman at slac.stanford.edu
Wed May 14 22:34:42 UTC 2008


Michael Hamel wrote:
> Hi,
>
> I am making progress with a PPC405EX BSP and am trying to move code  
> into a generic libcpu/powerpc/ppc4xx directory, but I'm not sure how  
> to organise it. I have conditional sections that need to know whether  
> a PPC405EX/EXr or a GP/GPr/CR is in use (e.g DCR values). 
Can't these be made run-time tests?
> The libcpu  
> code therefore needs to see a definition somewhere from the BSP, e.g  
> PPC4XX_SUBTYPE that selects between these options. This could come  
> from bsp.h, or it could go into the CPU_CFLAGS options in the .cfg  
> file, which I see is what the virtex BSP does. I'm not sure what would  
> be best practice?
>
> Second, I see that in ppc_exc_bspsupp.h, interrupt handlers are  
> defined as:
>
> typedef int (*ppc_exc_handler_t)(BSP_Exception_frame *f, unsigned int  
> vector);
>
> What value should they return in the int?
>   
They should return 0 if the exception has been 'handled'
and execution can be resumed normally. If they return
a negative value then the situation is escalated to the
'global' exception handler.

E.g., the handler dealing with external interrupts returns 0.

If your handler discovers a situation it can remedy it should
return 0, if it can't it returns -1 resulting in a panic
and register dump.

(I just added a comment explaining this to ppc_exc_bspsupp.h)

HTH + Thanks for the reminder...
-- Till
>
> Regards,
> ---
> "Not *another* shrubbery!"
>
> Michael Hamel
> ADInstruments Ltd, Dunedin, NZ
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>   




More information about the users mailing list