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

Public Member Functions

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

Static Public Member Functions

static HostedSchedulerTimer & instance ()
 

Protected Member Functions

 HostedSchedulerTimer () INITIALISATION_ONLY
 
virtual ~HostedSchedulerTimer ()
 
- Protected Member Functions inherited from SchedulerTimer
 SchedulerTimer ()
 
virtual ~SchedulerTimer ()
 

Private Member Functions

 HostedSchedulerTimer (const HostedSchedulerTimer &)
 
HostedSchedulerTimer & operator= (const HostedSchedulerTimer &)
 
virtual void schedulerIrq (irq_id_t number, InterruptState &state)
 

Private Attributes

irq_id_t m_IrqId
 
HostedTickSource m_TickSource
 
SchedulerTimerHandlerSlot m_Handler
 
bool m_bInitialized
 

Static Private Attributes

static HostedSchedulerTimer m_Instance
 

Additional Inherited Members

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

Detailed Description

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

Constructor & Destructor Documentation

◆ HostedSchedulerTimer() [1/2]

HostedSchedulerTimer::HostedSchedulerTimer ( )
protected

The default constructor

Definition at line 134 of file hosted/SchedulerTimer.cc.

◆ ~HostedSchedulerTimer()

HostedSchedulerTimer::~HostedSchedulerTimer ( )
protectedvirtual

The destructor

Definition at line 68 of file hosted/SchedulerTimer.cc.

References uninitialise().

◆ HostedSchedulerTimer() [2/2]

HostedSchedulerTimer::HostedSchedulerTimer ( const HostedSchedulerTimer &  )
private

The copy-constructor

Note
NOT implemented

Member Function Documentation

◆ initialise()

bool HostedSchedulerTimer::initialise ( )

Initialises the class

Returns
true, if successful, false otherwise

Definition at line 80 of file hosted/SchedulerTimer.cc.

References IrqManager::registerSchedulerIrqHandler(), and IrqManager::unregisterSchedulerIrqHandler().

◆ instance()

static HostedSchedulerTimer & HostedSchedulerTimer::instance ( )
inlinestatic

Get the HostedSchedulerTimer class instance

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

References m_Instance.

Referenced by HostedMachine::deinitialise(), HostedMachine::getSchedulerTimer(), and HostedMachine::initialise().

+ Here is the caller graph for this function:

◆ nominalQuantumNs()

uint64_t HostedSchedulerTimer::nominalQuantumNs ( ) const
overridevirtual

Implements SchedulerTimer.

Definition at line 34 of file hosted/SchedulerTimer.cc.

◆ operator=()

HostedSchedulerTimer & HostedSchedulerTimer::operator= ( const HostedSchedulerTimer &  )
private

The assignment operator

Note
NOT implemented

◆ registerHandler()

bool HostedSchedulerTimer::registerHandler ( SchedulerTimerHandler *  handler)
virtual

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

Implements SchedulerTimer.

Definition at line 72 of file hosted/SchedulerTimer.cc.

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

◆ removeHandler()

bool HostedSchedulerTimer::removeHandler ( SchedulerTimerHandler *  handler)
virtual

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 76 of file hosted/SchedulerTimer.cc.

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

◆ schedulerIrq()

void HostedSchedulerTimer::schedulerIrq ( irq_id_t  number,
InterruptState &  state 
)
privatevirtual

Implements SchedulerIrqHandler.

Definition at line 137 of file hosted/SchedulerTimer.cc.

◆ uninitialise()

void HostedSchedulerTimer::uninitialise ( )

Uninitialises the class

Definition at line 108 of file hosted/SchedulerTimer.cc.

References IrqManager::unregisterSchedulerIrqHandler().

Referenced by HostedMachine::deinitialise(), and ~HostedSchedulerTimer().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_bInitialized

bool HostedSchedulerTimer::m_bInitialized
private

Definition at line 99 of file kernel/machine/hosted/SchedulerTimer.h.

◆ m_Handler

SchedulerTimerHandlerSlot HostedSchedulerTimer::m_Handler
private

The atomically published scheduler callback owner.

Definition at line 97 of file kernel/machine/hosted/SchedulerTimer.h.

Referenced by registerHandler(), and removeHandler().

◆ m_Instance

HostedSchedulerTimer HostedSchedulerTimer::m_Instance
staticprivate

The HostedSchedulerTimer class instance

Definition at line 106 of file kernel/machine/hosted/SchedulerTimer.h.

Referenced by instance().

◆ m_IrqId

irq_id_t HostedSchedulerTimer::m_IrqId
private

Definition at line 93 of file kernel/machine/hosted/SchedulerTimer.h.

◆ m_TickSource

HostedTickSource HostedSchedulerTimer::m_TickSource
private

Definition at line 94 of file kernel/machine/hosted/SchedulerTimer.h.


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