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

GUPA (Grand Unified PCI API)

Joel Sherrill writes:
 > Till Straumann wrote:
 > > 
 > > While playing with the pc386 BSP (normally, I am a PPC person)
 > > I came across yet another unpleasant fact. It seems that there
 > > exist two flavors of accessing PCI config space with different
 > > APIs :-(. Hence the PCI device drivers in libchip are not
 > > portable across x86/ppc.
 > > It would certainly be nice to have a common API for PCI access.
 > Surely this can be agreed upon. :)
 > What is different between the two?  
 > And I would lean to adopting the PPC one since it would be easier
 > to propagate the PPC version to x86 than vice-versa.  There are
 > WAY more PPC BSPs to be touched.

Its a difference in the parameters used to identify the bus and card.
The functions correspond but the different parameters lead to #ifdefs-
annoying to be sure.  I'd lean towards the ppc one as well.  The
dec21140 driver clearly illustrates the issue... ;)

I don't think turning the x86 calls into macros will do it, but it
might be possible to turn the x86 calls into wrapper functions on top
of the ppc functions as the bus and card notation has a couple
standard variations and its possible to translate between them.