提交 dea21982 编写于 作者: R Richard Henderson

cputlb: Replace SHIFT with DATA_SIZE

Reviewed-by: NEmilio G. Cota <cota@braap.org>
Reviewed-by: NAlex Bennée <alex.bennee@linaro.org>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
上级 b67cb68b
......@@ -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
......@@ -547,14 +547,14 @@ static bool victim_tlb_hit(CPUArchState *env, size_t mmu_idx, size_t index,
#define GETPC() ((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"
......@@ -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;
}
......@@ -311,7 +309,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);
}
......@@ -492,7 +490,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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册