qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC] [PATCH 0/5] linux-user: refactor do_syscall()
@ 2012-10-12 18:24 riku.voipio
  2012-10-12 18:24 ` [Qemu-devel] [PATCH 1/5] linux-user: move exit to own function riku.voipio
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: riku.voipio @ 2012-10-12 18:24 UTC (permalink / raw)
  To: qemu-devel; +Cc: Riku Voipio

From: Riku Voipio <riku.voipio@linaro.org>

Currently linux-user handles system calls with a 3000+ line switch/case construct
in do_syscall(). Some syscalls are implemented inline in the switch/case, others
as separate functions, and the rest as mix of both.

As the first step of the cleanup, I'd like to move implementation of each syscall
completely to their own functions. While at it, we define more standard interface between
do_syscall() and the functions implementing the system calls: system call functions take
parameter as raw abi_long, and leave the host to target errno conversion to do_syscall.

Once all syscall are converted to separate functions, we can convert to switch/case to
a table with syscall structs pointing to syscall implementation as well the strace definitions
currently in strace.list.

Before I proceed to convert all 300+ syscalls implemented, I'd like to hear if people think
it is a good idea, or if you have some improvements to suggest. To see how it would look in
practice, here are the first five syscalls cleaned up.

Riku Voipio (5):
  linux-user: move exit to own function
  linux-user: move read to own function
  linux-user: move write to own function
  linux-user: complete do_open function isolation
  linux-user: do_openat wrapper added

 linux-user/syscall.c |  182 +++++++++++++++++++++++++++++---------------------
 1 file changed, 106 insertions(+), 76 deletions(-)

-- 
1.7.9.5

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-10-13 10:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-12 18:24 [Qemu-devel] [RFC] [PATCH 0/5] linux-user: refactor do_syscall() riku.voipio
2012-10-12 18:24 ` [Qemu-devel] [PATCH 1/5] linux-user: move exit to own function riku.voipio
2012-10-12 18:24 ` [Qemu-devel] [PATCH 2/5] linux-user: move read " riku.voipio
2012-10-12 18:24 ` [Qemu-devel] [PATCH 3/5] linux-user: move write " riku.voipio
2012-10-12 18:24 ` [Qemu-devel] [PATCH 4/5] linux-user: complete do_open function isolation riku.voipio
2012-10-12 18:24 ` [Qemu-devel] [PATCH 5/5] linux-user: do_openat wrapper added riku.voipio
2012-10-12 20:47 ` [Qemu-devel] [RFC] [PATCH 0/5] linux-user: refactor do_syscall() Richard Henderson
2012-10-13 10:30   ` Peter Maydell
2012-10-13 10:09 ` Blue Swirl

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).