armv7m: set CFSR.UNDEFINSTR on undefined instructions

When we take an exception for an undefined instruction, set the
appropriate CFSR bit.

Backports commit 81dd9648c69bb89afdd6f4bb3ed6f3efdac96524 from qemu
This commit is contained in:
Michael Davidsaver 2018-03-02 13:45:55 -05:00 committed by Lioncash
parent 2297b8134b
commit eaa080e232
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7

View file

@ -5443,6 +5443,7 @@ void arm_v7m_cpu_do_interrupt(CPUState *cs)
switch (cs->exception_index) {
case EXCP_UDEF:
//armv7m_nvic_set_pending(env->nvic, ARMV7M_EXCP_USAGE);
env->v7m.cfsr |= R_V7M_CFSR_UNDEFINSTR_MASK;
return;
case EXCP_SWI:
/* The PC already points to the next instruction. */