Re: i386 asm tutorial [was Re: copy_from_user() fix]

Jamie Lokier (jamie@imbolc.ucc.ie)
Mon, 31 Aug 1998 02:37:26 +0100


Andrea Arcangeli wrote:
> >> + : "=&c"(size) \
> >> ^ This is needed because we use string operation that
> >> autoread/autowrite ecx?
> >
> >Yes. The "&" means %ecx can't be used as an input operand or part of
> >one (e.g. memory address), though it is probably redundant in this case.
>
> The author said me that the & means that the result of the asm code has
> to be put in size.

No, the "=" means that. Well to be precise, it means GCC should copy
the output of the asm code into `size' if it needs it.

According to the GCC documentation... "&" means it's an earlyclobber
register, meaning it can be clobbered before all the inputs have been
consumed.

Personally I would have declared "ecx" in the list of clobbered
registers and not had any output operands at all. Conceptually, the
code doesn't output anything. Does that work, or are there
GCCisms/EGCSisms I don't know about?

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html