Miosix  2.01
miosix::DefaultConsole Class Reference

#include <console_device.h>

Public Member Functions

void IRQset (intrusive_ref_ptr< Device > console)
 
void set (intrusive_ref_ptr< Device > console)
 
intrusive_ref_ptr< Deviceget ()
 
intrusive_ref_ptr< DeviceIRQget ()
 

Static Public Member Functions

static DefaultConsoleinstance ()
 

Detailed Description

This class holds the file object related to the console, that is set by the board support package, and used to populate /dev/console in DevFs

Member Function Documentation

intrusive_ref_ptr<Device> miosix::DefaultConsole::get ( )
inline
Returns
the currently installed console device, wrapped in a TerminalDevice
DefaultConsole & miosix::DefaultConsole::instance ( )
static
Returns
an instance of this class (singleton)
intrusive_ref_ptr<Device> miosix::DefaultConsole::IRQget ( )
inline
Returns
the currently installed console device. Can be called with interrupts disabled or within an interrupt routine.
void miosix::DefaultConsole::IRQset ( intrusive_ref_ptr< Device console)

Called by the board support package, in particular IRQbspInit(), to pass to the kernel the console device. This device file is used as the default one for stdin/stdout/stderr. Notes: this has to be called in IRQbspInit(), since if it's called too late the console gets initialized with a NullFile. Also, calling this a second time to dynamically change the console device is probably a bad idea, as the device is cached around in the filesystem code and will result in some processes using the old device and some other the new one.

Parameters
consoledevice file handling console I/O. Can only be called with interrupts disabled.
void miosix::DefaultConsole::set ( intrusive_ref_ptr< Device console)
inline

Same as IRQset(), but can be called with interrupts enabled

Parameters
consoledevice file handling console I/O. Can only be called with interrupts disabled.

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