|
The Pedigree Project 0.1
|
#include <PicIrqState.h>
Collaboration diagram for PicControllerStateGate:Classes | |
| struct | PendingActions |
Public Member Functions | |
| bool | tryAcquireClean () |
| bool | tryClaim () |
| size_t | currentLifetime (size_t irq) const |
| void | beginLineTransition (size_t irq) |
| size_t | finishLineTransition (size_t irq) |
| bool | queueEntry (size_t irq, size_t lifetime) |
| bool | queueTail (size_t irq, size_t lifetime, bool owesEoi) |
| bool | queueTailRecord (size_t irq) |
| bool | takePending (PendingActions &actions) |
| bool | releaseIfIdle () |
| bool | hasPending () const |
| bool | urgentPending () const |
| void | requestContinuation () |
| bool | relinquishOwnerForContinuation () |
Static Public Attributes | |
| static constexpr size_t | LineCount = PicIrqState::LineCount |
| static constexpr size_t | CountBits = 12 |
| static constexpr size_t | CountMask = (static_cast<size_t>(1) << CountBits) - 1 |
| static constexpr size_t | LifetimeMask = static_cast<size_t>(~static_cast<size_t>(0)) >> CountBits |
| static constexpr size_t | TransitionLifetime = LifetimeMask |
Private Member Functions | |
| void | replaceLifetime (size_t irq, size_t lifetime) |
| void | publishPending (bool urgent) |
| PicControllerStateGate (const PicControllerStateGate &)=delete | |
| PicControllerStateGate & | operator= (const PicControllerStateGate &)=delete |
Static Private Member Functions | |
| static size_t | tagged (size_t lifetime, size_t count) |
| static size_t | taggedLifetime (size_t value) |
| static size_t | taggedCount (size_t value) |
| static void | addStale (size_t &counter, size_t count) |
| static void | queueTagged (size_t ¤tCounter, size_t &staleCounter, size_t lifetime) |
| static void | takeTagged (size_t ¤tCounter, size_t &staleCounter, size_t lifetime, size_t ¤t, size_t &stale) |
Private Attributes | |
| size_t | m_State |
| size_t | m_LifetimeGenerations [LineCount] |
| size_t | m_LineLifetimes [LineCount] |
| size_t | m_EntryCounts [LineCount] |
| size_t | m_TailNoEoiCounts [LineCount] |
| size_t | m_TailEoiCounts [LineCount] |
| size_t | m_StaleEntryCounts [LineCount] |
| size_t | m_StaleTailNoEoiCounts [LineCount] |
| size_t | m_StaleTailEoiCounts [LineCount] |
Static Private Attributes | |
| static constexpr size_t | Clean = 0 |
| static constexpr size_t | Owner = 1U << 0 |
| static constexpr size_t | Pending = 1U << 1 |
| static constexpr size_t | Urgent = 1U << 2 |
Lock-free ownership handoff for access to the shared 8259 controllers.
Producers first account their deferred action, then publish Pending before attempting to become Owner. The current owner can therefore clear Pending and retain ownership in one compare-and-swap, while release can only succeed from an exactly idle Owner state.
Definition at line 489 of file PicIrqState.h.
|
inline |
Definition at line 535 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 691 of file PicIrqState.h.
|
inline |
Prevents in-flight old work from qualifying against a changing line.
Definition at line 573 of file PicIrqState.h.
|
inline |
Definition at line 567 of file PicIrqState.h.
|
inline |
Publishes a fresh handler-set lifetime after a line transition.
Definition at line 579 of file PicIrqState.h.
|
inline |
Definition at line 653 of file PicIrqState.h.
|
inlineprivate |
Definition at line 750 of file PicIrqState.h.
|
inline |
Queues controller-entry work and elects an owner if one is needed.
Definition at line 592 of file PicIrqState.h.
References tryClaim().
|
inlinestaticprivate |
Definition at line 697 of file PicIrqState.h.
|
inline |
Queues controller-tail work, preserving its EOI obligation.
Definition at line 600 of file PicIrqState.h.
References tryClaim().
|
inline |
Announces a complete tail record published in separate fixed storage.
Definition at line 612 of file PicIrqState.h.
References tryClaim().
|
inline |
Releases ownership only if no producer has published pending work.
Definition at line 647 of file PicIrqState.h.
|
inline |
Hands only non-urgent pending work to a guaranteed continuation.
Definition at line 667 of file PicIrqState.h.
|
inlineprivate |
Definition at line 730 of file PicIrqState.h.
|
inline |
Keeps ownership discoverable while a thread-context continuation wakes.
Definition at line 662 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 679 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 687 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 683 of file PicIrqState.h.
|
inline |
Atomically claims the published batch while retaining ownership.
Definition at line 619 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 717 of file PicIrqState.h.
|
inline |
Acquires ownership only when no work is already pending.
Definition at line 549 of file PicIrqState.h.
|
inline |
Claims an unowned clean or pending gate in one attempt.
Definition at line 556 of file PicIrqState.h.
Referenced by queueEntry(), queueTail(), and queueTailRecord().
Here is the caller graph for this function:
|
inline |
Definition at line 657 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 674 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 492 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 493 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 494 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 491 of file PicIrqState.h.
|
private |
Definition at line 757 of file PicIrqState.h.
|
private |
Definition at line 755 of file PicIrqState.h.
|
private |
Definition at line 756 of file PicIrqState.h.
|
private |
Definition at line 760 of file PicIrqState.h.
|
private |
Definition at line 762 of file PicIrqState.h.
|
private |
Definition at line 761 of file PicIrqState.h.
|
private |
Definition at line 754 of file PicIrqState.h.
|
private |
Definition at line 759 of file PicIrqState.h.
|
private |
Definition at line 758 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 675 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 676 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 495 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 677 of file PicIrqState.h.