Rename io_mem_xxx() to old_io_mem_xxx()
This renames io_mem_write() and io_mem_read() to old_io_mem_write()
and old_io_mem_read(), respectively. This is required to make room
for the new io_mem_xxx() functions from the new unified memory API
that will be integrated in the future.
Change-Id: Ic65d3f6e433b7e8080d12f1a61f9e601086c62c3
diff --git a/exec.c b/exec.c
index 558cb41..adca9e0 100644
--- a/exec.c
+++ b/exec.c
@@ -1950,17 +1950,17 @@
if (l >= 4 && ((addr1 & 3) == 0)) {
/* 32 bit write access */
val = ldl_p(buf8);
- io_mem_write(io_index, addr1, val, 4);
+ old_io_mem_write(io_index, addr1, val, 4);
l = 4;
} else if (l >= 2 && ((addr1 & 1) == 0)) {
/* 16 bit write access */
val = lduw_p(buf8);
- io_mem_write(io_index, addr1, val, 2);
+ old_io_mem_write(io_index, addr1, val, 2);
l = 2;
} else {
/* 8 bit write access */
val = ldub_p(buf8);
- io_mem_write(io_index, addr1, val, 1);
+ old_io_mem_write(io_index, addr1, val, 1);
l = 1;
}
} else {
@@ -1981,17 +1981,17 @@
addr1 = (addr & ~TARGET_PAGE_MASK) + p->region_offset;
if (l >= 4 && ((addr1 & 3) == 0)) {
/* 32 bit read access */
- val = io_mem_read(io_index, addr1, 4);
+ val = old_io_mem_read(io_index, addr1, 4);
stl_p(buf8, val);
l = 4;
} else if (l >= 2 && ((addr1 & 1) == 0)) {
/* 16 bit read access */
- val = io_mem_read(io_index, addr1, 2);
+ val = old_io_mem_read(io_index, addr1, 2);
stw_p(buf8, val);
l = 2;
} else {
/* 8 bit read access */
- val = io_mem_read(io_index, addr1, 1);
+ val = old_io_mem_read(io_index, addr1, 1);
stb_p(buf8, val);
l = 1;
}
@@ -2210,7 +2210,7 @@
io_index = (pd >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
if (p)
addr = (addr & ~TARGET_PAGE_MASK) + p->region_offset;
- val = io_mem_read(io_index, addr, 4);
+ val = old_io_mem_read(io_index, addr, 4);
#if defined(TARGET_WORDS_BIGENDIAN)
if (endian == DEVICE_LITTLE_ENDIAN) {
val = bswap32(val);
@@ -2281,11 +2281,11 @@
/* XXX This is broken when device endian != cpu endian.
Fix and add "endian" variable check */
#ifdef TARGET_WORDS_BIGENDIAN
- val = (uint64_t)io_mem_read(io_index, addr, 4) << 32;
- val |= io_mem_read(io_index, addr + 4, 4);
+ val = (uint64_t)old_io_mem_read(io_index, addr, 4) << 32;
+ val |= old_io_mem_read(io_index, addr + 4, 4);
#else
- val = io_mem_read(io_index, addr, 4);
- val |= (uint64_t)io_mem_read(io_index, addr + 4, 4) << 32;
+ val = old_io_mem_read(io_index, addr, 4);
+ val |= (uint64_t)old_io_mem_read(io_index, addr + 4, 4) << 32;
#endif
} else {
/* RAM case */
@@ -2352,7 +2352,7 @@
io_index = (pd >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
if (p)
addr = (addr & ~TARGET_PAGE_MASK) + p->region_offset;
- val = io_mem_read(io_index, addr, 2);
+ val = old_io_mem_read(io_index, addr, 2);
#if defined(TARGET_WORDS_BIGENDIAN)
if (endian == DEVICE_LITTLE_ENDIAN) {
val = bswap16(val);
@@ -2417,7 +2417,7 @@
io_index = (pd >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
if (p)
addr = (addr & ~TARGET_PAGE_MASK) + p->region_offset;
- io_mem_write(io_index, addr, val, 4);
+ old_io_mem_write(io_index, addr, val, 4);
} else {
unsigned long addr1 = (pd & TARGET_PAGE_MASK) + (addr & ~TARGET_PAGE_MASK);
ptr = qemu_get_ram_ptr(addr1);
@@ -2455,11 +2455,11 @@
if (p)
addr = (addr & ~TARGET_PAGE_MASK) + p->region_offset;
#ifdef TARGET_WORDS_BIGENDIAN
- io_mem_write(io_index, addr, val >> 32, 4);
- io_mem_write(io_index, addr + 4, val, 4);
+ old_io_mem_write(io_index, addr, val >> 32, 4);
+ old_io_mem_write(io_index, addr + 4, val, 4);
#else
- io_mem_write(io_index, addr, val, 4);
- io_mem_write(io_index, addr + 4, val >> 32, 4);
+ old_io_mem_write(io_index, addr, val, 4);
+ old_io_mem_write(io_index, addr + 4, val >> 32, 4);
#endif
} else {
ptr = qemu_get_ram_ptr(pd & TARGET_PAGE_MASK) +
@@ -2497,7 +2497,7 @@
val = bswap32(val);
}
#endif
- io_mem_write(io_index, addr, val, 4);
+ old_io_mem_write(io_index, addr, val, 4);
} else {
unsigned long addr1;
addr1 = (pd & TARGET_PAGE_MASK) + (addr & ~TARGET_PAGE_MASK);
@@ -2569,7 +2569,7 @@
val = bswap16(val);
}
#endif
- io_mem_write(io_index, addr, val, 2);
+ old_io_mem_write(io_index, addr, val, 2);
} else {
unsigned long addr1;
addr1 = (pd & TARGET_PAGE_MASK) + (addr & ~TARGET_PAGE_MASK);
diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 9b83c0c..a7e7fbb 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -350,8 +350,8 @@
void phys_mem_set_alloc(void *(*alloc)(size_t));
-uint64_t io_mem_read(int index, hwaddr addr, unsigned size);
-void io_mem_write(int index, hwaddr addr, uint64_t value, unsigned size);
+uint64_t old_io_mem_read(int index, hwaddr addr, unsigned size);
+void old_io_mem_write(int index, hwaddr addr, uint64_t value, unsigned size);
extern CPUWriteMemoryFunc *_io_mem_write[IO_MEM_NB_ENTRIES][4];
extern CPUReadMemoryFunc *_io_mem_read[IO_MEM_NB_ENTRIES][4];
diff --git a/include/exec/softmmu_template.h b/include/exec/softmmu_template.h
index 9249486..3ad02bd 100644
--- a/include/exec/softmmu_template.h
+++ b/include/exec/softmmu_template.h
@@ -128,14 +128,14 @@
cpu->mem_io_vaddr = addr;
#if SHIFT <= 2
- val = io_mem_read(index, physaddr, 1 << SHIFT);
+ val = old_io_mem_read(index, physaddr, 1 << SHIFT);
#else
#ifdef TARGET_WORDS_BIGENDIAN
- val = (uint64_t)io_mem_read(index, physaddr, 4) << 32;
- val |= io_mem_read(index, physaddr + 4, 4);
+ val = (uint64_t)old_io_mem_read(index, physaddr, 4) << 32;
+ val |= old_io_mem_read(index, physaddr + 4, 4);
#else
- val = io_mem_read(index, physaddr, 4);
- val |= (uint64_t)io_mem_read(index, physaddr + 4, 4) << 32;
+ val = old_io_mem_read(index, physaddr, 4);
+ val |= (uint64_t)old_io_mem_read(index, physaddr + 4, 4) << 32;
#endif
#endif /* SHIFT > 2 */
return val;
@@ -345,14 +345,14 @@
cpu->mem_io_vaddr = addr;
cpu->mem_io_pc = retaddr;
#if SHIFT <= 2
- io_mem_write(index, physaddr, val, 1 << SHIFT);
+ old_io_mem_write(index, physaddr, val, 1 << SHIFT);
#else
#ifdef TARGET_WORDS_BIGENDIAN
- io_mem_write(index, physaddr, val >> 32, 4);
- io_mem_write(index, physaddr + 4, val, 4);
+ old_io_mem_write(index, physaddr, val >> 32, 4);
+ old_io_mem_write(index, physaddr + 4, val, 4);
#else
- io_mem_write(index, physaddr, val, 4);
- io_mem_write(index, physaddr + 4, val >> 32, 4);
+ old_io_mem_write(index, physaddr, val, 4);
+ old_io_mem_write(index, physaddr + 4, val >> 32, 4);
#endif
#endif /* SHIFT > 2 */
}
diff --git a/memory-android.c b/memory-android.c
index 777f6e5..37734fb 100644
--- a/memory-android.c
+++ b/memory-android.c
@@ -2,13 +2,13 @@
#include "exec/exec-all.h"
#include "qemu/host-utils.h"
-uint64_t io_mem_read(int io_index, hwaddr addr, unsigned size)
+uint64_t old_io_mem_read(int io_index, hwaddr addr, unsigned size)
{
return _io_mem_read[io_index][ctzl(size)](io_mem_opaque[io_index],
addr);
}
-void io_mem_write(int io_index, hwaddr addr,
+void old_io_mem_write(int io_index, hwaddr addr,
uint64_t val, unsigned size)
{
_io_mem_write[io_index][ctzl(size)](io_mem_opaque[io_index],