diff options
-rw-r--r-- | softmmu_exec.h | 25 | ||||
-rw-r--r-- | softmmu_header.h | 2 | ||||
-rw-r--r-- | softmmu_template.h | 29 |
3 files changed, 39 insertions, 17 deletions
diff --git a/softmmu_exec.h b/softmmu_exec.h index a43e621..28d1d53 100644 --- a/softmmu_exec.h +++ b/softmmu_exec.h @@ -100,9 +100,28 @@ #undef MEMSUFFIX #endif /* (NB_MMU_MODES >= 5) */ -#if (NB_MMU_MODES > 5) -#error "NB_MMU_MODES > 5 is not supported for now" -#endif /* (NB_MMU_MODES > 5) */ +#if (NB_MMU_MODES >= 6) + +#define ACCESS_TYPE 5 +#define MEMSUFFIX MMU_MODE5_SUFFIX +#define DATA_SIZE 1 +#include "softmmu_header.h" + +#define DATA_SIZE 2 +#include "softmmu_header.h" + +#define DATA_SIZE 4 +#include "softmmu_header.h" + +#define DATA_SIZE 8 +#include "softmmu_header.h" +#undef ACCESS_TYPE +#undef MEMSUFFIX +#endif /* (NB_MMU_MODES >= 6) */ + +#if (NB_MMU_MODES > 6) +#error "NB_MMU_MODES > 6 is not supported for now" +#endif /* (NB_MMU_MODES > 6) */ /* these access are slower, they must be as rare as possible */ #define ACCESS_TYPE (NB_MMU_MODES) diff --git a/softmmu_header.h b/softmmu_header.h index 356d771..0b6082d 100644 --- a/softmmu_header.h +++ b/softmmu_header.h @@ -68,7 +68,7 @@ #if DATA_SIZE == 8 #define RES_TYPE uint64_t #else -#define RES_TYPE int +#define RES_TYPE uint32_t #endif #if ACCESS_TYPE == (NB_MMU_MODES + 1) diff --git a/softmmu_template.h b/softmmu_template.h index ab23e02..d140b8c 100644 --- a/softmmu_template.h +++ b/softmmu_template.h @@ -101,7 +101,8 @@ DATA_TYPE REGPARM glue(glue(__ld, SUFFIX), MMUSUFFIX)(target_ulong addr, DATA_TYPE res; int index; target_ulong tlb_addr; - target_phys_addr_t addend; + target_phys_addr_t ioaddr; + unsigned long addend; void *retaddr; #ifdef CONFIG_MEMCHECK_MMU int invalidate_cache = 0; @@ -118,8 +119,8 @@ DATA_TYPE REGPARM glue(glue(__ld, SUFFIX), MMUSUFFIX)(target_ulong addr, if ((addr & (DATA_SIZE - 1)) != 0) goto do_unaligned_access; retaddr = GETPC(); - addend = env->iotlb[mmu_idx][index]; - res = glue(io_read, SUFFIX)(addend, addr, retaddr); + ioaddr = env->iotlb[mmu_idx][index]; + res = glue(io_read, SUFFIX)(ioaddr, addr, retaddr); } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { /* This is not I/O access: do access verification. */ #ifdef CONFIG_MEMCHECK_MMU @@ -193,7 +194,8 @@ static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(target_ulong addr, { DATA_TYPE res, res1, res2; int index, shift; - target_phys_addr_t addend; + target_phys_addr_t ioaddr; + unsigned long addend; target_ulong tlb_addr, addr1, addr2; index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); @@ -204,9 +206,8 @@ static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(target_ulong addr, /* IO access */ if ((addr & (DATA_SIZE - 1)) != 0) goto do_unaligned_access; - retaddr = GETPC(); - addend = env->iotlb[mmu_idx][index]; - res = glue(io_read, SUFFIX)(addend, addr, retaddr); + ioaddr = env->iotlb[mmu_idx][index]; + res = glue(io_read, SUFFIX)(ioaddr, addr, retaddr); } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { do_unaligned_access: /* slow unaligned access (it spans two pages) */ @@ -275,7 +276,8 @@ void REGPARM glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr, DATA_TYPE val, int mmu_idx) { - target_phys_addr_t addend; + target_phys_addr_t ioaddr; + unsigned long addend; target_ulong tlb_addr; void *retaddr; int index; @@ -292,8 +294,8 @@ void REGPARM glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr, if ((addr & (DATA_SIZE - 1)) != 0) goto do_unaligned_access; retaddr = GETPC(); - addend = env->iotlb[mmu_idx][index]; - glue(io_write, SUFFIX)(addend, val, addr, retaddr); + ioaddr = env->iotlb[mmu_idx][index]; + glue(io_write, SUFFIX)(ioaddr, val, addr, retaddr); } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { /* This is not I/O access: do access verification. */ #ifdef CONFIG_MEMCHECK_MMU @@ -366,7 +368,8 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr, int mmu_idx, void *retaddr) { - target_phys_addr_t addend; + target_phys_addr_t ioaddr; + unsigned long addend; target_ulong tlb_addr; int index, i; @@ -378,8 +381,8 @@ static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr, /* IO access */ if ((addr & (DATA_SIZE - 1)) != 0) goto do_unaligned_access; - addend = env->iotlb[mmu_idx][index]; - glue(io_write, SUFFIX)(addend, val, addr, retaddr); + ioaddr = env->iotlb[mmu_idx][index]; + glue(io_write, SUFFIX)(ioaddr, val, addr, retaddr); } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) { do_unaligned_access: /* XXX: not efficient, but simple */ |