[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing vector number (was Re: API modification request)



Leon Pollak <leonp at plris.com> writes:
> On Tuesday 04 February 2003 13:49, Sergei Organov wrote:
> > Eric Valette <eric.valette at free.fr> writes:
> > > Besides, looking at the code when I changed the irq API, nobody was
> > > actually using this vector...
> > Please keep in mind that unfortunately you don't see all the code. There
> > could be proprietary code that relies on features you change...
> Ooops, here is the case...:-))
> Our code uses vector number to determine the SCCx number caused the interrupt 
> in our MPC860 based system (there is one ISR for all SCC's).
> But there may be a casting used to solve the issue, no?

You mean in case if void* will be passed? Passing vector number instead could
indeed be achieved by casting then, but intended (and IMHO better) way is to
pass a pointer to a structure containing all required information for
processing of given SCC (including the SCC number if required). For example,
the structure could also contain a pointer to BDs table in case of SCCx.
Instead of finding the data at every interrupt using vector number it's more
efficient to find the data at the time of ISR installation and then pass the
ready-to-use pointer to ISR.

BR,
Sergei.