Revision b7785d20
b/target-sparc/op_helper.c | ||
---|---|---|
2567 | 2567 |
helper_check_align(addr, size - 1); |
2568 | 2568 |
addr = asi_address_mask(env, asi, addr); |
2569 | 2569 |
|
2570 |
switch (asi) { |
|
2571 |
case 0x82: // Primary no-fault |
|
2572 |
case 0x8a: // Primary no-fault LE |
|
2573 |
case 0x83: // Secondary no-fault |
|
2574 |
case 0x8b: // Secondary no-fault LE |
|
2575 |
{ |
|
2576 |
/* secondary space access has lowest asi bit equal to 1 */ |
|
2577 |
int access_mmu_idx = ( asi & 1 ) ? MMU_KERNEL_IDX |
|
2578 |
: MMU_KERNEL_SECONDARY_IDX; |
|
2570 |
/* process nonfaulting loads first */ |
|
2571 |
if ((asi & 0xf6) == 0x82) { |
|
2572 |
int mmu_idx; |
|
2573 |
|
|
2574 |
/* secondary space access has lowest asi bit equal to 1 */ |
|
2575 |
if (env->pstate & PS_PRIV) { |
|
2576 |
mmu_idx = (asi & 1) ? MMU_KERNEL_SECONDARY_IDX : MMU_KERNEL_IDX; |
|
2577 |
} else { |
|
2578 |
mmu_idx = (asi & 1) ? MMU_USER_SECONDARY_IDX : MMU_USER_IDX; |
|
2579 |
} |
|
2579 | 2580 |
|
2580 |
if (cpu_get_phys_page_nofault(env, addr, access_mmu_idx) == -1ULL) {
|
|
2581 |
if (cpu_get_phys_page_nofault(env, addr, mmu_idx) == -1ULL) {
|
|
2581 | 2582 |
#ifdef DEBUG_ASI |
2582 |
dump_asi("read ", last_addr, asi, size, ret);
|
|
2583 |
dump_asi("read ", last_addr, asi, size, ret); |
|
2583 | 2584 |
#endif |
2584 |
return 0;
|
|
2585 |
}
|
|
2585 |
/* env->exception_index is set in get_physical_address_data(). */
|
|
2586 |
raise_exception(env->exception_index);
|
|
2586 | 2587 |
} |
2587 |
// Fall through |
|
2588 |
|
|
2589 |
/* convert nonfaulting load ASIs to normal load ASIs */ |
|
2590 |
asi &= ~0x02; |
|
2591 |
} |
|
2592 |
|
|
2593 |
switch (asi) { |
|
2588 | 2594 |
case 0x10: // As if user primary |
2589 | 2595 |
case 0x11: // As if user secondary |
2590 | 2596 |
case 0x18: // As if user primary LE |
... | ... | |
2862 | 2868 |
case 0x1d: // Bypass, non-cacheable LE |
2863 | 2869 |
case 0x88: // Primary LE |
2864 | 2870 |
case 0x89: // Secondary LE |
2865 |
case 0x8a: // Primary no-fault LE |
|
2866 |
case 0x8b: // Secondary no-fault LE |
|
2867 | 2871 |
switch(size) { |
2868 | 2872 |
case 2: |
2869 | 2873 |
ret = bswap16(ret); |
Also available in: Unified diff