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

#include <Pc.h>

+ Inheritance diagram for Pc:
+ Collaboration diagram for Pc:

Public Member Functions

virtual void initialise () INITIALISATION_ONLY
 
virtual void initialise3 ()
 Called after processor startup - for thread creation etc.
 
virtual void deinitialise ()
 
bool supportsPowerOff () const override
 
bool prepareShutdown (ShutdownType type) override
 
void finalShutdown (ShutdownType type) override
 
virtual void initialiseDeviceTree ()
 
virtual Serial * getSerial (size_t n)
 
virtual size_t getNumSerial ()
 
virtual Vga * getVga (size_t n)
 
virtual size_t getNumVga ()
 
virtual IrqManager * getIrqManager ()
 
virtual SchedulerTimer * getSchedulerTimer ()
 
virtual Timer * getTimer ()
 
virtual Keyboard * getKeyboard ()
 
virtual void setKeyboard (Keyboard *kb)
 
bool localApicAvailable () const
 
- Public Member Functions inherited from Machine
void displayShutdownMessage (const char *message)
 
virtual void initialise2 ()
 Called after debugger startup.
 
bool isInitialised ()
 
virtual MUST_USE_RESULT bool quiesceAllOtherProcessors ()
 
virtual MUST_USE_RESULT bool resumeAllOtherProcessors ()
 
virtual MUST_USE_RESULT bool stopAllOtherProcessors ()
 

Static Public Member Functions

static Pc & instance ()
 
- Static Public Member Functions inherited from Machine
static void setShutdownPhase (ShutdownPhase phase)
 
static const char * shutdownPhaseName ()
 
static Machine & instance ()
 

Private Member Functions

 Pc () INITIALISATION_ONLY
 
 Pc (const Pc &)
 
Pc & operator= (const Pc &)
 
virtual ~Pc ()
 

Private Attributes

X86Serial * m_pSerial [4]
 
X86Vga * m_Vga
 
Keyboard * m_pKeyboard
 
PcSchedulerTimerSelection m_SchedulerTimerSelection
 
X86Keyboard * m_Keyboard
 
Bus * m_IsaBus
 
Controller * m_AtaMaster
 
Controller * m_AtaSlave
 
Ps2Controller * m_Ps2Controller
 
Device * m_Watchdog
 

Static Private Attributes

static Pc m_Instance
 

Additional Inherited Members

- Public Types inherited from Machine
enum class  ShutdownType { Restart , Halt , PowerOff }
 
enum class  ShutdownPhase {
  NotStarted , Requested , Userspace , Syscalls ,
  Filesystems , Modules , Firmware , Destructors ,
  Input , Caches , Timers , Devices ,
  Processors , ProcessorCleanup , FinalAction
}
 
- Protected Attributes inherited from Machine
bool m_bInitialised
 

Detailed Description

Concretion of the abstract Machine class for x86 and x64 machines

Definition at line 48 of file Pc.h.

Constructor & Destructor Documentation

◆ Pc()

Pc::Pc ( )
private

Default constructor, does nothing.

Definition at line 386 of file Pc.cc.

◆ ~Pc()

Pc::~Pc ( )
privatevirtual

Virtual destructor, does nothing.

Definition at line 405 of file Pc.cc.

Member Function Documentation

◆ deinitialise()

void Pc::deinitialise ( )
virtual

Stops platform services while interrupts and the scheduler are alive. Implementations may synchronously drain callbacks and join workers.

Reimplemented from Machine.

Definition at line 219 of file Pc.cc.

References Pic::instance(), Pit::instance(), panic(), Pit::uninitialise(), Ps2Controller::uninitialise(), and Rtc::uninitialise().

◆ finalShutdown()

void Pc::finalShutdown ( ShutdownType  type)
overridevirtual

Runs after all workers, devices and other processors have stopped.

Reimplemented from Machine.

Definition at line 128 of file Pc.cc.

References Machine::displayShutdownMessage(), and ProcessorBase::reset().

◆ getIrqManager()

IrqManager * Pc::getIrqManager ( )
virtual

Implements Machine.

Definition at line 335 of file Pc.cc.

◆ getKeyboard()

Keyboard * Pc::getKeyboard ( )
virtual

Returns the keyboard device.

Implements Machine.

Definition at line 352 of file Pc.cc.

◆ getNumSerial()

size_t Pc::getNumSerial ( )
virtual

Returns the number of Serial device.

Implements Machine.

Definition at line 323 of file Pc.cc.

◆ getNumVga()

size_t Pc::getNumVga ( )
virtual

Returns the number of VGA devices.

Implements Machine.

Definition at line 331 of file Pc.cc.

◆ getSchedulerTimer()

SchedulerTimer * Pc::getSchedulerTimer ( )
virtual

Returns the SchedulerTimer device.

Implements Machine.

Definition at line 339 of file Pc.cc.

References Pit::instance().

◆ getSerial()

Serial * Pc::getSerial ( size_t  n)
virtual

Returns the n'th Serial device.

Implements Machine.

Definition at line 319 of file Pc.cc.

◆ getTimer()

Timer * Pc::getTimer ( )
virtual

Returns the n'th Timer device.

Implements Machine.

Definition at line 348 of file Pc.cc.

◆ getVga()

Vga * Pc::getVga ( size_t  n)
virtual

Returns the n'th VGA device.

Implements Machine.

Definition at line 327 of file Pc.cc.

◆ initialise()

void Pc::initialise ( )
virtual

◆ initialise3()

void Pc::initialise3 ( )
virtual

Called after processor startup - for thread creation etc.

Reimplemented from Machine.

Definition at line 251 of file Pc.cc.

References initialise3(), Ps2Controller::initialise3(), Pic::instance(), and panic().

Referenced by initialise3().

+ Here is the caller graph for this function:

◆ initialiseDeviceTree()

void Pc::initialiseDeviceTree ( )
virtual

Initialises the machine's base device tree, if one exists, to prefill the tree with those devices that are not otherwise able to be detected via some sort of bus support.

Reimplemented from Machine.

Definition at line 264 of file Pc.cc.

References Device::addChild(), Device::addresses(), Device::addToRoot(), PciBus::initialise(), Device::setInterruptNumber(), Device::setParent(), and Device::setSpecificType().

◆ instance()

static Pc & Pc::instance ( )
inlinestatic

Definition at line 50 of file Pc.h.

◆ localApicAvailable()

bool Pc::localApicAvailable ( ) const
inline

Whether the bootstrap processor has a usable local APIC timer.

Definition at line 78 of file Pc.h.

◆ prepareShutdown()

bool Pc::prepareShutdown ( ShutdownType  type)
overridevirtual

Prepares firmware and drains its workers while scheduling is available.

Reimplemented from Machine.

Definition at line 120 of file Pc.cc.

◆ setKeyboard()

void Pc::setKeyboard ( Keyboard *  kb)
virtual

Sets the keyboard device.

Implements Machine.

Definition at line 356 of file Pc.cc.

◆ supportsPowerOff()

bool Pc::supportsPowerOff ( ) const
overridevirtual

Reimplemented from Machine.

Definition at line 112 of file Pc.cc.

Member Data Documentation

◆ m_AtaMaster

Controller* Pc::m_AtaMaster
private

Definition at line 123 of file Pc.h.

◆ m_AtaSlave

Controller* Pc::m_AtaSlave
private

Definition at line 124 of file Pc.h.

◆ m_Instance

Pc Pc::m_Instance
staticprivate

Definition at line 118 of file Pc.h.

◆ m_IsaBus

Bus* Pc::m_IsaBus
private

Definition at line 122 of file Pc.h.

◆ m_Keyboard

X86Keyboard* Pc::m_Keyboard
private

Definition at line 121 of file Pc.h.

◆ m_pKeyboard

Keyboard* Pc::m_pKeyboard
private

Definition at line 110 of file Pc.h.

◆ m_Ps2Controller

Ps2Controller* Pc::m_Ps2Controller
private

Definition at line 125 of file Pc.h.

◆ m_pSerial

X86Serial* Pc::m_pSerial[4]
private

Definition at line 108 of file Pc.h.

◆ m_SchedulerTimerSelection

PcSchedulerTimerSelection Pc::m_SchedulerTimerSelection
private

Definition at line 116 of file Pc.h.

◆ m_Vga

X86Vga* Pc::m_Vga
private

Definition at line 109 of file Pc.h.

◆ m_Watchdog

Device* Pc::m_Watchdog
private

Definition at line 126 of file Pc.h.


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