From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjS8u-0004d1-PQ for qemu-devel@nongnu.org; Mon, 12 Sep 2016 10:23:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjS8n-00008k-K9 for qemu-devel@nongnu.org; Mon, 12 Sep 2016 10:23:27 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:37963) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjS8n-00008Y-DP for qemu-devel@nongnu.org; Mon, 12 Sep 2016 10:23:21 -0400 Received: by mail-wm0-f46.google.com with SMTP id 1so147764580wmz.1 for ; Mon, 12 Sep 2016 07:23:21 -0700 (PDT) References: <1472935202-3342-1-git-send-email-rth@twiddle.net> <1472935202-3342-9-git-send-email-rth@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <1472935202-3342-9-git-send-email-rth@twiddle.net> Date: Mon, 12 Sep 2016 15:22:19 +0100 Message-ID: <87r38pw63o.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v3 08/34] cputlb: Replace SHIFT with DATA_SIZE List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org Richard Henderson writes: > Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée > --- > cputlb.c | 16 ++++++++-------- > softmmu_template.h | 7 ++----- > 2 files changed, 10 insertions(+), 13 deletions(-) > > diff --git a/cputlb.c b/cputlb.c > index d068ee5..cf68211 100644 > --- a/cputlb.c > +++ b/cputlb.c > @@ -529,16 +529,16 @@ static bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index, > > #define MMUSUFFIX _mmu > > -#define SHIFT 0 > +#define DATA_SIZE 1 > #include "softmmu_template.h" > > -#define SHIFT 1 > +#define DATA_SIZE 2 > #include "softmmu_template.h" > > -#define SHIFT 2 > +#define DATA_SIZE 4 > #include "softmmu_template.h" > > -#define SHIFT 3 > +#define DATA_SIZE 8 > #include "softmmu_template.h" > #undef MMUSUFFIX > > @@ -549,14 +549,14 @@ static bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index, > #define GETRA() ((uintptr_t)0) > #define SOFTMMU_CODE_ACCESS > > -#define SHIFT 0 > +#define DATA_SIZE 1 > #include "softmmu_template.h" > > -#define SHIFT 1 > +#define DATA_SIZE 2 > #include "softmmu_template.h" > > -#define SHIFT 2 > +#define DATA_SIZE 4 > #include "softmmu_template.h" > > -#define SHIFT 3 > +#define DATA_SIZE 8 > #include "softmmu_template.h" > diff --git a/softmmu_template.h b/softmmu_template.h > index 284ab2c..3c56df1 100644 > --- a/softmmu_template.h > +++ b/softmmu_template.h > @@ -25,8 +25,6 @@ > #include "exec/address-spaces.h" > #include "exec/memory.h" > > -#define DATA_SIZE (1 << SHIFT) > - > #if DATA_SIZE == 8 > #define SUFFIX q > #define LSUFFIX q > @@ -134,7 +132,7 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(CPUArchState *env, > } > > cpu->mem_io_vaddr = addr; > - memory_region_dispatch_read(mr, physaddr, &val, 1 << SHIFT, > + memory_region_dispatch_read(mr, physaddr, &val, DATA_SIZE, > iotlbentry->attrs); > return val; > } > @@ -321,7 +319,7 @@ static inline void glue(io_write, SUFFIX)(CPUArchState *env, > > cpu->mem_io_vaddr = addr; > cpu->mem_io_pc = retaddr; > - memory_region_dispatch_write(mr, physaddr, val, 1 << SHIFT, > + memory_region_dispatch_write(mr, physaddr, val, DATA_SIZE, > iotlbentry->attrs); > } > > @@ -512,7 +510,6 @@ void probe_write(CPUArchState *env, target_ulong addr, int mmu_idx, > #endif /* !defined(SOFTMMU_CODE_ACCESS) */ > > #undef READ_ACCESS_TYPE > -#undef SHIFT > #undef DATA_TYPE > #undef SUFFIX > #undef LSUFFIX -- Alex Bennée