The Pedigree Project 0.1
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
VirtSchedulerTimer Class Reference
+ Inheritance diagram for VirtSchedulerTimer:
+ Collaboration diagram for VirtSchedulerTimer:

Public Member Functions

bool initialise ()
 
void uninitialise ()
 
bool registerHandler (SchedulerTimerHandler *handler) override
 
bool removeHandler (SchedulerTimerHandler *handler) override
 
uint64_t nominalQuantumNs () const override
 
- Public Member Functions inherited from SchedulerTimer
virtual bool supportsOneShot () const
 
virtual bool armDeadline (uint64_t)
 
virtual void disarm ()
 

Static Public Member Functions

static VirtSchedulerTimer & instance ()
 

Private Member Functions

void schedulerIrq (irq_id_t number, InterruptState &state) override
 
uint64_t counter () const
 
uint64_t ticksToNanoseconds (uint64_t ticks) const
 

Private Attributes

SchedulerTimerHandlerSlot m_Handler
 
uint64_t m_Frequency
 
uint64_t m_LastCount
 
uint32_t m_IntervalTicks
 
irq_id_t m_IrqId
 
bool m_Initialised
 

Static Private Attributes

static VirtSchedulerTimer m_Instance
 

Additional Inherited Members

- Protected Member Functions inherited from SchedulerTimer
 SchedulerTimer ()
 
virtual ~SchedulerTimer ()
 
- Static Protected Member Functions inherited from SchedulerTimer
static bool canRemoveHandlerInCurrentContext ()
 

Detailed Description

Definition at line 15 of file kernel/machine/mach_virt/SchedulerTimer.h.

Constructor & Destructor Documentation

◆ VirtSchedulerTimer()

VirtSchedulerTimer::VirtSchedulerTimer ( )
private

Definition at line 29 of file mach_virt/SchedulerTimer.cc.

◆ ~VirtSchedulerTimer()

VirtSchedulerTimer::~VirtSchedulerTimer ( )
overrideprivate

Definition at line 37 of file mach_virt/SchedulerTimer.cc.

Member Function Documentation

◆ counter()

uint64_t VirtSchedulerTimer::counter ( ) const
private

Definition at line 41 of file mach_virt/SchedulerTimer.cc.

◆ initialise()

bool VirtSchedulerTimer::initialise ( )

Definition at line 50 of file mach_virt/SchedulerTimer.cc.

◆ instance()

VirtSchedulerTimer & VirtSchedulerTimer::instance ( )
static

Definition at line 25 of file mach_virt/SchedulerTimer.cc.

◆ nominalQuantumNs()

uint64_t VirtSchedulerTimer::nominalQuantumNs ( ) const
overridevirtual

Implements SchedulerTimer.

Definition at line 98 of file mach_virt/SchedulerTimer.cc.

◆ registerHandler()

bool VirtSchedulerTimer::registerHandler ( SchedulerTimerHandler *  handler)
overridevirtual

Publish the sole hard scheduler-tick owner for the calling processor. Registration, dispatch, and removal are processor-local operations.

Implements SchedulerTimer.

Definition at line 90 of file mach_virt/SchedulerTimer.cc.

References ProcessorBase::id(), and SchedulerTimerHandlerSlot::publish().

◆ removeHandler()

bool VirtSchedulerTimer::removeHandler ( SchedulerTimerHandler *  handler)
overridevirtual

Remove the calling processor's exact current owner.

A successful return is a callback-lifetime barrier: the processor's timer hard frame cannot overlap ordinary removal, and later frames no longer admit the callback. Cross-processor removal is rejected and returns false; callers must arrange teardown on the registered CPU in IRQ-enabled ordinary thread context. The callback's scoped dispatch admission rejects self-removal; hard and synthetic interrupt contexts are rejected before unpublication.

Implements SchedulerTimer.

Definition at line 94 of file mach_virt/SchedulerTimer.cc.

References SchedulerTimer::canRemoveHandlerInCurrentContext(), ProcessorBase::id(), and SchedulerTimerHandlerSlot::unpublish().

◆ schedulerIrq()

void VirtSchedulerTimer::schedulerIrq ( irq_id_t  number,
InterruptState &  state 
)
overrideprivatevirtual

Implements SchedulerIrqHandler.

Definition at line 102 of file mach_virt/SchedulerTimer.cc.

◆ ticksToNanoseconds()

uint64_t VirtSchedulerTimer::ticksToNanoseconds ( uint64_t  ticks) const
private

Definition at line 45 of file mach_virt/SchedulerTimer.cc.

◆ uninitialise()

void VirtSchedulerTimer::uninitialise ( )

Definition at line 77 of file mach_virt/SchedulerTimer.cc.

Member Data Documentation

◆ m_Frequency

uint64_t VirtSchedulerTimer::m_Frequency
private

Definition at line 33 of file kernel/machine/mach_virt/SchedulerTimer.h.

◆ m_Handler

SchedulerTimerHandlerSlot VirtSchedulerTimer::m_Handler
private

Definition at line 32 of file kernel/machine/mach_virt/SchedulerTimer.h.

◆ m_Initialised

bool VirtSchedulerTimer::m_Initialised
private

Definition at line 37 of file kernel/machine/mach_virt/SchedulerTimer.h.

◆ m_Instance

VirtSchedulerTimer VirtSchedulerTimer::m_Instance
staticprivate

Definition at line 39 of file kernel/machine/mach_virt/SchedulerTimer.h.

◆ m_IntervalTicks

uint32_t VirtSchedulerTimer::m_IntervalTicks
private

Definition at line 35 of file kernel/machine/mach_virt/SchedulerTimer.h.

◆ m_IrqId

irq_id_t VirtSchedulerTimer::m_IrqId
private

Definition at line 36 of file kernel/machine/mach_virt/SchedulerTimer.h.

◆ m_LastCount

uint64_t VirtSchedulerTimer::m_LastCount
private

Definition at line 34 of file kernel/machine/mach_virt/SchedulerTimer.h.


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