diff options
| author | Tim 'mithro' Ansell <mithro@mithis.com> | 2017-04-18 16:15:50 +1000 |
|---|---|---|
| committer | Stafford Horne <shorne@gmail.com> | 2017-04-21 23:55:48 +0900 |
| commit | 356a2db3c6f84e8e79e5afa3913514184bff5f50 (patch) | |
| tree | 08c1c57091a126f8834bb6a06f8971304b28959a /target/openrisc/interrupt.c | |
| parent | 1d7cf18d79c85031998cc8e628414eac292ca694 (diff) | |
| download | focaccia-qemu-356a2db3c6f84e8e79e5afa3913514184bff5f50.tar.gz focaccia-qemu-356a2db3c6f84e8e79e5afa3913514184bff5f50.zip | |
target/openrisc: Implement EVBAR register
Exception Vector Base Address Register (EVBAR) - This optional register can be used to apply an offset to the exception vector addresses. The significant bits (31-12) of the vector offset address for each exception depend on the setting of the Supervision Register (SR)'s EPH bit and the Exception Vector Base Address Register (EVBAR). Its presence is indicated by the EVBARP bit in the CPU Configuration Register (CPUCFGR). Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com> Signed-off-by: Stafford Horne <shorne@gmail.com>
Diffstat (limited to 'target/openrisc/interrupt.c')
| -rw-r--r-- | target/openrisc/interrupt.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c index a2eec6fb32..78f0ba9421 100644 --- a/target/openrisc/interrupt.c +++ b/target/openrisc/interrupt.c @@ -65,7 +65,11 @@ void openrisc_cpu_do_interrupt(CPUState *cs) env->lock_addr = -1; if (cs->exception_index > 0 && cs->exception_index < EXCP_NR) { - env->pc = (cs->exception_index << 8); + hwaddr vect_pc = cs->exception_index << 8; + if (env->cpucfgr & CPUCFGR_EVBARP) { + vect_pc |= env->evbar; + } + env->pc = vect_pc; } else { cpu_abort(cs, "Unhandled exception 0x%x\n", cs->exception_index); } |