> When you call a function, that function gets a copy of the
> parameters passed to it. In-line code accesses those parameters
> directly. That's why the spin-lock code, for instance, won't work
> (with the current macros) unless they are in-lined.
Huh?
void dog(int i)
{
i++;
}
main()
{
int x = 1;
dog(x);
}
Are you saying x will be 2 after the call? _Wrong_
Macros, yes. Inlines, no.
Inline functions have the same behavior as callable functions, with a
few exceptions (they do not act as compiler barriers, for one).
The spin lock C functions will work fine if they are not inlined, as far
as I can tell. If not, it is just because the inline assembly assumes
they are inline (i.e. what certain registers contain, etc.).
The macros, of course, will need trivial adjustments to use pointers
instead of copies, etc.
Again, the only reason inline vs. not will break anything, as far as I
can tell, is because inline asm assumes a function is inlined.
Robert Love
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/