public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Love <rml@tech9.net>
To: root@chaos.analogic.com
Cc: Alex Bennee <alex@braddahead.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Why do some net drivers require __OPTIMIZE__?
Date: 06 Jan 2003 12:48:34 -0500	[thread overview]
Message-ID: <1041875313.730.16.camel@phantasy> (raw)
In-Reply-To: <Pine.LNX.3.95.1030106105330.1785B-100000@chaos.analogic.com>

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


  reply	other threads:[~2003-01-06 17:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-06 14:33 Why do some net drivers require __OPTIMIZE__? Alex Bennee
2003-01-06 15:04 ` Richard B. Johnson
2003-01-06 15:45   ` Robert Love
2003-01-06 15:56     ` Richard B. Johnson
2003-01-06 17:48       ` Robert Love [this message]
2003-01-06 15:36 ` Alan Cox
2003-01-07 14:33   ` Alex Bennee
2003-01-07 21:58     ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1041875313.730.16.camel@phantasy \
    --to=rml@tech9.net \
    --cc=alex@braddahead.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox