miosix Namespace Reference


Classes

class  Console
class  Filesystem
class  Directory
class  InterruptDisableLock
class  InterruptEnableLock
class  PauseKernelLock
class  RestartKernelLock
class  Thread
class  GreaterPriority
class  Mutex
class  Lock
class  Unlock
class  ConditionVariable
class  Timer
class  Queue
class  MemoryProfiling

Enumerations

enum  Error {
  INVALID_PARAMETERS, OUT_OF_MEMORY, STACK_OVERFLOW, UNEXPECTED,
  PAUSE_KERNEL_NESTING, DISABLE_INTERRUPTS_NESTING, MUTEX_DEADLOCK, MUTEX_UNLOCK_NOT_OWNER,
  NESTING_OVERFLOW, PROPAGATED_EXCEPTION, INTERRUPTS_ENABLED_AT_BOOT
}
enum  Attrib {
  READ_ONLY = 0x01, HIDDEN = 0x02, SYSTEM = 0x04, VOLUME_ID = 0x08,
  DIRECTORY = 0x10, ARCHIVE = 0x20
}

Functions

void shutdown ()
void reboot ()
void delayMs (unsigned int mseconds)
void delayUs (unsigned int useconds)
void error_handler (Error e)
void disable_interrupts ()
void enable_interrupts ()
void pause_kernel ()
void restart_kernel ()
bool are_interrupts_enabled ()
bool is_kernel_running ()
unsigned long long get_tick ()
void IRQfind_next_thread ()
void bootlog (const char *string)
void IRQbootlog (const char *string)
void errorLog (const char *string)
void IRQerrorLog (const char *string)
void mem_dump (char *start, int len)
unsigned int get_max_heap ()
const char * getMiosixVersion ()

Variables

const unsigned char MAX_OPEN_FILES = 8
 Maximum number of open files. Trying to open more will fail.
const unsigned int STACK_MIN = 384
 Minimum stack size (MUST be divisible by 4).
const unsigned int STACK_DEFAULT_FOR_PTHREAD = 2048+512
const short int PRIORITY_MAX = 4
const unsigned char MAIN_PRIORITY = 1
const char *const versionString = "Miosix v1.54"

Detailed Description

All user available kernel functions, classes are inside this namespace.


Enumeration Type Documentation

This enum will be passed as argument to the error handler.
If the error is marked UNRECOVERABLE, then the error handler will not return.

Enumerator:
INVALID_PARAMETERS  A function/method was called with invalid parameters.
Error is recoverable.
OUT_OF_MEMORY  The heap is full, malloc/new returned NULL.
Whether error is recoverable is architecture specific.
STACK_OVERFLOW  The stack of a thread overflowed.
Error is UNRECOVERABLE.
UNEXPECTED  Unexpected error occurred.
Error is UNRECOVERABLE.
PAUSE_KERNEL_NESTING  A call to restartKernel that does not match a previous call to pauseKernel
Error is UNRECOVERABLE
DISABLE_INTERRUPTS_NESTING  A call to enableInterrupts that does not match a previous call to disableInterrupts
Error is UNRECOVERABLE
MUTEX_DEADLOCK  An attempt to lock twice a non recursive mutex happened.
Error is UNRECOVERABLE
MUTEX_UNLOCK_NOT_OWNER  An attempt to call unlock() on a mutex without first calling lock has been detected.
NESTING_OVERFLOW  The calls to pauseKernel or disableInterrupts were nested too much. Error is UNRECOVERABLE
PROPAGATED_EXCEPTION  An uncaught exception propagated throug a thread's entry point. Error is recoverable.
INTERRUPTS_ENABLED_AT_BOOT  Interrupts are wrongly enabled during boot Error is unrecoverable


Function Documentation

void miosix::bootlog ( const char *  string  )  [inline]

Print boot logs on the Console. Can only be called when the kernel is running.

Parameters:
string to print

void miosix::error_handler ( Error  e  ) 

Handles errors generated by kernel. Prints an error message on the Console (only if WITH_ERRLOG is defined in miosix_config.h). For information about possible errors, see the enum Error Can be called with the kernel not started, started, paused, with interrupts disabled and within an interrupt routine.

void miosix::errorLog ( const char *  string  )  [inline]

Print eror logs on the Console. Can only be called when the kernel is running.

Parameters:
string to print

unsigned int miosix::get_max_heap (  ) 

This function has nothing to do with syscalls, it is used by system.cpp to implement heap usege statistics. FIXME: If this function is called when _sbrk_r has never been called it will return a wrong value (0)

void miosix::IRQbootlog ( const char *  string  )  [inline]

Print boot logs on the Console. Can only be called when the kernel is not yet running or paused, or within an IRQ.

Parameters:
string to print

void miosix::IRQerrorLog ( const char *  string  )  [inline]

Print error logs on the Console. Can only be called when the kernel is not yet running or paused, or within an IRQ.

Parameters:
string to print


Variable Documentation

const char* const miosix::versionString = "Miosix v1.54"

Kernel verision is stored in this string.


Generated on Mon Aug 30 00:05:00 2010 for Miosix by  doxygen 1.5.9