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

Public Member Functions

void initialise () override
 
void initialiseDeviceTree () override
 
void initialise3 () override
 Called after processor startup - for thread creation etc.
 
void deinitialise () override
 
bool supportsPowerOff () const override
 
void finalShutdown (ShutdownType type) override
 
Serial * getSerial (size_t n) override
 
size_t getNumSerial () override
 
Vga * getVga (size_t n) override
 
size_t getNumVga () override
 
IrqManager * getIrqManager () override
 
SchedulerTimer * getSchedulerTimer () override
 
Timer * getTimer () override
 
Keyboard * getKeyboard () override
 
void setKeyboard (Keyboard *keyboard) override
 
- Public Member Functions inherited from Machine
virtual bool prepareShutdown (ShutdownType type)
 
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 VirtMachine & instance ()
 
- Static Public Member Functions inherited from Machine
static void setShutdownPhase (ShutdownPhase phase)
 
static const char * shutdownPhaseName ()
 
static Machine & instance ()
 

Private Attributes

VirtSerial m_Serial
 
VirtKeyboard m_SerialKeyboard
 
Keyboard * m_Keyboard
 

Static Private Attributes

static VirtMachine 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

Definition at line 16 of file kernel/machine/mach_virt/Machine.h.

Constructor & Destructor Documentation

◆ VirtMachine()

VirtMachine::VirtMachine ( )
private

Definition at line 48 of file mach_virt/Machine.cc.

◆ ~VirtMachine()

VirtMachine::~VirtMachine ( )
overrideprivate

Definition at line 51 of file mach_virt/Machine.cc.

Member Function Documentation

◆ deinitialise()

void VirtMachine::deinitialise ( )
overridevirtual

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

Reimplemented from Machine.

Definition at line 86 of file mach_virt/Machine.cc.

References Machine::deinitialise(), and panic().

◆ finalShutdown()

void VirtMachine::finalShutdown ( ShutdownType  type)
overridevirtual

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

Reimplemented from Machine.

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

◆ getIrqManager()

IrqManager * VirtMachine::getIrqManager ( )
overridevirtual

Implements Machine.

Definition at line 129 of file mach_virt/Machine.cc.

◆ getKeyboard()

Keyboard * VirtMachine::getKeyboard ( )
overridevirtual

Returns the keyboard device.

Implements Machine.

Definition at line 141 of file mach_virt/Machine.cc.

◆ getNumSerial()

size_t VirtMachine::getNumSerial ( )
overridevirtual

Returns the number of Serial device.

Implements Machine.

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

◆ getNumVga()

size_t VirtMachine::getNumVga ( )
overridevirtual

Returns the number of VGA devices.

Implements Machine.

Definition at line 125 of file mach_virt/Machine.cc.

◆ getSchedulerTimer()

SchedulerTimer * VirtMachine::getSchedulerTimer ( )
overridevirtual

Returns the SchedulerTimer device.

Implements Machine.

Definition at line 133 of file mach_virt/Machine.cc.

◆ getSerial()

Serial * VirtMachine::getSerial ( size_t  n)
overridevirtual

Returns the n'th Serial device.

Implements Machine.

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

◆ getTimer()

Timer * VirtMachine::getTimer ( )
overridevirtual

Returns the n'th Timer device.

Implements Machine.

Definition at line 137 of file mach_virt/Machine.cc.

◆ getVga()

Vga * VirtMachine::getVga ( size_t  n)
overridevirtual

Returns the n'th VGA device.

Implements Machine.

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

◆ initialise()

void VirtMachine::initialise ( )
overridevirtual

Initialises the machine.

Implements Machine.

Definition at line 59 of file mach_virt/Machine.cc.

References VirtKeyboard::initialise(), initialise(), panic(), VirtSerial::setBase(), and VirtDeviceTree::uartBase().

Referenced by initialise().

+ Here is the caller graph for this function:

◆ initialise3()

void VirtMachine::initialise3 ( )
overridevirtual

Called after processor startup - for thread creation etc.

Reimplemented from Machine.

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

References initialise3(), and panic().

Referenced by initialise3().

+ Here is the caller graph for this function:

◆ initialiseDeviceTree()

void VirtMachine::initialiseDeviceTree ( )
overridevirtual

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 55 of file mach_virt/Machine.cc.

References PciBus::initialise().

◆ instance()

VirtMachine & VirtMachine::instance ( )
static

Definition at line 44 of file mach_virt/Machine.cc.

◆ setKeyboard()

void VirtMachine::setKeyboard ( Keyboard *  kb)
overridevirtual

Sets the keyboard device.

Implements Machine.

Definition at line 145 of file mach_virt/Machine.cc.

◆ supportsPowerOff()

bool VirtMachine::supportsPowerOff ( ) const
overridevirtual

Reimplemented from Machine.

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

Member Data Documentation

◆ m_Instance

VirtMachine VirtMachine::m_Instance
staticprivate

Definition at line 45 of file kernel/machine/mach_virt/Machine.h.

◆ m_Keyboard

Keyboard* VirtMachine::m_Keyboard
private

Definition at line 43 of file kernel/machine/mach_virt/Machine.h.

◆ m_Serial

VirtSerial VirtMachine::m_Serial
private

Definition at line 41 of file kernel/machine/mach_virt/Machine.h.

◆ m_SerialKeyboard

VirtKeyboard VirtMachine::m_SerialKeyboard
private

Definition at line 42 of file kernel/machine/mach_virt/Machine.h.


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