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
Pit Class Reference

#include <Pit.h>

+ Inheritance diagram for Pit:
+ Collaboration diagram for Pit:

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 Pit & instance ()
 

Protected Member Functions

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

Private Member Functions

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

Private Attributes

IoPort m_IoPort
 
irq_id_t m_IrqId
 
SchedulerTimerHandlerSlot m_Handler
 

Static Private Attributes

static Pit m_Instance
 

Additional Inherited Members

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

Detailed Description

The programmable interval timer implements the SchedulerTimer interface

Definition at line 38 of file Pit.h.

Constructor & Destructor Documentation

◆ Pit() [1/2]

Pit::Pit ( )
protected

The default constructor

Definition at line 100 of file Pit.cc.

◆ ~Pit()

virtual Pit::~Pit ( )
inlineprotectedvirtual

The destructor

Definition at line 62 of file Pit.h.

◆ Pit() [2/2]

Pit::Pit ( const Pit &  )
private

The copy-constructor

Note
NOT implemented

Member Function Documentation

◆ initialise()

bool Pit::initialise ( )

Initialises the class

Returns
true, if successful, false otherwise

Definition at line 51 of file Pit.cc.

References IoPort::allocate(), m_IoPort, m_IrqId, IrqManager::registerSchedulerIrqHandler(), and IoPort::write8().

Referenced by Pc::initialise().

+ Here is the caller graph for this function:

◆ instance()

static Pit & Pit::instance ( )
inlinestatic

Get the Pit class instance

Definition at line 41 of file Pit.h.

References m_Instance.

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

+ Here is the caller graph for this function:

◆ nominalQuantumNs()

uint64_t Pit::nominalQuantumNs ( ) const
overridevirtual

Implements SchedulerTimer.

Definition at line 39 of file Pit.cc.

◆ operator=()

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

The assignment operator

Note
NOT implemented

◆ registerHandler()

bool Pit::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 43 of file Pit.cc.

References m_Handler, and SchedulerTimerHandlerSlot::publish().

◆ removeHandler()

bool Pit::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 47 of file Pit.cc.

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

◆ schedulerIrq()

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

Implements SchedulerIrqHandler.

Definition at line 102 of file Pit.cc.

◆ uninitialise()

void Pit::uninitialise ( )

Uninitialises the class

Definition at line 81 of file Pit.cc.

References IoPort::free(), m_IoPort, m_IrqId, and IrqManager::unregisterSchedulerIrqHandler().

Referenced by Pc::deinitialise().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_Handler

SchedulerTimerHandlerSlot Pit::m_Handler
private

The atomically published scheduler callback owner.

Definition at line 82 of file Pit.h.

Referenced by registerHandler(), and removeHandler().

◆ m_Instance

Pit Pit::m_Instance
staticprivate

The Pit class instance

Definition at line 85 of file Pit.h.

Referenced by instance().

◆ m_IoPort

IoPort Pit::m_IoPort
private

The PIT I/O port range

Definition at line 78 of file Pit.h.

Referenced by initialise(), and uninitialise().

◆ m_IrqId

irq_id_t Pit::m_IrqId
private

The PIT IRQ Id

Definition at line 80 of file Pit.h.

Referenced by initialise(), and uninitialise().


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