summaryrefslogtreecommitdiff
path: root/src/dev/arm/kmi.hh
diff options
context:
space:
mode:
authorSudhanshu Jha <sudhanshu.jha@arm.com>2017-02-27 10:29:56 +0000
committerAndreas Sandberg <andreas.sandberg@arm.com>2017-03-07 11:14:28 +0000
commit746e2f3c27ad83c36b7bc3b8bd3c92004fcf995b (patch)
tree3db0d446673d300a037516b8c8abebb8511dd296 /src/dev/arm/kmi.hh
parent46bfc14312f9b3b2f4e356f5d31405ae4ad394a8 (diff)
downloadgem5-746e2f3c27ad83c36b7bc3b8bd3c92004fcf995b.tar.xz
arm, kmi: Clear interrupts in KMI devices
Added functionality to check and clear interrupts for KMI devices. This fixes a boot bug when using KVM and in-kernel GIC emulation. Change-Id: Ia3e91d07567b7faf3f82b0adfda4a165a502a339 Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com> Reviewed-on: https://gem5-review.googlesource.com/2225 Reviewed-by: Rahul Thakur <rjthakur@google.com>
Diffstat (limited to 'src/dev/arm/kmi.hh')
-rw-r--r--src/dev/arm/kmi.hh12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/dev/arm/kmi.hh b/src/dev/arm/kmi.hh
index a321caf63..55e4b4285 100644
--- a/src/dev/arm/kmi.hh
+++ b/src/dev/arm/kmi.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 ARM Limited
+ * Copyright (c) 2010, 2017 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -101,9 +101,6 @@ class Pl050 : public AmbaIntDevice, public VncKeyboard, public VncMouse
Bitfield<1> tx;
EndBitUnion(InterruptReg)
- /** interrupt status register. */
- InterruptReg interrupts;
-
/** raw interrupt register (unmasked) */
InterruptReg rawInterrupts;
@@ -129,6 +126,13 @@ class Pl050 : public AmbaIntDevice, public VncKeyboard, public VncMouse
/** Function to generate interrupt */
void generateInterrupt();
+ /** Get interrupt value */
+ InterruptReg getInterrupt() const {
+ InterruptReg tmp_interrupt(0);
+ tmp_interrupt.tx = rawInterrupts.tx & control.txint_enable;
+ tmp_interrupt.rx = rawInterrupts.rx & control.rxint_enable;
+ return tmp_interrupt;
+ }
/** Wrapper to create an event out of the thing */
EventWrapper<Pl050, &Pl050::generateInterrupt> intEvent;