72 : m_Trigger(trigger), m_ControllerAck(controllerAck), m_LineRelease(lineRelease) {}
75 return IrqPolicy(IrqTrigger::Edge, IrqControllerAck::BeforeHardStage,
76 IrqLineRelease::AfterHardStage);
79 static constexpr IrqPolicy edgeThreaded() {
80 return IrqPolicy(IrqTrigger::Edge, IrqControllerAck::AfterHardStage,
81 IrqLineRelease::AfterHardStage);
85 return IrqPolicy(IrqTrigger::Level, IrqControllerAck::AfterHardStage,
86 IrqLineRelease::AfterHardStage);
89 static constexpr IrqPolicy levelThreaded() {
90 return IrqPolicy(IrqTrigger::Level, IrqControllerAck::AfterHardStage,
91 IrqLineRelease::AfterThreadedCompletion);
94 static constexpr IrqPolicy pciIntxHard() {
98 static constexpr IrqPolicy pciIntxThreaded() {
99 return levelThreaded();
102 static constexpr IrqPolicy syntheticHard() {
103 return IrqPolicy(IrqTrigger::Synthetic, IrqControllerAck::None, IrqLineRelease::AfterHardStage);
106 static constexpr IrqPolicy syntheticThreaded() {
107 return IrqPolicy(IrqTrigger::Synthetic, IrqControllerAck::None, IrqLineRelease::AfterHardStage);
115 return m_ControllerAck;
119 return m_LineRelease;
122 constexpr bool validForHard()
const {
123 return valid() && m_LineRelease == IrqLineRelease::AfterHardStage &&
124 !(m_Trigger == IrqTrigger::Level &&
125 m_ControllerAck == IrqControllerAck::BeforeHardStage);
128 constexpr bool validForThreaded()
const {
130 ((m_Trigger == IrqTrigger::Level &&
131 m_LineRelease == IrqLineRelease::AfterThreadedCompletion) ||
132 (m_Trigger != IrqTrigger::Level && m_LineRelease == IrqLineRelease::AfterHardStage));
135 constexpr bool operator==(
const IrqPolicy& other)
const {
136 return m_Trigger == other.m_Trigger && m_ControllerAck == other.m_ControllerAck &&
137 m_LineRelease == other.m_LineRelease;
140 constexpr bool operator!=(
const IrqPolicy& other)
const {
141 return !(*
this == other);
145 constexpr bool valid()
const {
146 const bool synthetic = m_Trigger == IrqTrigger::Synthetic;
147 if (synthetic != (m_ControllerAck == IrqControllerAck::None)) {
151 return m_LineRelease != IrqLineRelease::AfterThreadedCompletion ||
152 m_Trigger == IrqTrigger::Level;
171 IrqMaskNoHandler = 1U << 0,
172 IrqMaskAdministrativelyDisabled = 1U << 1,
173 IrqMaskAwaitingAcknowledgement = 1U << 2,
174 IrqMaskAwaitingThreadedCompletion = 1U << 3,
175 IrqMaskMitigated = 1U << 4,
176 IrqMaskShuttingDown = 1U << 5,
177 IrqMaskControllerContention = 1U << 6,
221 size_t snapshotGeneration;
222 size_t observationTimestamp;
223 size_t dispatchGeneration;
224 size_t acknowledgedGeneration;
225 size_t activeHardDispatchCount;
226 size_t activeHardDispatchGeneration;
227 size_t activeThreadedDispatchCount;
228 size_t publicationCookie;
229 size_t pendingCookie;
231 size_t completedCookie;
232 size_t completedBatches;
235 size_t activeCallbackStartedTimestamp;
236 size_t lastWakeLatency;
237 size_t maximumWakeLatency;
238 size_t lastCallbackRuntime;
239 size_t maximumCallbackRuntime;
240 size_t interruptCount;
241 size_t spuriousCount;
242 size_t unhandledCount;
243 size_t publicationFailures;
244 size_t removalRejections;
245 size_t controllerContentions;
246 size_t controllerPromptAttempts;
247 size_t controllerPromptFailures;
248 size_t controllerPromptDestination;
249 size_t diagnosticPublicationFailures;
250 uintptr_t workerIdentity;
251 uintptr_t activeThreadedHandlerIdentity;
252 uintptr_t workerDebugAddress;
253 uintptr_t workerWaitQueue;
254 uintptr_t workerWaitChannelOwner;
255 uintptr_t workerWaitChannelValue;
256 size_t workerWaitStateLevel;
258 uint16_t maskReasons;
268 bool effectiveMasked;
269 bool requestedEnabled;
270 bool acknowledgementPending;
271 bool threadedPending;
272 bool dispatcherInitialised;
273 bool dispatcherActive;
274 bool dispatcherClosed;
275 bool hardStageActive;
276 bool workerDiagnosticAvailable;
277 bool workerWaitActive;
278 bool workerWaitQueued;
virtual bool registerPciMsixIrqHandlers(Device *device, IrqHandler *const *handlers, size_t count, irq_id_t *ids, bool &fallbackSafe, const size_t *processors=nullptr)