From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:59523) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMm8t-0007wn-GR for qemu-devel@nongnu.org; Fri, 12 Oct 2012 16:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TMm8s-0003EY-GJ for qemu-devel@nongnu.org; Fri, 12 Oct 2012 16:47:35 -0400 Received: from mail-da0-f45.google.com ([209.85.210.45]:55072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TMm8s-0003Dx-9t for qemu-devel@nongnu.org; Fri, 12 Oct 2012 16:47:34 -0400 Received: by mail-da0-f45.google.com with SMTP id n15so1469916dad.4 for ; Fri, 12 Oct 2012 13:47:33 -0700 (PDT) Sender: Richard Henderson Message-ID: <507881E2.3070201@twiddle.net> Date: Fri, 12 Oct 2012 13:47:30 -0700 From: Richard Henderson MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] [PATCH 0/5] linux-user: refactor do_syscall() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: riku.voipio@linaro.org Cc: qemu-devel@nongnu.org On 10/12/2012 11:24 AM, riku.voipio@linaro.org wrote: > From: Riku Voipio > > 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. My only concern is leaving the host-to-target conversion to do_syscall. I think the return value from do_foo should be the proper target return value. My concern here are those handful of syscalls for which we have target-specific error reporting mechanisms, and for which those reporting mechanisms are exploited in some nefarious way. E.g. sigprocmask and getpriority. r~