From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiPG8-0007fd-3V for qemu-devel@nongnu.org; Tue, 11 Dec 2012 07:48:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TiPFy-0004Zx-7W for qemu-devel@nongnu.org; Tue, 11 Dec 2012 07:48:28 -0500 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:57000) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TiPFx-0004Zh-Vb for qemu-devel@nongnu.org; Tue, 11 Dec 2012 07:48:18 -0500 Received: from /spool/local by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 11 Dec 2012 12:47:52 -0000 Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id qBBCm6e043253788 for ; Tue, 11 Dec 2012 12:48:06 GMT Received: from d06av05.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id qBBCmDjo004000 for ; Tue, 11 Dec 2012 05:48:13 -0700 Date: Tue, 11 Dec 2012 13:48:10 +0100 From: Cornelia Huck Message-ID: <20121211134810.1a36d4b5@BR9GNB5Z> In-Reply-To: References: <1354884626-15060-1-git-send-email-cornelia.huck@de.ibm.com> <1354884626-15060-3-git-send-email-cornelia.huck@de.ibm.com> <413896B0-480D-4113-99FC-6432847ADD9F@suse.de> <20121210111834.42d25bcb@BR9GNB5Z> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/8] s390: Channel I/O basic defintions. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: linux-s390 , Anthony Liguori , KVM , Gleb Natapov , Carsten Otte , Sebastian Ott , Marcelo Tosatti , Heiko Carstens , qemu-devel , Christian Borntraeger , Martin Schwidefsky On Tue, 11 Dec 2012 11:27:05 +0100 Alexander Graf wrote: > > On 10.12.2012, at 11:18, Cornelia Huck wrote: > > > On Mon, 10 Dec 2012 09:07:57 +0100 > > Alexander Graf wrote: > > > >> > >> On 07.12.2012, at 13:50, Cornelia Huck wrote: > >> > >>> Basic channel I/O structures and helper function. > >>> > >>> Signed-off-by: Cornelia Huck > >>> --- > >>> target-s390x/Makefile.objs | 2 +- > >>> target-s390x/ioinst.c | 46 ++++++++++ > >>> target-s390x/ioinst.h | 207 +++++++++++++++++++++++++++++++++++++++++++++ > >>> 3 files changed, 254 insertions(+), 1 deletion(-) > >>> create mode 100644 target-s390x/ioinst.c > >>> create mode 100644 target-s390x/ioinst.h > >>> > >>> diff --git a/target-s390x/Makefile.objs b/target-s390x/Makefile.objs > >>> index e728abf..3afb0b7 100644 > >>> --- a/target-s390x/Makefile.objs > >>> +++ b/target-s390x/Makefile.objs > >>> @@ -1,4 +1,4 @@ > >>> obj-y += translate.o helper.o cpu.o interrupt.o > >>> obj-y += int_helper.o fpu_helper.o cc_helper.o mem_helper.o misc_helper.o > >>> -obj-$(CONFIG_SOFTMMU) += machine.o > >>> +obj-$(CONFIG_SOFTMMU) += machine.o ioinst.o > >>> obj-$(CONFIG_KVM) += kvm.o > >>> diff --git a/target-s390x/ioinst.c b/target-s390x/ioinst.c > >>> new file mode 100644 > >>> index 0000000..8577b2c > >>> --- /dev/null > >>> +++ b/target-s390x/ioinst.c > >>> @@ -0,0 +1,46 @@ > >>> +/* > >>> + * I/O instructions for S/390 > >>> + * > >>> + * Copyright 2012 IBM Corp. > >>> + * Author(s): Cornelia Huck > >>> + * > >>> + * This work is licensed under the terms of the GNU GPL, version 2 or (at > >>> + * your option) any later version. See the COPYING file in the top-level > >>> + * directory. > >>> + */ > >>> + > >>> +#include > >>> +#include > >>> +#include > >>> + > >>> +#include "cpu.h" > >>> +#include "ioinst.h" > >>> + > >>> +#ifdef DEBUG_IOINST > >>> +#define dprintf(fmt, ...) \ > >>> + do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) > >>> +#else > >>> +#define dprintf(fmt, ...) \ > >>> + do { } while (0) > >>> +#endif > >>> + > >>> +int ioinst_disassemble_sch_ident(uint32_t value, int *m, int *cssid, int *ssid, > >>> + int *schid) > >>> +{ > >>> + if (!(value & IOINST_SCHID_ONE)) { > >>> + return -EINVAL; > >>> + } > >>> + if (!(value & IOINST_SCHID_M)) { > >>> + if (value & IOINST_SCHID_CSSID) { > >>> + return -EINVAL; > >>> + } > >>> + *cssid = 0; > >>> + *m = 0; > >>> + } else { > >>> + *cssid = (value & IOINST_SCHID_CSSID) >> 24; > >> > >> (value & IOINST_SCHID_CSSID_MASK) >> IOINST_SCHID_CSSID_SHIFT > > > > I think that actually decreases readability. > > I'm fine with doing it Jocelyn-style too: > > #define IOINST_SCHID_CSSID(x) ((x & 0x...) >> 24) > > if you prefer that for readability :) It's worth a try.