From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N5zGW-0004a8-Dr for qemu-devel@nongnu.org; Thu, 05 Nov 2009 05:08:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N5zGT-0004Z5-Qo for qemu-devel@nongnu.org; Thu, 05 Nov 2009 05:08:27 -0500 Received: from [199.232.76.173] (port=53596 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N5zGT-0004Z0-MQ for qemu-devel@nongnu.org; Thu, 05 Nov 2009 05:08:25 -0500 Received: from mail.awax.ru ([83.69.240.5]:51557 helo=awax.ru) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N5zGT-000509-7Z for qemu-devel@nongnu.org; Thu, 05 Nov 2009 05:08:25 -0500 Received: from [83.69.227.32] (helo=asau.local) by awax.ru with esmtp (Exim 4.69 (FreeBSD)) (envelope-from ) id 1N5pl2-0000tP-4B for qemu-devel@nongnu.org; Thu, 05 Nov 2009 02:59:31 +0300 From: Aleksej Saushev Subject: Re: [Qemu-devel] [diff] BSD support (NetBSD, FreeBSD, Dragonfly) References: <87iqelzx5h.fsf@inbox.ru> Date: Thu, 05 Nov 2009 05:42:05 +0300 In-Reply-To: <87iqelzx5h.fsf@inbox.ru> (Aleksej Saushev's message of "Sun, 11 Oct 2009 20:57:14 +0400") Message-ID: <87skctpu9u.fsf@inbox.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello! Is there any progress? Anything wrong? Aleksej Saushev writes: > qemu 0.11.0 doesn't build on NetBSD out of the box, > it doesn't on FreeBSD and Dragonfly either. > > --- exec.c.orig 2009-09-23 23:01:32.000000000 +0400 > +++ exec.c 2009-09-30 14:03:55.000000000 +0400 > @@ -464,7 +464,7 @@ > exit(1); > } > } > -#elif defined(__FreeBSD__) || defined(__DragonFly__) > +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) > { > int flags; > void *addr = NULL; > --- osdep.c.orig 2009-09-23 23:01:32.000000000 +0400 > +++ osdep.c 2009-09-30 14:05:39.000000000 +0400 > @@ -110,7 +110,7 @@ > void *ptr; > > /* no need (?) for a dummy file on OpenBSD/FreeBSD */ > -#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) > +#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) > int map_anon = MAP_ANON; > #else > int map_anon = 0; > @@ -181,7 +181,7 @@ > } > size = (size + 4095) & ~4095; > ftruncate(phys_ram_fd, phys_ram_size + size); > -#endif /* !(__OpenBSD__ || __FreeBSD__ || __DragonFly__) */ > +#endif /* !(__OpenBSD__ || __FreeBSD__ || __DragonFly__ || __NetBSD__) */ > ptr = mmap(NULL, > size, > PROT_WRITE | PROT_READ, map_anon | MAP_SHARED, > --- vl.c.orig 2009-09-23 23:01:32.000000000 +0400 > +++ vl.c 2009-09-30 14:10:21.000000000 +0400 > @@ -567,7 +567,7 @@ > { > use_rt_clock = 0; > #if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \ > - || defined(__DragonFly__) > + || defined(__DragonFly__) || defined(__NetBSD__) > { > struct timespec ts; > if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0) { > @@ -580,7 +580,7 @@ > static int64_t get_clock(void) > { > #if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version >= 500000) \ > - || defined(__DragonFly__) > + || defined(__DragonFly__) || defined(__NetBSD__) > if (use_rt_clock) { > struct timespec ts; > clock_gettime(CLOCK_MONOTONIC, &ts); > --- cpu-exec.c.orig 2009-09-23 23:01:32.000000000 +0400 > +++ cpu-exec.c 2009-09-30 14:18:16.000000000 +0400 > @@ -1247,6 +1247,20 @@ > # define TRAP_sig(context) ((context)->uc_mcontext->es.trapno) > # define ERROR_sig(context) ((context)->uc_mcontext->es.err) > # define MASK_sig(context) ((context)->uc_sigmask) > +#elif defined (__NetBSD__) > +# include > + > +# define EIP_sig(context) ((context)->uc_mcontext.__gregs[_REG_EIP]) > +# define TRAP_sig(context) ((context)->uc_mcontext.__gregs[_REG_TRAPNO]) > +# define ERROR_sig(context) ((context)->uc_mcontext.__gregs[_REG_ERR]) > +# define MASK_sig(context) ((context)->uc_sigmask) > +#elif defined (__FreeBSD__) || defined(__DragonFly__) > +# include > + > +# define EIP_sig(context) (*((unsigned long*)&(context)->uc_mcontext.mc_eip)) > +# define TRAP_sig(context) ((context)->uc_mcontext.mc_trapno) > +# define ERROR_sig(context) ((context)->uc_mcontext.mc_err) > +# define MASK_sig(context) ((context)->uc_sigmask) > #elif defined(__OpenBSD__) > # define EIP_sig(context) ((context)->sc_eip) > # define TRAP_sig(context) ((context)->sc_trapno) > @@ -1263,7 +1277,9 @@ > void *puc) > { > siginfo_t *info = pinfo; > -#if defined(__OpenBSD__) > +#if defined(__NetBSD__) || defined (__FreeBSD__) || defined(__DragonFly__) > + ucontext_t *uc = puc; > +#elif defined(__OpenBSD__) > struct sigcontext *uc = puc; > #else > struct ucontext *uc = puc; -- HE CE3OH...