summaryrefslogtreecommitdiff
path: root/softmmu_template.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-01-02 17:21:07 +0200
committerAvi Kivity <avi@redhat.com>2012-01-04 13:34:50 +0200
commit11c7ef0c737f37a487f45c6f3aa070ac7e342e3e (patch)
tree6d751394e2d0e18889e95ba1df102c95106fc76c /softmmu_template.h
parent75c578dcaae48f239fc87b545022efa8fa13f455 (diff)
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 <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
Diffstat (limited to 'softmmu_template.h')
-rw-r--r--softmmu_template.h4
1 files changed, 2 insertions, 2 deletions
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