alpha - syscalls can return two values
Hello
On the Alpha architecture, system calls can return two values, one in register $0 and one in register $1. This is unusual, so there is no mechanism I can see in linux-user/syscall.c for handling this properly.
What would be the best way to handle this?
This is needed to implement the getxuid and getxgid syscalls. Without these, the spec2k perlbmk fails to run.
Vince
and as soon as I sent this, I realized I was reading the code wrong.
It doesn't return the second result in $1, but rather it returns the second result on the stack at offset 80.
This remains a problem though, as I don't think there's an easy way to get the stack pointer from the syscall code.
The relevant linux-kernel syscall code can be found in
./arch/alpha/kernel/entry.S
specifically the getxuid, getxgid, getxpid, syscalls.
Vince
and to keep correcting myself, it seems like the Alpha multi-value return syscalls do not in fact use the stack at all.
I'm just posting this to clear up what I posted earlier.
What happens is:
normal return value goes into $v0 (as always)
errno is put into $a3 (as always)
secondary return value is placed into $a4.
I have a patch that implements this that I'll send in a separate e-mail.
Vince