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

Submitted by Peter Crosthwaite on June 7, 2013, 2:40 a.m.

Details

Message ID d672c3f1714b71af9a951f23d5e50e4a11c56e9f.1370572420.git.peter.crosthwaite@xilinx.com
State New
Headers show

Commit Message

Peter Crosthwaite June 7, 2013, 2:40 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 hide | download patch | download mbox

diff --git a/hw/intc/xilinx_intc.c b/hw/intc/xilinx_intc.c
index 09b4453..ddedfa3 100644
--- a/hw/intc/xilinx_intc.c
+++ b/hw/intc/xilinx_intc.c
@@ -116,6 +116,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;