qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Tim 'mithro' Ansell <mithro@mithis.com>
To: qemu-devel@nongnu.org
Cc: Tim 'mithro' Ansell <mithro@mithis.com>,
	shorne@gmail.com, Jia Liu <proljc@gmail.com>
Subject: [Qemu-devel] [PATCH 2/2] target/openrisc: Implement EPH bit
Date: Tue, 18 Apr 2017 16:15:51 +1000	[thread overview]
Message-ID: <20170418061551.196582-3-mithro@mithis.com> (raw)
In-Reply-To: <20170418061551.196582-1-mithro@mithis.com>

Exception Prefix High (EPH) control bit of the Supervision Register
(SR).

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).

If SR[EPH] is set, the vector offset is logically ORed with the offset
0xF0000000.

This means if EPH is;
 * 0 - Exceptions vectors start at EVBAR
 * 1 - Exception vectors start at EVBAR | 0xF0000000

Signed-off-by: Tim 'mithro' Ansell <mithro@mithis.com>
---
 target/openrisc/interrupt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/target/openrisc/interrupt.c b/target/openrisc/interrupt.c
index 78f0ba9421..2c91fab380 100644
--- a/target/openrisc/interrupt.c
+++ b/target/openrisc/interrupt.c
@@ -69,6 +69,9 @@ void openrisc_cpu_do_interrupt(CPUState *cs)
         if (env->cpucfgr & CPUCFGR_EVBARP) {
             vect_pc |= env->evbar;
         }
+        if (env->sr & SR_EPH) {
+            vect_pc |= 0xf0000000;
+        }
         env->pc = vect_pc;
     } else {
         cpu_abort(cs, "Unhandled exception 0x%x\n", cs->exception_index);
-- 
2.12.1

  parent reply	other threads:[~2017-04-18  6:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-18  6:15 [Qemu-devel] [PATCH 0/2] targets/openrisc: Improve exception vectoring Tim 'mithro' Ansell
2017-04-18  6:15 ` [Qemu-devel] [PATCH 1/2] target/openrisc: Implement EVBAR register Tim 'mithro' Ansell
2017-04-18 12:47   ` Stafford Horne
2017-04-20  7:00     ` Richard Henderson
2017-04-27  0:55     ` Tim Ansell
2017-04-27 21:18       ` Stafford Horne
2017-04-18  6:15 ` Tim 'mithro' Ansell [this message]
2017-04-18 12:40   ` [Qemu-devel] [PATCH 2/2] target/openrisc: Implement EPH bit Stafford Horne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170418061551.196582-3-mithro@mithis.com \
    --to=mithro@mithis.com \
    --cc=proljc@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=shorne@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).