mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-02-02 15:51:00 +00:00
target-arm: implement arm_debug_target_el()
Implement debug exception routing according to ARM ARM D2.3.1 Pseudocode description of routing debug exceptions. Backports commit 81669b8b81eb450d7b89ee5fdd57bdb73d87022d from qemu
This commit is contained in:
parent
9b5cd0cec1
commit
cb04e919ab
|
@ -1725,7 +1725,22 @@ static inline int cpu_mmu_index(CPUARMState *env, bool ifetch)
|
|||
*/
|
||||
static inline int arm_debug_target_el(CPUARMState *env)
|
||||
{
|
||||
bool secure = arm_is_secure(env);
|
||||
bool route_to_el2 = false;
|
||||
|
||||
if (arm_feature(env, ARM_FEATURE_EL2) && !secure) {
|
||||
route_to_el2 = env->cp15.hcr_el2 & HCR_TGE ||
|
||||
env->cp15.mdcr_el2 & (1 << 8);
|
||||
}
|
||||
|
||||
if (route_to_el2) {
|
||||
return 2;
|
||||
} else if (arm_feature(env, ARM_FEATURE_EL3) &&
|
||||
!arm_el_is_aa64(env, 3) && secure) {
|
||||
return 3;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool aa64_generate_debug_exceptions(CPUARMState *env)
|
||||
|
|
Loading…
Reference in a new issue