On 7/26/19 8:46 AM, tony.ngu...@bt.com wrote: > No-op MEMOP_SIZE and SIZE_MEMOP macros allows us to later easily > convert memory_region_dispatch_{read|write} paramter "unsigned size" > into a size+sign+endianness encoded "MemOp op". > > Being a no-op macro, this patch does not introduce any logical change. > > Signed-off-by: Tony Nguyen <tony.ngu...@bt.com> > --- > accel/tcg/cputlb.c | 21 ++++++++++----------- > 1 file changed, 10 insertions(+), 11 deletions(-) > > diff --git a/accel/tcg/cputlb.c b/accel/tcg/cputlb.c > index 523be4c..5d88cec 100644 > --- a/accel/tcg/cputlb.c > +++ b/accel/tcg/cputlb.c > @@ -881,7 +881,7 @@ static void tlb_fill(CPUState *cpu, target_ulong addr, > int size, > > static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry *iotlbentry, > int mmu_idx, target_ulong addr, uintptr_t retaddr, > - MMUAccessType access_type, int size) > + MMUAccessType access_type, MemOp op) > { > CPUState *cpu = env_cpu(env); > hwaddr mr_offset; > @@ -906,14 +906,13 @@ static uint64_t io_readx(CPUArchState *env, > CPUIOTLBEntry *iotlbentry, > qemu_mutex_lock_iothread(); > locked = true; > } > - r = memory_region_dispatch_read(mr, mr_offset, > - &val, size, iotlbentry->attrs); > + r = memory_region_dispatch_read(mr, mr_offset, &val, op, > iotlbentry->attrs); > if (r != MEMTX_OK) { > hwaddr physaddr = mr_offset + > section->offset_within_address_space - > section->offset_within_region; > > - cpu_transaction_failed(cpu, physaddr, addr, size, access_type, > + cpu_transaction_failed(cpu, physaddr, addr, MEMOP_SIZE(op), > access_type, > mmu_idx, iotlbentry->attrs, r, retaddr); > } > if (locked) { > @@ -925,7 +924,7 @@ static uint64_t io_readx(CPUArchState *env, CPUIOTLBEntry > *iotlbentry, > > static void io_writex(CPUArchState *env, CPUIOTLBEntry *iotlbentry, > int mmu_idx, uint64_t val, target_ulong addr, > - uintptr_t retaddr, int size) > + uintptr_t retaddr, MemOp op) > { > CPUState *cpu = env_cpu(env); > hwaddr mr_offset; > @@ -947,15 +946,15 @@ static void io_writex(CPUArchState *env, CPUIOTLBEntry > *iotlbentry, > qemu_mutex_lock_iothread(); > locked = true; > } > - r = memory_region_dispatch_write(mr, mr_offset, > - val, size, iotlbentry->attrs); > + r = memory_region_dispatch_write(mr, mr_offset, val, op, > iotlbentry->attrs); > if (r != MEMTX_OK) { > hwaddr physaddr = mr_offset + > section->offset_within_address_space - > section->offset_within_region; > > - cpu_transaction_failed(cpu, physaddr, addr, size, MMU_DATA_STORE, > - mmu_idx, iotlbentry->attrs, r, retaddr); > + cpu_transaction_failed(cpu, physaddr, addr, MEMOP_SIZE(op), > + MMU_DATA_STORE, mmu_idx, iotlbentry->attrs, r, > + retaddr); > } > if (locked) { > qemu_mutex_unlock_iothread(); > @@ -1306,7 +1305,7 @@ load_helper(CPUArchState *env, target_ulong addr, > TCGMemOpIdx oi, > } > > res = io_readx(env, &env_tlb(env)->d[mmu_idx].iotlb[index], > - mmu_idx, addr, retaddr, access_type, size); > + mmu_idx, addr, retaddr, access_type, > SIZE_MEMOP(size)); > return handle_bswap(res, size, big_endian); > } > > @@ -1555,7 +1554,7 @@ store_helper(CPUArchState *env, target_ulong addr, > uint64_t val, > > io_writex(env, &env_tlb(env)->d[mmu_idx].iotlb[index], mmu_idx, > handle_bswap(val, size, big_endian), > - addr, retaddr, size); > + addr, retaddr, SIZE_MEMOP(size)); > return; > } > > -- > 1.8.3.1 > > >
Cleaner :) Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com>