|
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 505 of file PicIrqState.h.
|
inline |
Definition at line 551 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 707 of file PicIrqState.h.
|
inline |
Prevents in-flight old work from qualifying against a changing line.
Definition at line 589 of file PicIrqState.h.
|
inline |
Definition at line 583 of file PicIrqState.h.
|
inline |
Publishes a fresh handler-set lifetime after a line transition.
Definition at line 595 of file PicIrqState.h.
|
inline |
Definition at line 669 of file PicIrqState.h.
|
inlineprivate |
Definition at line 766 of file PicIrqState.h.
|
inline |
Queues controller-entry work and elects an owner if one is needed.
Definition at line 608 of file PicIrqState.h.
References tryClaim().
|
inlinestaticprivate |
Definition at line 713 of file PicIrqState.h.
|
inline |
Queues controller-tail work, preserving its EOI obligation.
Definition at line 616 of file PicIrqState.h.
References tryClaim().
|
inline |
Announces a complete tail record published in separate fixed storage.
Definition at line 628 of file PicIrqState.h.
References tryClaim().
|
inline |
Releases ownership only if no producer has published pending work.
Definition at line 663 of file PicIrqState.h.
|
inline |
Hands only non-urgent pending work to a guaranteed continuation.
Definition at line 683 of file PicIrqState.h.
|
inlineprivate |
Definition at line 746 of file PicIrqState.h.
|
inline |
Keeps ownership discoverable while a thread-context continuation wakes.
Definition at line 678 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 695 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 703 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 699 of file PicIrqState.h.
|
inline |
Atomically claims the published batch while retaining ownership.
Definition at line 635 of file PicIrqState.h.
|
inlinestaticprivate |
Definition at line 733 of file PicIrqState.h.
|
inline |
Acquires ownership only when no work is already pending.
Definition at line 565 of file PicIrqState.h.
|
inline |
Claims an unowned clean or pending gate in one attempt.
Definition at line 572 of file PicIrqState.h.
Referenced by queueEntry(), queueTail(), and queueTailRecord().
Here is the caller graph for this function:
|
inline |
Definition at line 673 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 690 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 508 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 509 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 510 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 507 of file PicIrqState.h.
|
private |
Definition at line 773 of file PicIrqState.h.
|
private |
Definition at line 771 of file PicIrqState.h.
|
private |
Definition at line 772 of file PicIrqState.h.
|
private |
Definition at line 776 of file PicIrqState.h.
|
private |
Definition at line 778 of file PicIrqState.h.
|
private |
Definition at line 777 of file PicIrqState.h.
|
private |
Definition at line 770 of file PicIrqState.h.
|
private |
Definition at line 775 of file PicIrqState.h.
|
private |
Definition at line 774 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 691 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 692 of file PicIrqState.h.
|
staticconstexpr |
Definition at line 511 of file PicIrqState.h.
|
staticconstexprprivate |
Definition at line 693 of file PicIrqState.h.