Subject: Re: amd64 syscall.c question
To: None <email@example.com>
From: Christos Zoulas <firstname.lastname@example.org>
Date: 06/06/2007 17:03:23
In article <email@example.com>,
Blair Sadewitz <firstname.lastname@example.org> wrote:
>I posted this to tech-kern, but I meant to send it to this list as well.
>I know so little assembly that I need someone to clue me in on whether
>my concern is out in left field.
>Anyway, this is my original message:
>I'm just wondering whether or not, in
>syscall_fancy()/syscall_plain(), rval should be assigned 0 or
>frame->tf_rdx? And should child_return() set tf_rdx=0 (as it is), or
>to 1? I can't seem to find a straight answer on google (read: this is
>too new to me for me to be certain from reading the code alone).
>Just wanted to make sure there wasn't a bug lurking.
My understanding is that in 4.3 there used to be syscalls that
returned 2 values (grep _with_ /usr/src/sys/kern/syscalls.master),
and the second value used %edx on i386 (the first uses %eax). This
dual return is also used in COMPAT_LINUX. Since amd64 did not
exist circa 4.3BSD, these syscalls were never used, and there are
no other syscalls that require 2 value return currently, so there
is no need to do anything to %rdx since nobody uses it (the first
value is returned on %rax).