From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:35186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMQE7-0006JE-0C for qemu-devel@nongnu.org; Tue, 17 May 2011 15:46:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QMQE6-0002rp-1p for qemu-devel@nongnu.org; Tue, 17 May 2011 15:46:42 -0400 Received: from mail-qy0-f180.google.com ([209.85.216.180]:54772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QMQE5-0002ri-Vt for qemu-devel@nongnu.org; Tue, 17 May 2011 15:46:42 -0400 Received: by qyk10 with SMTP id 10so506922qyk.4 for ; Tue, 17 May 2011 12:46:41 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: From: Blue Swirl Date: Tue, 17 May 2011 22:46:21 +0300 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH 01/11] Move user emulator stuff from cpu-exec.c to user-exec.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: qemu-devel On Tue, May 17, 2011 at 5:52 PM, Peter Maydell wrote: > On 14 May 2011 20:36, Blue Swirl wrote: > >> +#if defined(__i386__) > >> +#elif defined(__x86_64__) > >> +#elif defined(_ARCH_PPC) > >> +#elif defined(__alpha__) > >> +#elif defined(__sparc__) > >> +#elif defined(__arm__) > >> +#elif defined(__mc68000) > >> +#elif defined(__ia64) > >> +#elif defined(__s390__) > >> +#elif defined(__mips__) > >> +#elif defined(__hppa__) > > ...if we're moving this code about anyway would it be possible > to split the per-host-arch specific code out into separate files? > I find these source files with enormous ifdef ladders pretty hard > to read. There are two problems which the #ifdeffery tackles: how to get PC from signal state (OS dependent, also arch dependent) and how to determine whether the access was a write (arch dependent). Splitting by arch would not help much, but would it make sense to split by OS and push the pieces to each user emulator? The arch dependent but OS independent stuff for is_write could be moved to some common .h file.