lkml.org 
[lkml]   [2003]   [Jan]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Why do some net drivers require __OPTIMIZE__?
From
Date
On Mon, 2003-01-06 at 10:56, Richard B. Johnson wrote:

> 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/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.041 / U:5.284 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site