tech-kern archive

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

Re: static functions are your friends (Was GPIO revisited)



On Sun, Aug 09, 2009 at 08:38:31PM +0200, Marc Balmer wrote:
> ddb's trace command should produce the function name.

I think it's obvious that it can't when the function has been
inlined. This is not something that can be fixed in ddb,
it's a gcc feature which can be disabled, this is what __noinline is
for. 
The problem with __noinline is that it's gcc-specific. As some peoples
compiles NetBSD with a compiler which is not gcc, this has to be encapsulated
in a macro so the __noinline can be easily removed when not supported
(or not needed).

Making the symbol global also prevents gcc from inlining the function.
But this is a side effect of the current GNU toolchain implementation,
I don't think it's safe to rely on this side effect to prevent
inlining where we don't want it.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index