On Tue, May 17, 2011 at 5:52 PM, Peter Maydell <peter.mayd...@linaro.org> wrote: > On 14 May 2011 20:36, Blue Swirl <blauwir...@gmail.com> 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.