Re: RFC: avoid asmlinkage on x86 traps/interrupts

From: Andrea Arcangeli
Date: Wed Nov 03 2004 - 21:27:19 EST


On Wed, Nov 03, 2004 at 07:19:59AM -0800, Linus Torvalds wrote:
>
>
> On Wed, 3 Nov 2004, Andrea Arcangeli wrote:
> >
> > I guess it'd be nicer to simply move the output into the input with "a",
> > "d", "b", and the not add any output at all, and put "eax/edx" back into
> > the clobbers.
>
> Ehh.. You aren't allowed to clobber inputs. Try it with any modern version
> of gcc.

Didn't know about that, thanks.

I wonder why they don't forbid it completely then. I mean, what's magic
about an input parmeter here? Clobbers are about the internals of
the asm (they've nothing to do about the setup before the asm runs, and
the input only has to do with the prepartion, so clobbers and input
seems fully orthogonal concepts to me). The only reason clobber exists
is to avoid you to declare a worthless local variable, clobbers are
strictly needed only for "cc" and "memory" (or any other piece of cpu not
reachable via the output operands). So I believe they should allow
general purpose register clobbers always or never, I don't see why
there's this special case. Maybe for robustness to force people to
write a more verbose version like you had to do for this reason? No idea.
-
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/