Re: Q: Linux system calls and calling conventions

Matthew Wilcox (Matthew.Wilcox@genedata.com)
Thu, 11 Nov 1999 03:36:08 +0100


On Wed, Nov 10, 1999 at 08:18:21PM -0500, Chris Wing wrote:
> This works at least on the Intel; old programs pass 16-bit values into the
> 32-bit registers in a sensible way, and new programs can pass 32-bit UIDs
> and GIDs to the same calls.
>
> However, someone pointed out to me in an email that this may not
> necessarily be true on other platforms. So, my question is:
>
> - or rather, will my assumption not work on one or more non-i386
> architectures?

Your assumption holds on ARM and PA-RISC. They both take their arguments
in registers. Take a look in include/asm-*/unistd.h, this is where
the architecture defines how to make a system call. On the Alpha,
for example, it casts all arguments to long first, so I'm guessing your
assumption is true there too.

-- 
Matthew Wilcox <willy@bofh.ai>
"Windows and MacOS are products, contrived by engineers in the service of
specific companies. Unix, by contrast, is not so much a product as it is a
painstakingly compiled oral history of the hacker subculture." - N Stephenson

- 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.tux.org/lkml/