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 on ppc) christoph raisch Paul Mackerras <[EMAIL PROTECTED]> 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. > > Paul. _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
