The Pedigree Project 0.1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
IrqEventCounter Class Reference

#include <IrqEventCounter.h>

+ Collaboration diagram for IrqEventCounter:

Public Member Functions

bool recordFromInterrupt (size_t occurrences=1)
 
size_t takeAll ()
 
bool pending () const
 
void reset ()
 

Private Member Functions

 IrqEventCounter (const IrqEventCounter &)=delete
 
IrqEventCounteroperator= (const IrqEventCounter &)=delete
 

Private Attributes

Atomic< size_t > m_Count
 

Detailed Description

Preserves the number of identical events captured by a split IRQ top half.

A work bit only says that a bottom half must run. Devices whose elapsed time or completion count matters use this counter alongside that bit so coalescing cannot silently discard occurrences.

Definition at line 22 of file IrqEventCounter.h.

Constructor & Destructor Documentation

◆ IrqEventCounter()

IrqEventCounter::IrqEventCounter ( )
inline

Definition at line 24 of file IrqEventCounter.h.

Member Function Documentation

◆ pending()

bool IrqEventCounter::pending ( ) const
inline

Definition at line 60 of file IrqEventCounter.h.

◆ recordFromInterrupt()

bool IrqEventCounter::recordFromInterrupt ( size_t  occurrences = 1)
inline

Records a batch with one bounded atomic operation.

Returns false when the exact batch cannot be represented. Callers must treat that loss of fidelity as fatal before assuming the batch was recorded.

Definition at line 33 of file IrqEventCounter.h.

Referenced by HostedTimer::hardIrq().

+ Here is the caller graph for this function:

◆ reset()

void IrqEventCounter::reset ( )
inline

Definition at line 64 of file IrqEventCounter.h.

◆ takeAll()

size_t IrqEventCounter::takeAll ( )
inline

Claims every event recorded before this atomic handoff.

Definition at line 52 of file IrqEventCounter.h.

Referenced by HostedTimer::threadedIrq().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_Count

Atomic<size_t> IrqEventCounter::m_Count
private

Definition at line 69 of file IrqEventCounter.h.


The documentation for this class was generated from the following file: