Subject: Re: Odd code in sys/amd64/amd64/syscall.c
To: David Laight <david@l8s.co.uk>
From: Andrew Doran <ad@netbsd.org>
List: port-amd64
Date: 10/28/2007 00:20:31
On Sat, Oct 27, 2007 at 08:08:48PM +0100, David Laight wrote:

> Browsing through the kernel code I spotted the following snippet in
> the syscall return path for amd64:
> 
>         switch (error) {
>         case 0:
>                 frame->tf_rax = rval[0];
> #ifndef COMPAT_LINUX
>                 frame->tf_rdx = rval[1];
> #endif
>                 frame->tf_rflags &= ~PSL_C;     /* carry bit */
>                 break;
> 
> The code always passes rval[0] back out to userland in %rax,
> and passes out rval[1] in %rdx unless COMPAT_LINUX is defined!

It looks like syscall.c used to be included by linux_syscall.c.

Andrew