* [Qemu-devel] alpha - syscalls can return two values
@ 2008-11-11 20:14 Vince Weaver
2008-11-11 20:23 ` Vince Weaver
0 siblings, 1 reply; 3+ messages in thread
From: Vince Weaver @ 2008-11-11 20:14 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] alpha - syscalls can return two values
2008-11-11 20:14 [Qemu-devel] alpha - syscalls can return two values Vince Weaver
@ 2008-11-11 20:23 ` Vince Weaver
2008-11-12 21:34 ` Vince Weaver
0 siblings, 1 reply; 3+ messages in thread
From: Vince Weaver @ 2008-11-11 20:23 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] alpha - syscalls can return two values
2008-11-11 20:23 ` Vince Weaver
@ 2008-11-12 21:34 ` Vince Weaver
0 siblings, 0 replies; 3+ messages in thread
From: Vince Weaver @ 2008-11-12 21:34 UTC (permalink / raw)
To: qemu-devel
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-12 21:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-11 20:14 [Qemu-devel] alpha - syscalls can return two values Vince Weaver
2008-11-11 20:23 ` Vince Weaver
2008-11-12 21:34 ` Vince Weaver
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).