mips: set CP0 Debug DExcCode for SDBBP instruction

This patch fixes setting DExcCode field of CP0 Debug register
when SDBBP instruction is executed. According to EJTAG specification,
this field must be set to the value 9 (Bp).

Backports commit c6c2c0fc32362ba234ae3bdad1a55c2d6aefaa12 from qemu
This commit is contained in:
Pavel Dovgalyuk 2018-03-03 22:45:02 -05:00 committed by Lioncash
parent 0bd8dc4e0a
commit 342fa7135d
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -617,6 +617,8 @@ void mips_cpu_do_interrupt(CPUState *cs)
goto set_DEPC;
case EXCP_DBp:
env->CP0_Debug |= 1 << CP0DB_DBp;
/* Setup DExcCode - SDBBP instruction */
env->CP0_Debug = (env->CP0_Debug & ~(0x1fULL << CP0DB_DEC)) | 9 << CP0DB_DEC;
goto set_DEPC;
case EXCP_DDBS:
env->CP0_Debug |= 1 << CP0DB_DDBS;