From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48728) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxyLH-0006Nz-9C for qemu-devel@nongnu.org; Fri, 20 Jun 2014 08:54:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxyLG-0008Fo-4J for qemu-devel@nongnu.org; Fri, 20 Jun 2014 08:54:55 -0400 Received: from [2001:4b98:dc0:45:216:3eff:fe3d:166f] (port=35671 helo=afflict.kos.to) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxyLF-0008FV-V9 for qemu-devel@nongnu.org; Fri, 20 Jun 2014 08:54:54 -0400 Date: Fri, 20 Jun 2014 15:54:51 +0300 From: Riku Voipio Message-ID: <20140620125451.GA18051@afflict.kos.to> References: <1402849113-11402-1-git-send-email-paul@archlinuxmips.org> <1402849113-11402-12-git-send-email-paul@archlinuxmips.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1402849113-11402-12-git-send-email-paul@archlinuxmips.org> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 11/16] linux-user: support ioprio_{get, set} syscalls List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Burton Cc: Riku Voipio , qemu-devel@nongnu.org On Sun, Jun 15, 2014 at 05:18:28PM +0100, Paul Burton wrote: > Add support for the ioprio_get & ioprio_set syscalls, allowing their > use by target programs. >=20 > Signed-off-by: Paul Burton > --- > linux-user/syscall.c | 18 ++++++++++++++++++ > 1 file changed, 18 insertions(+) >=20 > diff --git a/linux-user/syscall.c b/linux-user/syscall.c > index 0830205..c7f176a 100644 > --- a/linux-user/syscall.c > +++ b/linux-user/syscall.c > @@ -252,6 +252,12 @@ _syscall2(int, capget, struct __user_cap_header_st= ruct *, header, > struct __user_cap_data_struct *, data); > _syscall2(int, capset, struct __user_cap_header_struct *, header, > struct __user_cap_data_struct *, data); > +#ifdef __NR_ioprio_get > +_syscall2(int, ioprio_get, int, which, int, who) > +#endif > +#ifdef __NR_ioprio_set > +_syscall3(int, ioprio_set, int, which, int, who, int, ioprio) > +#endif Since this is only used if both host and guest, thes needs to be protected by both TARGET_NR_ioprio_get and __NR_ioprio_get. Else we get compile error on some targets: qemu/linux-user/syscall.c:256:16: error: =E2=80=98ioprio_get=E2=80=99 def= ined but not used [-Werror=3Dunused-function] _syscall2(int, ioprio_get, int, which, int, who) ^ qemu/linux-user/syscall.c:147:13: note: in definition of macro =E2=80=98_= syscall2=E2=80=99 static type name (type1 arg1,type2 arg2) \ ^ > static bitmask_transtbl fcntl_flags_tbl[] =3D { > { TARGET_O_ACCMODE, TARGET_O_WRONLY, O_ACCMODE, O_WRONLY, = }, > @@ -9460,6 +9466,18 @@ abi_long do_syscall(void *cpu_env, int num, abi_= long arg1, > break; > #endif > =20 > +#if defined(TARGET_NR_ioprio_get) && defined(__NR_ioprio_get) > + case TARGET_NR_ioprio_get: > + ret =3D get_errno(ioprio_get(arg1, arg2)); > + break; > +#endif > + > +#if defined(TARGET_NR_ioprio_set) && defined(__NR_ioprio_set) > + case TARGET_NR_ioprio_set: > + ret =3D get_errno(ioprio_set(arg1, arg2, arg3)); > + break; > +#endif > + > default: > unimplemented: > gemu_log("qemu: Unsupported syscall: %d\n", num); > --=20 > 2.0.0 >=20