RE: [RFQ] New driver architecture questions

From: James Bottomley
Date: Fri May 15 2009 - 12:04:27 EST


On Fri, 2009-05-15 at 08:56 -0600, Mukker, Atul wrote:
> >>
> > >> Perhaps this is a bad example? It seems like the "common layer"
> > >> sections that are "cross-OS" shouldn't contain any Linux specific code
> > at all.
> > >
> > > I think the implication is that the cross-OS parts are coded, as it
> > > happens, in the linux coding style, using linux functions, but then a
> > > Windows layer maps these to Windows specific functions.
> >
> > Correct.
> >
> > Jeff
> >
> >
> >
> [Atul] I think we are close, for example, memcpy API in the stack is
> osi_memcpy(), which translates to memcpy() on Linux and
> ScsiPortMoveMemory() on windows.

So what we really don't want to see in Linux drivers is the particular
name you've chosen for your glue layer API (like osi_mempy). The way
you get around this is to run a macro substituter over the HIM before
you put it in the kernel, so the API logic all appears to be linux
specific, even though it's translated from your generic HIM. This adds
a bit of a burden sometimes in patching because you have to translate
back to the HIM to apply the patch, but this can be largely automated.

James


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/