Q powerpc new exception processing.

Sergei Organov osv at javad.ru
Tue Oct 24 12:37:48 UTC 2000


Eric Valette <valette at crf.canon.fr> writes:
> > There is another thing about NEP that I'd like to mention in context of
> > proposed transition of all PPC BSPs to NEP. Unlike OEP where exception could
> > be dispatched to different handlers by means of registering handler in the
> > table managed by common OEP code, in NEP single routine
> > (C_dispatch_irq_handler) is called. The default implementation of this routine
> > (found in 'libbsp/powerpc/shared/irq/irq.c'), however, seems to be very tied
> > to one particular architecture, so many BSPs will be forced to have their own
> > exception dispatch implementation. I believe some dispatch policy common to
> > all BSPs should be established to make transition of other BSPs to NEP easier.
>
> As the author of the code, I think it is time to jump in. My credo about
> the way Exception/Interrupt handling must be coded is :
> 	- Exception are processor dependent (CPU common),
> 	- Interrupt handling is board dependent (BSP),

Until processor is actually microcontroller that has its own PIC. In which
case interrupt handling (at least interrupts dispatching) could be considered
processor dependent.

Also, decrementer seems to be common to most (all?) of PowerPC processors,
so what's the reason to mix its handling with external interrupts that indeed
are different between processors/boards?

>
> The fact that the code is in libbsp/powerpc/shared/irq/irq.c, is that
> many motorola MVME/MCP board implement openpic (MVME2400, MCP750, ...).
> I know at least 4 different motorola board using this implementation.

And I guess there are even more boards that don't use this
implementation. After your explanations I think that the name of the file
'shared/irq/irq.c' was just misleading for me. Maybe I didn't raise the
question in the first place if it were called something like
'shared/irq/openpic/irq.c'.

> BUT THE IMPORTANT POINT IS THAT a particular BSP is *able* to implement
> its own C_dispatch_irq_handler routine...
>
> Off course we could call a function pointer like it is done on exception
> but this is a performance penalty...

But set of 'ifs' as in 'irq.c' is also a performance penalty, and I'm afraid
it could be even greater penalty. E.g., to get to decrementer exception
handler, two more levels in NEP are required: call to C_dispatch_irq_handler,
and then compare exception number with constant and branch.

Actually I believe that performance issue isn't very important here because
anyway time required for dispatch seems to be neglectable compared to the time
required to get to the point of dispatch.

>
> Does it helps understanding why I choose the current design?

Yes, it does.

But what about initial discussion about FP in NEP? Do you have something to
say about it? Is it just a bug?

BR,
Sergei Organov




More information about the users mailing list