Re: volatile variable

From: Robert Love
Date: Mon Aug 11 2003 - 12:14:12 EST


On Mon, 2003-08-11 at 07:06, Richard B. Johnson wrote:

> The regparm(0) atttibute tells gcc that schedule() will get any/all
> of its parameters in registers. Since schedule() receives no parameters,
> that means that, as far as gcc is concerned, it cannot modify
> anything. That said, this may be a bug or it may have been added
> to work around some gcc bug. But, nevertheless, as the declaration
> stands, schedule() will never modify anything because somebody told
> gcc it won't.

No, regparm(0) means "zero parameters in registers", so everything is to
be found on the stack.

Also, the notion of functions as compiler barriers has nothing to do
with arguments. It has to do with global variables and pointers from
who-knows-where.

All functions are compile barriers, regardless of regparm() magic or the
number of parameters, with the exception of functions with the gcc
'pure' keyword.

Also, sleep_on() is deprecated and bad. Thanks for trolling today.

Robert Love


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/