Re: [PATCH 2/3] x86: Pass in pt_regs pointer for syscalls that needit

From: H. Peter Anvin
Date: Wed Feb 11 2009 - 12:53:16 EST


Brian Gerst wrote:
> /*
> + * For syscalls that need a pointer to the pt_regs struct (ie. fork).
> + * The regs pointer is passed in %eax as the first argument. The
> + * remaining function arguments remain on the stack.
> + */
> +#define ptregscall __attribute__((regparm(1)))

I was looking a few weeks ago (still a work in progress, but I'm pretty
close to having something working) at getting rid of asmlinkage and try
to get everything onto regparm(3). Adding yet another calling
convention seems to be a step in the wrong direction -- especially since
regparm(1) and (2) are unlikely to have been well exercised and
therefore are likely to attract gcc bugs.

That does *not* mean in any way that I disapprove of the concept of
accessing pt_regs via a pointer... quite on the contrary, I think it's
the only sane thing to do. I would like to see it done without adding
calling conventions, and preferrably killing some off.

-hpa

--
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/