summaryrefslogtreecommitdiffstats
path: root/softmmu_template.h
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2012-01-02 00:32:15 +0200
committerAvi Kivity <avi@redhat.com>2012-01-04 13:34:50 +0200
commit0e0df1e24de709016c42164d9b22b981a04e4696 (patch)
tree1e5751eef8d10f4ce3ebc841062ddfee376288a3 /softmmu_template.h
parentd39e822265e56af761cc506ac45768ab8af940b4 (diff)
downloadhqemu-0e0df1e24de709016c42164d9b22b981a04e4696.zip
hqemu-0e0df1e24de709016c42164d9b22b981a04e4696.tar.gz
Convert IO_MEM_{RAM,ROM,UNASSIGNED,NOTDIRTY} to MemoryRegions
Convert the fixed-address IO_MEM_RAM, IO_MEM_ROM, IO_MEM_UNASSIGNED, and IO_MEM_NOTDIRTY io handlers to MemoryRegions. These aren't real regions, since they are never added to the memory hierarchy, but they allow reuse of the dispatch functionality. 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.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/softmmu_template.h b/softmmu_template.h
index 726744c..f105d0d 100644
--- a/softmmu_template.h
+++ b/softmmu_template.h
@@ -22,6 +22,7 @@
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#include "qemu-timer.h"
+#include "memory.h"
#define DATA_SIZE (1 << SHIFT)
@@ -65,8 +66,9 @@ static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr,
index = (physaddr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
env->mem_io_pc = (unsigned long)retaddr;
- if (index != IO_MEM_RAM && index != IO_MEM_ROM
- && index != IO_MEM_UNASSIGNED && index != IO_MEM_NOTDIRTY
+ if (index != io_mem_ram.ram_addr && index != io_mem_rom.ram_addr
+ && index != io_mem_unassigned.ram_addr
+ && index != io_mem_notdirty.ram_addr
&& !can_do_io(env)) {
cpu_io_recompile(env, retaddr);
}
@@ -208,8 +210,9 @@ static inline void glue(io_write, SUFFIX)(target_phys_addr_t physaddr,
int index;
index = (physaddr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
- if (index != IO_MEM_RAM && index != IO_MEM_ROM
- && index != IO_MEM_UNASSIGNED && index != IO_MEM_NOTDIRTY
+ if (index != io_mem_ram.ram_addr && index != io_mem_rom.ram_addr
+ && index != io_mem_unassigned.ram_addr
+ && index != io_mem_notdirty.ram_addr
&& !can_do_io(env)) {
cpu_io_recompile(env, retaddr);
}
OpenPOWER on IntegriCloud