From 11c7ef0c737f37a487f45c6f3aa070ac7e342e3e Mon Sep 17 00:00:00 2001 From: Avi Kivity Date: Mon, 2 Jan 2012 17:21:07 +0200 Subject: Remove IO_MEM_SHIFT We no longer use any of the lower bits of a ram_addr, so we might as well use them for the io table index. This increases the number of potential I/O handlers by a factor of 8. Signed-off-by: Avi Kivity Reviewed-by: Richard Henderson --- softmmu_template.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'softmmu_template.h') diff --git a/softmmu_template.h b/softmmu_template.h index f105d0d594..97020f8185 100644 --- a/softmmu_template.h +++ b/softmmu_template.h @@ -63,7 +63,7 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr, { DATA_TYPE res; int index; - index = (physaddr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1); + index = physaddr & (IO_MEM_NB_ENTRIES - 1); physaddr = (physaddr & TARGET_PAGE_MASK) + addr; env->mem_io_pc = (unsigned long)retaddr; if (index != io_mem_ram.ram_addr && index != io_mem_rom.ram_addr @@ -208,7 +208,7 @@ static inline void glue(io_write, SUFFIX)(target_phys_addr_t physaddr, void *retaddr) { int index; - index = (physaddr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1); + index = physaddr & (IO_MEM_NB_ENTRIES - 1); physaddr = (physaddr & TARGET_PAGE_MASK) + addr; if (index != io_mem_ram.ram_addr && index != io_mem_rom.ram_addr && index != io_mem_unassigned.ram_addr -- cgit v1.2.3