|
The Pedigree Project 0.1
|
#include <Machine.h>
Inheritance diagram for Machine:
Collaboration diagram for Machine:Public Member Functions | |
| virtual bool | supportsPowerOff () const |
| virtual bool | prepareShutdown (ShutdownType type) |
| virtual const char * | finalShutdown (ShutdownType type) |
| void | displayShutdownMessage (const char *message) |
| virtual void | initialise ()=0 |
| virtual void | initialise2 () |
| Called after debugger startup. | |
| virtual void | initialise3 () |
| Called after processor startup - for thread creation etc. | |
| virtual void | deinitialise () |
| bool | isInitialised () |
| virtual void | initialiseDeviceTree () |
| virtual Serial * | getSerial (size_t n)=0 |
| virtual size_t | getNumSerial ()=0 |
| virtual Vga * | getVga (size_t n)=0 |
| virtual size_t | getNumVga ()=0 |
| virtual IrqManager * | getIrqManager ()=0 |
| virtual SchedulerTimer * | getSchedulerTimer ()=0 |
| virtual Timer * | getTimer ()=0 |
| virtual Keyboard * | getKeyboard ()=0 |
| virtual void | setKeyboard (Keyboard *kb)=0 |
| virtual MUST_USE_RESULT bool | quiesceAllOtherProcessors () |
| virtual MUST_USE_RESULT bool | resumeAllOtherProcessors () |
| virtual MUST_USE_RESULT bool | stopAllOtherProcessors () |
Static Public Member Functions | |
| static void | setShutdownPhase (ShutdownPhase phase, const char *detail=nullptr) |
| static void | setShutdownDetail (const char *detail) |
| static const char * | shutdownPhaseName () |
| static Machine & | instance () |
Protected Attributes | |
| bool | m_bInitialised |
Private Member Functions | |
| Machine (const Machine &) | |
| Machine & | operator= (const Machine &) |
Friends | |
| void | system_reset () |
This is an abstraction on a machine, or board. It provides functions to retrieve Timers, Serial controllers, VGA controllers, Ethernet controllers etc, without having to know the exact implementation required or memory map. It also provides a "probe" function, which will attempt to detect if a machine is present.
Definition at line 41 of file include/pedigree/kernel/machine/Machine.h.
|
strong |
Definition at line 46 of file include/pedigree/kernel/machine/Machine.h.
|
strong |
Definition at line 45 of file include/pedigree/kernel/machine/Machine.h.
|
inlineprotected |
Definition at line 167 of file include/pedigree/kernel/machine/Machine.h.
|
protectedvirtual |
Definition at line 27 of file Machine.cc.
|
inlinevirtual |
Stops platform services while interrupts and the scheduler are alive. Implementations may synchronously drain callbacks and join workers.
Reimplemented in HostedMachine, Pc, and VirtMachine.
Definition at line 98 of file include/pedigree/kernel/machine/Machine.h.
Referenced by HostedMachine::deinitialise(), and VirtMachine::deinitialise().
Here is the caller graph for this function:| void Machine::displayShutdownMessage | ( | const char * | message | ) |
Writes through retained console providers without invoking log callbacks.
Definition at line 100 of file Machine.cc.
References Vga::getNumCols(), Vga::getNumRows(), getNumSerial(), getNumVga(), getSerial(), getVga(), Vga::moveCursor(), and Vga::setLargestTextMode().
Referenced by panic(), and setShutdownDetail().
Here is the caller graph for this function:
|
virtual |
Runs after all workers, devices and other processors have stopped. If it returns, provides a retained diagnostic string, or nullptr for halt.
Reimplemented in Pc, and VirtMachine.
Definition at line 93 of file Machine.cc.
References ProcessorBase::reset().
Referenced by ProcessorBase::reset().
Here is the caller graph for this function:
|
pure virtual |
Returns the keyboard device.
Implemented in HostedMachine, Pc, and VirtMachine.
Referenced by Debugger::start().
Here is the caller graph for this function:
|
pure virtual |
Returns the number of Serial device.
Implemented in HostedMachine, Pc, and VirtMachine.
Referenced by displayShutdownMessage().
Here is the caller graph for this function:
|
pure virtual |
Returns the number of VGA devices.
Implemented in HostedMachine, Pc, and VirtMachine.
Referenced by displayShutdownMessage(), panic(), and Debugger::start().
Here is the caller graph for this function:
|
pure virtual |
Returns the SchedulerTimer device.
Implemented in HostedMachine, Pc, and VirtMachine.
Referenced by PerProcessorScheduler::initialise(), and Rtc::initialise3().
Here is the caller graph for this function:
|
pure virtual |
Returns the n'th Serial device.
Implemented in HostedMachine, Pc, and VirtMachine.
Referenced by _assert(), Log::addEntry(), displayShutdownMessage(), SlamCommand::execute(), panic(), Rtc::processElapsedTime(), HostedTimer::processTimerBatch(), and Debugger::start().
Here is the caller graph for this function:
|
pure virtual |
Returns the n'th Timer device.
Implemented in HostedMachine, Pc, and VirtMachine.
Referenced by CacheManager::initialise(), IntervalTimer::IntervalTimer(), HidInputManager::keyDown(), RequestQueue::resume(), Uhci::timer(), and PerProcessorScheduler::timer().
Here is the caller graph for this function:
|
pure virtual |
Returns the n'th VGA device.
Implemented in HostedMachine, Pc, and VirtMachine.
Referenced by FramebufferFile::command(), displayShutdownMessage(), BootIO::initialise(), TextIO::initialise(), and panic().
Here is the caller graph for this function:
|
pure virtual |
Initialises the machine.
Implemented in HostedMachine, Pc, and VirtMachine.
|
inlinevirtual |
Called after debugger startup.
Definition at line 91 of file include/pedigree/kernel/machine/Machine.h.
|
inlinevirtual |
Called after processor startup - for thread creation etc.
Reimplemented in HostedMachine, Pc, and VirtMachine.
Definition at line 93 of file include/pedigree/kernel/machine/Machine.h.
|
inlinevirtual |
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 in HostedMachine, Pc, and VirtMachine.
Definition at line 110 of file include/pedigree/kernel/machine/Machine.h.
|
static |
Definition at line 32 of file hosted/Machine.cc.
|
inline |
Definition at line 101 of file include/pedigree/kernel/machine/Machine.h.
|
inlinevirtual |
Prepares firmware and drains its workers while scheduling is available.
Reimplemented in Pc.
Definition at line 76 of file include/pedigree/kernel/machine/Machine.h.
|
virtual |
Temporarily pauses every other processor for an interactive debugger.
Reimplemented in HostedMachine.
Definition at line 149 of file Machine.cc.
References EMIT_IF.
Referenced by Debugger::start().
Here is the caller graph for this function:
|
virtual |
Resumes processors paused by quiesceAllOtherProcessors().
Reimplemented in HostedMachine.
Definition at line 156 of file Machine.cc.
References EMIT_IF.
|
pure virtual |
Sets the keyboard device.
Implemented in HostedMachine, Pc, and VirtMachine.
|
static |
Updates progress only when a shutdown has already been requested.
Definition at line 38 of file Machine.cc.
References displayShutdownMessage().
Referenced by Ehci::cancelInterruptInAndDrain(), and setShutdownPhase().
Here is the caller graph for this function:
|
static |
Publishes progress directly to the retained console and serial output.
Definition at line 33 of file Machine.cc.
References setShutdownDetail().
Referenced by Pc::deinitialise(), and KernelElf::unloadModules().
Here is the caller graph for this function:
|
static |
Definition at line 54 of file Machine.cc.
|
virtual |
Permanently stops all other cores for panic or terminal shutdown.
Reimplemented in HostedMachine.
Definition at line 163 of file Machine.cc.
References EMIT_IF.
Referenced by panic().
Here is the caller graph for this function:
|
inlinevirtual |
Definition at line 72 of file include/pedigree/kernel/machine/Machine.h.
|
friend |
Definition at line 655 of file system/kernel/core/main.cc.
|
protected |
Definition at line 170 of file include/pedigree/kernel/machine/Machine.h.