mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 19:15:34 +00:00
target-sparc: implement UA2005 ASI_MMU (0x21)
Backports commit 7dd8c0760ee197420273a7dfeab13bf54f6bbd8d from qemu
This commit is contained in:
parent
aac6955197
commit
aa24403d8a
|
@ -1410,6 +1410,18 @@ uint64_t helper_ld_asi(CPUSPARCState *env, target_ulong addr,
|
|||
ret = env->scratch[i];
|
||||
break;
|
||||
}
|
||||
case ASI_MMU: /* UA2005 Context ID registers */
|
||||
switch ((addr >> 3) & 0x3) {
|
||||
case 1:
|
||||
ret = env->dmmu.mmu_primary_context;
|
||||
break;
|
||||
case 2:
|
||||
ret = env->dmmu.mmu_secondary_context;
|
||||
break;
|
||||
default:
|
||||
cpu_unassigned_access(cs, addr, true, false, 1, size);
|
||||
}
|
||||
break;
|
||||
case ASI_DCACHE_DATA: /* D-cache data */
|
||||
case ASI_DCACHE_TAG: /* D-cache tag access */
|
||||
case ASI_ESTATE_ERROR_EN: /* E-cache error enable */
|
||||
|
@ -1717,6 +1729,25 @@ void helper_st_asi(CPUSPARCState *env, target_ulong addr, target_ulong val,
|
|||
case ASI_INTR_RECEIVE: /* Interrupt data receive */
|
||||
env->ivec_status = val & 0x20;
|
||||
return;
|
||||
case ASI_MMU: /* UA2005 Context ID registers */
|
||||
{
|
||||
switch ((addr >> 3) & 0x3) {
|
||||
case 1:
|
||||
env->dmmu.mmu_primary_context = val;
|
||||
env->immu.mmu_primary_context = val;
|
||||
tlb_flush_by_mmuidx(CPU(cpu), MMU_USER_IDX, MMU_KERNEL_IDX, -1);
|
||||
break;
|
||||
case 2:
|
||||
env->dmmu.mmu_secondary_context = val;
|
||||
env->immu.mmu_secondary_context = val;
|
||||
tlb_flush_by_mmuidx(CPU(cpu), MMU_USER_SECONDARY_IDX,
|
||||
MMU_KERNEL_SECONDARY_IDX, -1);
|
||||
break;
|
||||
default:
|
||||
cpu_unassigned_access(cs, addr, true, false, 1, size);
|
||||
}
|
||||
}
|
||||
return;
|
||||
case ASI_QUEUE: /* UA2005 CPU mondo queue */
|
||||
case ASI_DCACHE_DATA: /* D-cache data */
|
||||
case ASI_DCACHE_TAG: /* D-cache tag access */
|
||||
|
|
Loading…
Reference in a new issue