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");
}
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)
void
ArmSPI::raise()
{
+ _active = true;
platform->gic->sendInt(intNum);
}
void
ArmSPI::clear()
{
+ _active = false;
platform->gic->clearInt(intNum);
}
void
ArmPPI::raise()
{
+ _active = true;
platform->gic->sendPPInt(intNum, targetContext());
}
void
ArmPPI::clear()
{
+ _active = false;
platform->gic->clearPPInt(intNum, targetContext());
}
/**
* Generic representation of an Arm interrupt pin.
*/
-class ArmInterruptPin
+class ArmInterruptPin : public Serializable
{
friend class ArmInterruptPinGen;
protected:
/** 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.
/** Interrupt number to generate */
const uint32_t intNum;
+
+ /** True if interrupt pin is active, false otherwise */
+ bool _active;
};
class ArmSPI : public ArmInterruptPin