Patchwork [v2,4/5] intc/xilinx_intc: Inhibit write to ISR when HIE

login
register
mail settings
Submitter Peter Crosthwaite
Date June 11, 2013, 12:59 a.m.
Message ID <30fed45add3fa146e032000458d4bb0894d1c3a8.1370911981.git.peter.crosthwaite@xilinx.com>
Download mbox | patch
Permalink /patch/250431/
State New
Headers show

Comments

Peter Crosthwaite - June 11, 2013, 12:59 a.m.
From: Peter Crosthwaite <peter.crosthwaite@xilinx.com>

When the Hardware Interrupt Enable (HIE) bit is set, software cannot
change ISR. Add write guard accordingly.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
---

 hw/intc/xilinx_intc.c | 5 +++++
 1 file changed, 5 insertions(+)

Patch

diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c
index 010b080..e9121cd 100644
--- a/hw/intc/xilinx_intc.c
+++ b/hw/intc/xilinx_intc.c
@@ -120,6 +120,11 @@  pic_write(void *opaque, hwaddr addr,
         case R_CIE:
             p->regs[R_IER] &= ~value; /* Atomic clear ie.  */
             break;
+        case R_ISR:
+            if ((p->regs[R_MER] & 2)) {
+                break;
+            }
+            /* fallthrough */
         default:
             if (addr < ARRAY_SIZE(p->regs))
                 p->regs[addr] = value;