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

#include <Machine.h>

+ Inheritance diagram for HostedMachine:
+ Collaboration diagram for HostedMachine:

Public Member Functions

virtual void initialise () INITIALISATION_ONLY
 
virtual void initialise3 ()
 Called after processor startup - for thread creation etc.
 
virtual void deinitialise ()
 
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)
 
MUST_USE_RESULT bool quiesceAllOtherProcessors () override
 
MUST_USE_RESULT bool resumeAllOtherProcessors () override
 
MUST_USE_RESULT bool stopAllOtherProcessors () override
 
- Public Member Functions inherited from Machine
virtual bool supportsPowerOff () const
 
virtual bool prepareShutdown (ShutdownType type)
 
virtual void finalShutdown (ShutdownType type)
 
void displayShutdownMessage (const char *message)
 
virtual void initialise2 ()
 Called after debugger startup.
 
bool isInitialised ()
 

Static Public Member Functions

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

Private Member Functions

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

Private Attributes

HostedSerial m_Serial [2]
 
HostedVga m_Vga
 
Keyboard * m_Keyboard
 

Static Private Attributes

static HostedMachine 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 hosted systems

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

Constructor & Destructor Documentation

◆ HostedMachine()

HostedMachine::HostedMachine ( )
private

Default constructor, does nothing.

Definition at line 121 of file hosted/Machine.cc.

◆ ~HostedMachine()

HostedMachine::~HostedMachine ( )
privatevirtual

Virtual destructor, does nothing.

Definition at line 123 of file hosted/Machine.cc.

References deinitialise().

Member Function Documentation

◆ deinitialise()

void HostedMachine::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 60 of file hosted/Machine.cc.

References Machine::deinitialise(), HostedSchedulerTimer::instance(), HostedInterruptManager::quiesceProcessor(), HostedSchedulerTimer::uninitialise(), and HostedTimer::uninitialise().

Referenced by ~HostedMachine().

+ Here is the caller graph for this function:

◆ getIrqManager()

IrqManager * HostedMachine::getIrqManager ( )
virtual

Implements Machine.

Definition at line 89 of file hosted/Machine.cc.

◆ getKeyboard()

Keyboard * HostedMachine::getKeyboard ( )
virtual

Returns the keyboard device.

Implements Machine.

Definition at line 101 of file hosted/Machine.cc.

◆ getNumSerial()

size_t HostedMachine::getNumSerial ( )
virtual

Returns the number of Serial device.

Implements Machine.

Definition at line 77 of file hosted/Machine.cc.

◆ getNumVga()

size_t HostedMachine::getNumVga ( )
virtual

Returns the number of VGA devices.

Implements Machine.

Definition at line 85 of file hosted/Machine.cc.

◆ getSchedulerTimer()

SchedulerTimer * HostedMachine::getSchedulerTimer ( )
virtual

Returns the SchedulerTimer device.

Implements Machine.

Definition at line 93 of file hosted/Machine.cc.

References HostedSchedulerTimer::instance().

◆ getSerial()

Serial * HostedMachine::getSerial ( size_t  n)
virtual

Returns the n'th Serial device.

Implements Machine.

Definition at line 73 of file hosted/Machine.cc.

◆ getTimer()

Timer * HostedMachine::getTimer ( )
virtual

Returns the n'th Timer device.

Implements Machine.

Definition at line 97 of file hosted/Machine.cc.

◆ getVga()

Vga * HostedMachine::getVga ( size_t  n)
virtual

Returns the n'th VGA device.

Implements Machine.

Definition at line 81 of file hosted/Machine.cc.

◆ initialise()

void HostedMachine::initialise ( )
virtual

Initialises the machine.

Implements Machine.

Definition at line 36 of file hosted/Machine.cc.

References initialise(), Keyboard::initialise(), HostedSchedulerTimer::instance(), panic(), and HostedSerial::setBase().

Referenced by initialise().

+ Here is the caller graph for this function:

◆ initialise3()

void HostedMachine::initialise3 ( )
virtual

Called after processor startup - for thread creation etc.

Reimplemented from Machine.

Definition at line 54 of file hosted/Machine.cc.

References initialise3(), and panic().

Referenced by initialise3().

+ Here is the caller graph for this function:

◆ initialiseDeviceTree()

void HostedMachine::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 52 of file hosted/Machine.cc.

◆ instance()

static HostedMachine & HostedMachine::instance ( )
inlinestatic

Definition at line 38 of file kernel/machine/hosted/Machine.h.

◆ quiesceAllOtherProcessors()

bool HostedMachine::quiesceAllOtherProcessors ( )
overridevirtual

Temporarily pauses every other processor for an interactive debugger.

Reimplemented from Machine.

Definition at line 109 of file hosted/Machine.cc.

◆ resumeAllOtherProcessors()

bool HostedMachine::resumeAllOtherProcessors ( )
overridevirtual

Resumes processors paused by quiesceAllOtherProcessors().

Reimplemented from Machine.

Definition at line 113 of file hosted/Machine.cc.

◆ setKeyboard()

void HostedMachine::setKeyboard ( Keyboard *  kb)
virtual

Sets the keyboard device.

Implements Machine.

Definition at line 105 of file hosted/Machine.cc.

◆ stopAllOtherProcessors()

bool HostedMachine::stopAllOtherProcessors ( )
overridevirtual

Permanently stops all other cores for panic or terminal shutdown.

Returns
true if every other processor reached its terminal halt path.

Reimplemented from Machine.

Definition at line 117 of file hosted/Machine.cc.

Member Data Documentation

◆ m_Instance

HostedMachine HostedMachine::m_Instance
staticprivate

Definition at line 77 of file kernel/machine/hosted/Machine.h.

◆ m_Keyboard

Keyboard* HostedMachine::m_Keyboard
private

Definition at line 75 of file kernel/machine/hosted/Machine.h.

◆ m_Serial

HostedSerial HostedMachine::m_Serial[2]
private

Definition at line 73 of file kernel/machine/hosted/Machine.h.

◆ m_Vga

HostedVga HostedMachine::m_Vga
private

Definition at line 74 of file kernel/machine/hosted/Machine.h.


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