From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MeSJe-0002WA-5I for qemu-devel@nongnu.org; Fri, 21 Aug 2009 07:29:54 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MeSJY-0002N5-I1 for qemu-devel@nongnu.org; Fri, 21 Aug 2009 07:29:52 -0400 Received: from [199.232.76.173] (port=38045 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MeSJY-0002Mh-Ab for qemu-devel@nongnu.org; Fri, 21 Aug 2009 07:29:48 -0400 Received: from mail-yw0-f195.google.com ([209.85.211.195]:38470) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MeSJX-0008BE-Gh for qemu-devel@nongnu.org; Fri, 21 Aug 2009 07:29:47 -0400 Received: by ywh33 with SMTP id 33so823863ywh.18 for ; Fri, 21 Aug 2009 04:29:46 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <2544cbe008bf325372291aa6eea38d98892d4a13.1250193231.git.riku.voipio@iki.fi> References: <2544cbe008bf325372291aa6eea38d98892d4a13.1250193231.git.riku.voipio@iki.fi> Date: Fri, 21 Aug 2009 14:29:46 +0300 Message-ID: Subject: Re: [Qemu-devel] [PATCH 01/11] linux-user: add eventfd support From: "Kirill A. Shutemov" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: riku.voipio@iki.fi Cc: qemu-devel@nongnu.org On Thu, Aug 13, 2009 at 11:06 PM, wrote: > From: Riku Voipio > > Straightforward implementation. This syscall is rare enough that we > don't need to support the odder cases, just disable it if host glibc > is too old. > > Signed-off-by: Riku Voipio > --- > =C2=A0configure =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A0 18 ++++= ++++++++++++++ > =C2=A0linux-user/syscall.c | =C2=A0 13 +++++++++++++ > =C2=A02 files changed, 31 insertions(+), 0 deletions(-) > > diff --git a/configure b/configure > index 0b2c721..c52f1cf 100755 > --- a/configure > +++ b/configure > @@ -1345,6 +1345,21 @@ if compile_prog "" "" ; then > =C2=A0 splice=3Dyes > =C2=A0fi > > +# check if eventfd is supported > +eventfd=3Dno > +cat > $TMPC << EOF > +#include > + > +int main(void) > +{ > + =C2=A0 =C2=A0int efd =3D eventfd(0, 0); > + =C2=A0 =C2=A0return 0; > +} > +EOF > +if compile_prog "" "" ; then > + =C2=A0eventfd=3Dyes > +fi > + > =C2=A0# Check if tools are available to build documentation. > =C2=A0if test "$build_docs" =3D "yes" -a \( ! -x "`which texi2html 2>/dev= /null`" -o ! -x "`which pod2man 2>/dev/null`" \) ; then > =C2=A0 build_docs=3D"no" > @@ -1684,6 +1699,9 @@ fi > =C2=A0if test "$splice" =3D "yes" ; then > =C2=A0 echo "CONFIG_SPLICE=3Dy" >> $config_host_mak > =C2=A0fi > +if test "$eventfd" =3D "yes" ; then > + =C2=A0echo "CONFIG_EVENTFD=3Dy" >> $config_host_mak > +fi > =C2=A0if test "$inotify" =3D "yes" ; then > =C2=A0 echo "CONFIG_INOTIFY=3Dy" >> $config_host_mak > =C2=A0fi > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 673eed4..3b1ed60 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -6974,6 +6974,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_lo= ng arg1, > =C2=A0 =C2=A0 =C2=A0 =C2=A0 break; > =C2=A0#endif > =C2=A0#endif /* CONFIG_SPLICE */ > +#ifdef CONFIG_EVENTFD > +#include I don't think that #include within function is a good idea. > +#if defined(TARGET_NR_eventfd) > + =C2=A0 =C2=A0case TARGET_NR_eventfd: > + =C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D get_errno(eventfd(arg1, 0)); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0break; > +#endif > +#if defined(TARGET_NR_eventfd2) > + =C2=A0 =C2=A0case TARGET_NR_eventfd2: > + =C2=A0 =C2=A0 =C2=A0 =C2=A0ret =3D get_errno(eventfd(arg1, arg2)); > + =C2=A0 =C2=A0 =C2=A0 =C2=A0break; > +#endif > +#endif /* CONFIG_EVENTFD =C2=A0*/ > =C2=A0 =C2=A0 default: > =C2=A0 =C2=A0 unimplemented: > =C2=A0 =C2=A0 =C2=A0 =C2=A0 gemu_log("qemu: Unsupported syscall: %d\n", n= um); > -- > 1.6.2.1 > > > >