mirror of https://gitee.com/openkylin/qemu.git
Sparc32: dummy implementation of MXCC MMU breakpoint registers
Add dummy registers for SuperSPARC MXCC MMU counter breakpoints, save and load all MXCC registers. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
parent
af2be20777
commit
4d2c2b77f3
|
@ -403,6 +403,8 @@ typedef struct CPUSPARCState {
|
|||
uint32_t mmuregs[32];
|
||||
uint64_t mxccdata[4];
|
||||
uint64_t mxccregs[8];
|
||||
uint32_t mmubpctrv, mmubpctrc, mmubpctrs;
|
||||
uint64_t mmubpaction;
|
||||
uint64_t mmubpregs[4];
|
||||
uint64_t prom_addr;
|
||||
#endif
|
||||
|
@ -521,7 +523,7 @@ int cpu_sparc_signal_handler(int host_signum, void *pinfo, void *puc);
|
|||
#define cpu_signal_handler cpu_sparc_signal_handler
|
||||
#define cpu_list sparc_cpu_list
|
||||
|
||||
#define CPU_SAVE_VERSION 6
|
||||
#define CPU_SAVE_VERSION 7
|
||||
|
||||
/* MMU modes definitions */
|
||||
#if defined (TARGET_SPARC64)
|
||||
|
|
|
@ -45,6 +45,19 @@ void cpu_save(QEMUFile *f, void *opaque)
|
|||
/* MMU */
|
||||
for (i = 0; i < 32; i++)
|
||||
qemu_put_be32s(f, &env->mmuregs[i]);
|
||||
for (i = 0; i < 4; i++) {
|
||||
qemu_put_be64s(f, &env->mxccdata[i]);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
qemu_put_be64s(f, &env->mxccregs[i]);
|
||||
}
|
||||
qemu_put_be32s(f, &env->mmubpctrv);
|
||||
qemu_put_be32s(f, &env->mmubpctrc);
|
||||
qemu_put_be32s(f, &env->mmubpctrs);
|
||||
qemu_put_be64s(f, &env->mmubpaction);
|
||||
for (i = 0; i < 4; i++) {
|
||||
qemu_put_be64s(f, &env->mmubpregs[i]);
|
||||
}
|
||||
#else
|
||||
qemu_put_be64s(f, &env->lsu);
|
||||
for (i = 0; i < 16; i++) {
|
||||
|
@ -141,6 +154,19 @@ int cpu_load(QEMUFile *f, void *opaque, int version_id)
|
|||
/* MMU */
|
||||
for (i = 0; i < 32; i++)
|
||||
qemu_get_be32s(f, &env->mmuregs[i]);
|
||||
for (i = 0; i < 4; i++) {
|
||||
qemu_get_be64s(f, &env->mxccdata[i]);
|
||||
}
|
||||
for (i = 0; i < 8; i++) {
|
||||
qemu_get_be64s(f, &env->mxccregs[i]);
|
||||
}
|
||||
qemu_get_be32s(f, &env->mmubpctrv);
|
||||
qemu_get_be32s(f, &env->mmubpctrc);
|
||||
qemu_get_be32s(f, &env->mmubpctrs);
|
||||
qemu_get_be64s(f, &env->mmubpaction);
|
||||
for (i = 0; i < 4; i++) {
|
||||
qemu_get_be64s(f, &env->mmubpregs[i]);
|
||||
}
|
||||
#else
|
||||
qemu_get_be64s(f, &env->lsu);
|
||||
for (i = 0; i < 16; i++) {
|
||||
|
|
|
@ -1940,7 +1940,6 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign)
|
|||
case 0x31: // Turbosparc RAM snoop
|
||||
case 0x32: // Turbosparc page table descriptor diagnostic
|
||||
case 0x39: /* data cache diagnostic register */
|
||||
case 0x4c: /* SuperSPARC MMU Breakpoint Action register */
|
||||
ret = 0;
|
||||
break;
|
||||
case 0x38: /* SuperSPARC MMU Breakpoint Control Registers */
|
||||
|
@ -1966,6 +1965,18 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign)
|
|||
ret);
|
||||
}
|
||||
break;
|
||||
case 0x49: /* SuperSPARC MMU Counter Breakpoint Value */
|
||||
ret = env->mmubpctrv;
|
||||
break;
|
||||
case 0x4a: /* SuperSPARC MMU Counter Breakpoint Control */
|
||||
ret = env->mmubpctrc;
|
||||
break;
|
||||
case 0x4b: /* SuperSPARC MMU Counter Breakpoint Status */
|
||||
ret = env->mmubpctrs;
|
||||
break;
|
||||
case 0x4c: /* SuperSPARC MMU Breakpoint Action */
|
||||
ret = env->mmubpaction;
|
||||
break;
|
||||
case 8: /* User code access, XXX */
|
||||
default:
|
||||
do_unassigned_access(addr, 0, 0, asi, size);
|
||||
|
@ -2304,7 +2315,6 @@ void helper_st_asi(target_ulong addr, uint64_t val, int asi, int size)
|
|||
// descriptor diagnostic
|
||||
case 0x36: /* I-cache flash clear */
|
||||
case 0x37: /* D-cache flash clear */
|
||||
case 0x4c: /* breakpoint action */
|
||||
break;
|
||||
case 0x38: /* SuperSPARC MMU Breakpoint Control Registers*/
|
||||
{
|
||||
|
@ -2328,6 +2338,18 @@ void helper_st_asi(target_ulong addr, uint64_t val, int asi, int size)
|
|||
env->mmuregs[reg]);
|
||||
}
|
||||
break;
|
||||
case 0x49: /* SuperSPARC MMU Counter Breakpoint Value */
|
||||
env->mmubpctrv = val & 0xffffffff;
|
||||
break;
|
||||
case 0x4a: /* SuperSPARC MMU Counter Breakpoint Control */
|
||||
env->mmubpctrc = val & 0x3;
|
||||
break;
|
||||
case 0x4b: /* SuperSPARC MMU Counter Breakpoint Status */
|
||||
env->mmubpctrs = val & 0x3;
|
||||
break;
|
||||
case 0x4c: /* SuperSPARC MMU Breakpoint Action */
|
||||
env->mmubpaction = val & 0x1fff;
|
||||
break;
|
||||
case 8: /* User code access, XXX */
|
||||
case 9: /* Supervisor code access, XXX */
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue