Giacomo Travaglini has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/31934 )

Change subject: dev-arm: Introduce the active boolean for ArmInterruptPin
......................................................................

dev-arm: Introduce the active boolean for ArmInterruptPin

The active boolean will specify if the interrupt line is active
or not (high if it is active high or low if it is active low).

This is decoupled from the interrupt being in a pending state
within the GIC, and it can be used by a peripheral to query the
status of its interrupt pin

Change-Id: I18445b891a75767c8a72e9a7044d6d75fdb7e224
Signed-off-by: Giacomo Travaglini <giacomo.travagl...@arm.com>
---
M src/dev/arm/base_gic.cc
M src/dev/arm/base_gic.hh
2 files changed, 28 insertions(+), 2 deletions(-)



diff --git a/src/dev/arm/base_gic.cc b/src/dev/arm/base_gic.cc
index a2df8ab..3181dca 100644
--- a/src/dev/arm/base_gic.cc
+++ b/src/dev/arm/base_gic.cc
@@ -121,7 +121,7 @@
 ArmInterruptPin::ArmInterruptPin(
     Platform  *_platform, ThreadContext *tc, uint32_t int_num)
       : threadContext(tc), platform(dynamic_cast<RealView*>(_platform)),
-        intNum(int_num)
+        intNum(int_num), _active(false)
 {
     fatal_if(!platform, "Interrupt not connected to a RealView platform");
 }
@@ -143,6 +143,18 @@
     return threadContext->contextId();
 }

+void
+ArmInterruptPin::serialize(CheckpointOut &cp) const
+{
+    SERIALIZE_SCALAR(_active);
+}
+
+void
+ArmInterruptPin::unserialize(CheckpointIn &cp)
+{
+    UNSERIALIZE_SCALAR(_active);
+}
+
 ArmSPI::ArmSPI(
     Platform  *_platform, uint32_t int_num)
       : ArmInterruptPin(_platform, nullptr, int_num)
@@ -152,12 +164,14 @@
 void
 ArmSPI::raise()
 {
+    _active = true;
     platform->gic->sendInt(intNum);
 }

 void
 ArmSPI::clear()
 {
+    _active = false;
     platform->gic->clearInt(intNum);
 }

@@ -170,12 +184,14 @@
 void
 ArmPPI::raise()
 {
+    _active = true;
     platform->gic->sendPPInt(intNum, targetContext());
 }

 void
 ArmPPI::clear()
 {
+    _active = false;
     platform->gic->clearPPInt(intNum, targetContext());
 }

diff --git a/src/dev/arm/base_gic.hh b/src/dev/arm/base_gic.hh
index 2f4a1f6..f8fd814 100644
--- a/src/dev/arm/base_gic.hh
+++ b/src/dev/arm/base_gic.hh
@@ -173,7 +173,7 @@
 /**
  * Generic representation of an Arm interrupt pin.
  */
-class ArmInterruptPin
+class ArmInterruptPin : public Serializable
 {
     friend class ArmInterruptPinGen;
   protected:
@@ -193,11 +193,18 @@
     /** Get interrupt number */
     uint32_t num() const { return intNum; }

+    /** True if interrupt pin is active, false otherwise */
+    bool active() const { return _active; }
+
     /** Signal an interrupt */
     virtual void raise() = 0;
     /** Clear a signalled interrupt */
     virtual void clear() = 0;

+  public: /* Serializable interface */
+    void serialize(CheckpointOut &cp) const override;
+    void unserialize(CheckpointIn &cp) override;
+
   protected:
     /**
      * Get the target context ID of this interrupt.
@@ -218,6 +225,9 @@

     /** Interrupt number to generate */
     const uint32_t intNum;
+
+    /** True if interrupt pin is active, false otherwise */
+    bool _active;
 };

 class ArmSPI : public ArmInterruptPin

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31934
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I18445b891a75767c8a72e9a7044d6d75fdb7e224
Gerrit-Change-Number: 31934
Gerrit-PatchSet: 1
Gerrit-Owner: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to