blob: 4b33aef5f026eb974681e4b1deafe00659c5b8be [file] [log] [blame]
bellardb92e5a22003-08-08 23:58:05 +00001/*
2 * Software MMU support
ths5fafdf22007-09-16 21:08:06 +00003 *
bellardb92e5a22003-08-08 23:58:05 +00004 * Copyright (c) 2003 Fabrice Bellard
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
aurel32fad6cb12009-01-04 22:05:52 +000018 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
bellardb92e5a22003-08-08 23:58:05 +000019 */
20#define DATA_SIZE (1 << SHIFT)
21
22#if DATA_SIZE == 8
23#define SUFFIX q
bellard61382a52003-10-27 21:22:23 +000024#define USUFFIX q
bellardb92e5a22003-08-08 23:58:05 +000025#define DATA_TYPE uint64_t
26#elif DATA_SIZE == 4
27#define SUFFIX l
bellard61382a52003-10-27 21:22:23 +000028#define USUFFIX l
bellardb92e5a22003-08-08 23:58:05 +000029#define DATA_TYPE uint32_t
30#elif DATA_SIZE == 2
31#define SUFFIX w
bellard61382a52003-10-27 21:22:23 +000032#define USUFFIX uw
bellardb92e5a22003-08-08 23:58:05 +000033#define DATA_TYPE uint16_t
34#elif DATA_SIZE == 1
35#define SUFFIX b
bellard61382a52003-10-27 21:22:23 +000036#define USUFFIX ub
bellardb92e5a22003-08-08 23:58:05 +000037#define DATA_TYPE uint8_t
38#else
39#error unsupported data size
40#endif
41
bellardb769d8f2004-10-03 15:07:13 +000042#ifdef SOFTMMU_CODE_ACCESS
43#define READ_ACCESS_TYPE 2
bellard84b7b8e2005-11-28 21:19:04 +000044#define ADDR_READ addr_code
bellardb769d8f2004-10-03 15:07:13 +000045#else
46#define READ_ACCESS_TYPE 0
bellard84b7b8e2005-11-28 21:19:04 +000047#define ADDR_READ addr_read
bellardb769d8f2004-10-03 15:07:13 +000048#endif
49
ths5fafdf22007-09-16 21:08:06 +000050static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(target_ulong addr,
j_mayer6ebbf392007-10-14 07:07:08 +000051 int mmu_idx,
bellard61382a52003-10-27 21:22:23 +000052 void *retaddr);
ths5fafdf22007-09-16 21:08:06 +000053static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr,
pbrook2e70f6e2008-06-29 01:03:05 +000054 target_ulong addr,
55 void *retaddr)
bellardb92e5a22003-08-08 23:58:05 +000056{
57 DATA_TYPE res;
58 int index;
pbrook0f459d12008-06-09 00:20:13 +000059 index = (physaddr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
60 physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
pbrook2e70f6e2008-06-29 01:03:05 +000061 env->mem_io_pc = (unsigned long)retaddr;
62 if (index > (IO_MEM_NOTDIRTY >> IO_MEM_SHIFT)
63 && !can_do_io(env)) {
64 cpu_io_recompile(env, retaddr);
65 }
bellardb92e5a22003-08-08 23:58:05 +000066
aliguoridb8886d2008-11-18 20:09:43 +000067 env->mem_io_vaddr = addr;
bellardb92e5a22003-08-08 23:58:05 +000068#if SHIFT <= 2
bellarda4193c82004-06-03 14:01:43 +000069 res = io_mem_read[index][SHIFT](io_mem_opaque[index], physaddr);
bellardb92e5a22003-08-08 23:58:05 +000070#else
71#ifdef TARGET_WORDS_BIGENDIAN
bellarda4193c82004-06-03 14:01:43 +000072 res = (uint64_t)io_mem_read[index][2](io_mem_opaque[index], physaddr) << 32;
73 res |= io_mem_read[index][2](io_mem_opaque[index], physaddr + 4);
bellardb92e5a22003-08-08 23:58:05 +000074#else
bellarda4193c82004-06-03 14:01:43 +000075 res = io_mem_read[index][2](io_mem_opaque[index], physaddr);
76 res |= (uint64_t)io_mem_read[index][2](io_mem_opaque[index], physaddr + 4) << 32;
bellardb92e5a22003-08-08 23:58:05 +000077#endif
78#endif /* SHIFT > 2 */
blueswir1640f42e2009-04-19 10:18:01 +000079#ifdef CONFIG_KQEMU
bellardf1c85672006-02-08 22:41:53 +000080 env->last_io_time = cpu_get_time_fast();
81#endif
bellardb92e5a22003-08-08 23:58:05 +000082 return res;
83}
84
bellardb92e5a22003-08-08 23:58:05 +000085/* handle all cases except unaligned access which span two pages */
bellardd6564692008-01-31 09:22:27 +000086DATA_TYPE REGPARM glue(glue(__ld, SUFFIX), MMUSUFFIX)(target_ulong addr,
87 int mmu_idx)
bellardb92e5a22003-08-08 23:58:05 +000088{
89 DATA_TYPE res;
bellard61382a52003-10-27 21:22:23 +000090 int index;
bellardc27004e2005-01-03 23:35:10 +000091 target_ulong tlb_addr;
pbrook0f459d12008-06-09 00:20:13 +000092 target_phys_addr_t addend;
bellardb92e5a22003-08-08 23:58:05 +000093 void *retaddr;
ths3b46e622007-09-17 08:09:54 +000094
bellardb92e5a22003-08-08 23:58:05 +000095 /* test if there is match for unaligned or IO access */
96 /* XXX: could done more in memory macro in a non portable way */
bellardb92e5a22003-08-08 23:58:05 +000097 index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
98 redo:
j_mayer6ebbf392007-10-14 07:07:08 +000099 tlb_addr = env->tlb_table[mmu_idx][index].ADDR_READ;
bellardb92e5a22003-08-08 23:58:05 +0000100 if ((addr & TARGET_PAGE_MASK) == (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {
bellardb92e5a22003-08-08 23:58:05 +0000101 if (tlb_addr & ~TARGET_PAGE_MASK) {
102 /* IO access */
103 if ((addr & (DATA_SIZE - 1)) != 0)
104 goto do_unaligned_access;
pbrook2e70f6e2008-06-29 01:03:05 +0000105 retaddr = GETPC();
pbrook0f459d12008-06-09 00:20:13 +0000106 addend = env->iotlb[mmu_idx][index];
pbrook2e70f6e2008-06-29 01:03:05 +0000107 res = glue(io_read, SUFFIX)(addend, addr, retaddr);
bellard98699962005-11-26 10:29:22 +0000108 } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
bellardb92e5a22003-08-08 23:58:05 +0000109 /* slow unaligned access (it spans two pages or IO) */
110 do_unaligned_access:
bellard61382a52003-10-27 21:22:23 +0000111 retaddr = GETPC();
bellarda64d4712005-12-05 19:57:57 +0000112#ifdef ALIGNED_ONLY
j_mayer6ebbf392007-10-14 07:07:08 +0000113 do_unaligned_access(addr, READ_ACCESS_TYPE, mmu_idx, retaddr);
bellarda64d4712005-12-05 19:57:57 +0000114#endif
ths5fafdf22007-09-16 21:08:06 +0000115 res = glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(addr,
j_mayer6ebbf392007-10-14 07:07:08 +0000116 mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000117 } else {
bellarda64d4712005-12-05 19:57:57 +0000118 /* unaligned/aligned access in the same page */
119#ifdef ALIGNED_ONLY
120 if ((addr & (DATA_SIZE - 1)) != 0) {
121 retaddr = GETPC();
j_mayer6ebbf392007-10-14 07:07:08 +0000122 do_unaligned_access(addr, READ_ACCESS_TYPE, mmu_idx, retaddr);
bellarda64d4712005-12-05 19:57:57 +0000123 }
124#endif
pbrook0f459d12008-06-09 00:20:13 +0000125 addend = env->tlb_table[mmu_idx][index].addend;
126 res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)(long)(addr+addend));
bellardb92e5a22003-08-08 23:58:05 +0000127 }
128 } else {
129 /* the page is not in the TLB : fill it */
bellard61382a52003-10-27 21:22:23 +0000130 retaddr = GETPC();
bellarda64d4712005-12-05 19:57:57 +0000131#ifdef ALIGNED_ONLY
132 if ((addr & (DATA_SIZE - 1)) != 0)
j_mayer6ebbf392007-10-14 07:07:08 +0000133 do_unaligned_access(addr, READ_ACCESS_TYPE, mmu_idx, retaddr);
bellarda64d4712005-12-05 19:57:57 +0000134#endif
j_mayer6ebbf392007-10-14 07:07:08 +0000135 tlb_fill(addr, READ_ACCESS_TYPE, mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000136 goto redo;
137 }
138 return res;
139}
140
141/* handle all unaligned cases */
ths5fafdf22007-09-16 21:08:06 +0000142static DATA_TYPE glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(target_ulong addr,
j_mayer6ebbf392007-10-14 07:07:08 +0000143 int mmu_idx,
bellard61382a52003-10-27 21:22:23 +0000144 void *retaddr)
bellardb92e5a22003-08-08 23:58:05 +0000145{
146 DATA_TYPE res, res1, res2;
bellard61382a52003-10-27 21:22:23 +0000147 int index, shift;
pbrook0f459d12008-06-09 00:20:13 +0000148 target_phys_addr_t addend;
bellardc27004e2005-01-03 23:35:10 +0000149 target_ulong tlb_addr, addr1, addr2;
bellardb92e5a22003-08-08 23:58:05 +0000150
bellardb92e5a22003-08-08 23:58:05 +0000151 index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
152 redo:
j_mayer6ebbf392007-10-14 07:07:08 +0000153 tlb_addr = env->tlb_table[mmu_idx][index].ADDR_READ;
bellardb92e5a22003-08-08 23:58:05 +0000154 if ((addr & TARGET_PAGE_MASK) == (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {
bellardb92e5a22003-08-08 23:58:05 +0000155 if (tlb_addr & ~TARGET_PAGE_MASK) {
156 /* IO access */
157 if ((addr & (DATA_SIZE - 1)) != 0)
158 goto do_unaligned_access;
pbrook2e70f6e2008-06-29 01:03:05 +0000159 retaddr = GETPC();
pbrook0f459d12008-06-09 00:20:13 +0000160 addend = env->iotlb[mmu_idx][index];
pbrook2e70f6e2008-06-29 01:03:05 +0000161 res = glue(io_read, SUFFIX)(addend, addr, retaddr);
bellard98699962005-11-26 10:29:22 +0000162 } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
bellardb92e5a22003-08-08 23:58:05 +0000163 do_unaligned_access:
164 /* slow unaligned access (it spans two pages) */
165 addr1 = addr & ~(DATA_SIZE - 1);
166 addr2 = addr1 + DATA_SIZE;
ths5fafdf22007-09-16 21:08:06 +0000167 res1 = glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(addr1,
j_mayer6ebbf392007-10-14 07:07:08 +0000168 mmu_idx, retaddr);
ths5fafdf22007-09-16 21:08:06 +0000169 res2 = glue(glue(slow_ld, SUFFIX), MMUSUFFIX)(addr2,
j_mayer6ebbf392007-10-14 07:07:08 +0000170 mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000171 shift = (addr & (DATA_SIZE - 1)) * 8;
172#ifdef TARGET_WORDS_BIGENDIAN
173 res = (res1 << shift) | (res2 >> ((DATA_SIZE * 8) - shift));
174#else
175 res = (res1 >> shift) | (res2 << ((DATA_SIZE * 8) - shift));
176#endif
bellard6986f882004-01-18 21:53:18 +0000177 res = (DATA_TYPE)res;
bellardb92e5a22003-08-08 23:58:05 +0000178 } else {
179 /* unaligned/aligned access in the same page */
pbrook0f459d12008-06-09 00:20:13 +0000180 addend = env->tlb_table[mmu_idx][index].addend;
181 res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)(long)(addr+addend));
bellardb92e5a22003-08-08 23:58:05 +0000182 }
183 } else {
184 /* the page is not in the TLB : fill it */
j_mayer6ebbf392007-10-14 07:07:08 +0000185 tlb_fill(addr, READ_ACCESS_TYPE, mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000186 goto redo;
187 }
188 return res;
189}
190
bellardb769d8f2004-10-03 15:07:13 +0000191#ifndef SOFTMMU_CODE_ACCESS
192
ths5fafdf22007-09-16 21:08:06 +0000193static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr,
194 DATA_TYPE val,
j_mayer6ebbf392007-10-14 07:07:08 +0000195 int mmu_idx,
bellardb769d8f2004-10-03 15:07:13 +0000196 void *retaddr);
197
ths5fafdf22007-09-16 21:08:06 +0000198static inline void glue(io_write, SUFFIX)(target_phys_addr_t physaddr,
bellardb769d8f2004-10-03 15:07:13 +0000199 DATA_TYPE val,
pbrook0f459d12008-06-09 00:20:13 +0000200 target_ulong addr,
bellardb769d8f2004-10-03 15:07:13 +0000201 void *retaddr)
202{
203 int index;
pbrook0f459d12008-06-09 00:20:13 +0000204 index = (physaddr >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1);
205 physaddr = (physaddr & TARGET_PAGE_MASK) + addr;
pbrook2e70f6e2008-06-29 01:03:05 +0000206 if (index > (IO_MEM_NOTDIRTY >> IO_MEM_SHIFT)
207 && !can_do_io(env)) {
208 cpu_io_recompile(env, retaddr);
209 }
bellardb769d8f2004-10-03 15:07:13 +0000210
pbrook2e70f6e2008-06-29 01:03:05 +0000211 env->mem_io_vaddr = addr;
212 env->mem_io_pc = (unsigned long)retaddr;
bellardb769d8f2004-10-03 15:07:13 +0000213#if SHIFT <= 2
214 io_mem_write[index][SHIFT](io_mem_opaque[index], physaddr, val);
215#else
216#ifdef TARGET_WORDS_BIGENDIAN
217 io_mem_write[index][2](io_mem_opaque[index], physaddr, val >> 32);
218 io_mem_write[index][2](io_mem_opaque[index], physaddr + 4, val);
219#else
220 io_mem_write[index][2](io_mem_opaque[index], physaddr, val);
221 io_mem_write[index][2](io_mem_opaque[index], physaddr + 4, val >> 32);
222#endif
223#endif /* SHIFT > 2 */
blueswir1640f42e2009-04-19 10:18:01 +0000224#ifdef CONFIG_KQEMU
bellardf1c85672006-02-08 22:41:53 +0000225 env->last_io_time = cpu_get_time_fast();
226#endif
bellardb769d8f2004-10-03 15:07:13 +0000227}
bellardb92e5a22003-08-08 23:58:05 +0000228
bellardd6564692008-01-31 09:22:27 +0000229void REGPARM glue(glue(__st, SUFFIX), MMUSUFFIX)(target_ulong addr,
230 DATA_TYPE val,
231 int mmu_idx)
bellardb92e5a22003-08-08 23:58:05 +0000232{
pbrook0f459d12008-06-09 00:20:13 +0000233 target_phys_addr_t addend;
bellardc27004e2005-01-03 23:35:10 +0000234 target_ulong tlb_addr;
bellardb92e5a22003-08-08 23:58:05 +0000235 void *retaddr;
bellard61382a52003-10-27 21:22:23 +0000236 int index;
ths3b46e622007-09-17 08:09:54 +0000237
bellardb92e5a22003-08-08 23:58:05 +0000238 index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
239 redo:
j_mayer6ebbf392007-10-14 07:07:08 +0000240 tlb_addr = env->tlb_table[mmu_idx][index].addr_write;
bellardb92e5a22003-08-08 23:58:05 +0000241 if ((addr & TARGET_PAGE_MASK) == (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {
bellardb92e5a22003-08-08 23:58:05 +0000242 if (tlb_addr & ~TARGET_PAGE_MASK) {
243 /* IO access */
244 if ((addr & (DATA_SIZE - 1)) != 0)
245 goto do_unaligned_access;
bellardd720b932004-04-25 17:57:43 +0000246 retaddr = GETPC();
pbrook0f459d12008-06-09 00:20:13 +0000247 addend = env->iotlb[mmu_idx][index];
248 glue(io_write, SUFFIX)(addend, val, addr, retaddr);
bellard98699962005-11-26 10:29:22 +0000249 } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
bellardb92e5a22003-08-08 23:58:05 +0000250 do_unaligned_access:
bellard61382a52003-10-27 21:22:23 +0000251 retaddr = GETPC();
bellarda64d4712005-12-05 19:57:57 +0000252#ifdef ALIGNED_ONLY
j_mayer6ebbf392007-10-14 07:07:08 +0000253 do_unaligned_access(addr, 1, mmu_idx, retaddr);
bellarda64d4712005-12-05 19:57:57 +0000254#endif
ths5fafdf22007-09-16 21:08:06 +0000255 glue(glue(slow_st, SUFFIX), MMUSUFFIX)(addr, val,
j_mayer6ebbf392007-10-14 07:07:08 +0000256 mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000257 } else {
258 /* aligned/unaligned access in the same page */
bellarda64d4712005-12-05 19:57:57 +0000259#ifdef ALIGNED_ONLY
260 if ((addr & (DATA_SIZE - 1)) != 0) {
261 retaddr = GETPC();
j_mayer6ebbf392007-10-14 07:07:08 +0000262 do_unaligned_access(addr, 1, mmu_idx, retaddr);
bellarda64d4712005-12-05 19:57:57 +0000263 }
264#endif
pbrook0f459d12008-06-09 00:20:13 +0000265 addend = env->tlb_table[mmu_idx][index].addend;
266 glue(glue(st, SUFFIX), _raw)((uint8_t *)(long)(addr+addend), val);
bellardb92e5a22003-08-08 23:58:05 +0000267 }
268 } else {
269 /* the page is not in the TLB : fill it */
bellard61382a52003-10-27 21:22:23 +0000270 retaddr = GETPC();
bellarda64d4712005-12-05 19:57:57 +0000271#ifdef ALIGNED_ONLY
272 if ((addr & (DATA_SIZE - 1)) != 0)
j_mayer6ebbf392007-10-14 07:07:08 +0000273 do_unaligned_access(addr, 1, mmu_idx, retaddr);
bellarda64d4712005-12-05 19:57:57 +0000274#endif
j_mayer6ebbf392007-10-14 07:07:08 +0000275 tlb_fill(addr, 1, mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000276 goto redo;
277 }
278}
279
280/* handles all unaligned cases */
ths5fafdf22007-09-16 21:08:06 +0000281static void glue(glue(slow_st, SUFFIX), MMUSUFFIX)(target_ulong addr,
bellard61382a52003-10-27 21:22:23 +0000282 DATA_TYPE val,
j_mayer6ebbf392007-10-14 07:07:08 +0000283 int mmu_idx,
bellard61382a52003-10-27 21:22:23 +0000284 void *retaddr)
bellardb92e5a22003-08-08 23:58:05 +0000285{
pbrook0f459d12008-06-09 00:20:13 +0000286 target_phys_addr_t addend;
bellardc27004e2005-01-03 23:35:10 +0000287 target_ulong tlb_addr;
bellard61382a52003-10-27 21:22:23 +0000288 int index, i;
bellardb92e5a22003-08-08 23:58:05 +0000289
bellardb92e5a22003-08-08 23:58:05 +0000290 index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1);
291 redo:
j_mayer6ebbf392007-10-14 07:07:08 +0000292 tlb_addr = env->tlb_table[mmu_idx][index].addr_write;
bellardb92e5a22003-08-08 23:58:05 +0000293 if ((addr & TARGET_PAGE_MASK) == (tlb_addr & (TARGET_PAGE_MASK | TLB_INVALID_MASK))) {
bellardb92e5a22003-08-08 23:58:05 +0000294 if (tlb_addr & ~TARGET_PAGE_MASK) {
295 /* IO access */
296 if ((addr & (DATA_SIZE - 1)) != 0)
297 goto do_unaligned_access;
pbrook0f459d12008-06-09 00:20:13 +0000298 addend = env->iotlb[mmu_idx][index];
299 glue(io_write, SUFFIX)(addend, val, addr, retaddr);
bellard98699962005-11-26 10:29:22 +0000300 } else if (((addr & ~TARGET_PAGE_MASK) + DATA_SIZE - 1) >= TARGET_PAGE_SIZE) {
bellardb92e5a22003-08-08 23:58:05 +0000301 do_unaligned_access:
302 /* XXX: not efficient, but simple */
balrog6c41b272007-11-17 12:12:29 +0000303 /* Note: relies on the fact that tlb_fill() does not remove the
304 * previous page from the TLB cache. */
balrog7221fa92007-11-17 09:53:42 +0000305 for(i = DATA_SIZE - 1; i >= 0; i--) {
bellardb92e5a22003-08-08 23:58:05 +0000306#ifdef TARGET_WORDS_BIGENDIAN
ths5fafdf22007-09-16 21:08:06 +0000307 glue(slow_stb, MMUSUFFIX)(addr + i, val >> (((DATA_SIZE - 1) * 8) - (i * 8)),
j_mayer6ebbf392007-10-14 07:07:08 +0000308 mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000309#else
ths5fafdf22007-09-16 21:08:06 +0000310 glue(slow_stb, MMUSUFFIX)(addr + i, val >> (i * 8),
j_mayer6ebbf392007-10-14 07:07:08 +0000311 mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000312#endif
313 }
314 } else {
315 /* aligned/unaligned access in the same page */
pbrook0f459d12008-06-09 00:20:13 +0000316 addend = env->tlb_table[mmu_idx][index].addend;
317 glue(glue(st, SUFFIX), _raw)((uint8_t *)(long)(addr+addend), val);
bellardb92e5a22003-08-08 23:58:05 +0000318 }
319 } else {
320 /* the page is not in the TLB : fill it */
j_mayer6ebbf392007-10-14 07:07:08 +0000321 tlb_fill(addr, 1, mmu_idx, retaddr);
bellardb92e5a22003-08-08 23:58:05 +0000322 goto redo;
323 }
324}
325
bellardb769d8f2004-10-03 15:07:13 +0000326#endif /* !defined(SOFTMMU_CODE_ACCESS) */
327
328#undef READ_ACCESS_TYPE
bellardb92e5a22003-08-08 23:58:05 +0000329#undef SHIFT
330#undef DATA_TYPE
331#undef SUFFIX
bellard61382a52003-10-27 21:22:23 +0000332#undef USUFFIX
bellardb92e5a22003-08-08 23:58:05 +0000333#undef DATA_SIZE
bellard84b7b8e2005-11-28 21:19:04 +0000334#undef ADDR_READ