Revision 968a40f6 target-microblaze/op_helper.c
b/target-microblaze/op_helper.c | ||
---|---|---|
206 | 206 |
return 0; |
207 | 207 |
} |
208 | 208 |
|
209 |
void helper_memalign(uint32_t addr, uint32_t dr, uint32_t wr, uint32_t size) |
|
210 |
{ |
|
211 |
uint32_t mask; |
|
212 |
|
|
213 |
switch (size) { |
|
214 |
case 4: mask = 3; break; |
|
215 |
case 2: mask = 1; break; |
|
216 |
default: |
|
217 |
case 1: mask = 0; break; |
|
218 |
} |
|
219 |
|
|
220 |
if (addr & mask) { |
|
221 |
qemu_log("unaligned access addr=%x size=%d, wr=%d\n", |
|
222 |
addr, size, wr); |
|
223 |
if (!(env->sregs[SR_MSR] & MSR_EE)) { |
|
224 |
return; |
|
225 |
} |
|
226 |
|
|
227 |
env->sregs[SR_ESR] = ESR_EC_UNALIGNED_DATA | (wr << 10) \ |
|
228 |
| (dr & 31) << 5; |
|
229 |
if (size == 4) { |
|
230 |
env->sregs[SR_ESR] |= 1 << 11; |
|
231 |
} |
|
232 |
helper_raise_exception(EXCP_HW_EXCP); |
|
233 |
} |
|
234 |
} |
|
235 |
|
|
209 | 236 |
#if !defined(CONFIG_USER_ONLY) |
210 | 237 |
/* Writes/reads to the MMU's special regs end up here. */ |
211 | 238 |
uint32_t helper_mmu_read(uint32_t rn) |
Also available in: Unified diff