Re: Syscall changes registers beyond %eax, on linux-i386

From: Richard Henderson (
Date: Thu Sep 19 2002 - 13:57:47 EST

On Thu, Sep 19, 2002 at 02:51:44PM -0400, Brian Gerst wrote:
> > The parameter area belongs to the callee, and it may *always* be modified.
> The parameters can not be modified if they are declared const though,
> that's my point.

Yes they can.

        extern void bar(int x, int y, int z);
        void foo(const int a, const int b, const int c)
          bar(a+1, b+1, c+1);

        subl $12, %esp
        movl 20(%esp), %eax
        incl %eax
        movl %eax, 20(%esp)
        movl 16(%esp), %eax
        incl %eax
        incl 24(%esp)
        movl %eax, 16(%esp)
        addl $12, %esp
        jmp bar

(Not sure why gcc doesn't use incl on all three memories, nor
should it allocate that stack frame...)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:27 EST