Re: [PATCH 13/16] ehca: firmware InfiniBand interface
From: Christoph Raisch
Date: Tue May 02 2006 - 05:29:51 EST
We started like that to get a clean interface between the register
intensive h_calls and the driver code.
We're in the middle of the tradeoff "nice interface" vs strict fencing of
data structures from one code piece to another.
Initially these functions, which only move paramaters from the stack into
registers and back, were inline functions.
So the compiler collapsed the function call into "nothing", which won't
work if you use a struct *.
Somewhen during code reviews people agreed that having this many inline
functions leads to large header files
which isn't a good idea either.
We're about to change that interface again, so what should be the max
number of parameters in a function call?
The limit in existing kernel code is somewhere between 5-8
(just as a reminder, 8 is the max nr of parameters to be passed by register
Paul Mackerras <paulus@xxxxxxxxx> wrote on 28.04.2006 00:42:14:
> Jörn Engel writes:
> > 25 parameters? If you tell me which drugs were involved in this code,
> > I know what to stay away from.
> You really need to ask the firmware architects that, since this is
> basically a single firmware call.
> Mind you, since a lot of the parameters are used to return individual
> bytes or half-words, which are then put into structures, it might be
> better to pass the pointers to the structures and let the wrapper put
> the values straight into the structures.
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/