Miosix
2.0alpha1
|
Classes | |
class | BufferQueue |
class | Callback |
class | CallbackBase |
class | ConditionVariable |
class | DefaultConsole |
class | DevFsFile |
class | Device |
class | DirectoryBase |
class | DynUnsyncQueue |
class | EventQueue |
class | FastInterruptDisableLock |
class | FastInterruptEnableLock |
class | FastMutex |
class | Fat32Directory |
class | Fat32File |
class | Fat32Fs |
class | FileBase |
class | FileDescriptorTable |
class | FilesystemBase |
class | FilesystemManager |
class | FixedEventQueue |
class | FixedEventQueueBase |
class | InterruptDisableLock |
class | InterruptEnableLock |
class | Intrusive |
class | intrusive_ref_ptr |
class | IntrusiveRefCounted |
class | IntrusiveRefCountedSharedFromThis |
class | Lcd44780 |
class | Lock |
class | LowerPriority |
class | MemoryProfiling |
class | MountpointFs |
class | MountpointFsDirectory |
class | Mutex |
class | PathResolution |
class | PauseKernelLock |
class | Queue |
class | ResolvedPath |
class | RestartKernelLock |
class | SoftwareI2C |
class | SoftwareSPI |
class | TerminalDevice |
class | Thread |
class | Timer |
class | Unicode |
class | Unlock |
Functions | |
void | basicFilesystemSetup (intrusive_ref_ptr< Device > dev) |
FileDescriptorTable & | getFileDescriptorTable () |
int | atomicSwap (volatile int *p, int v) |
void | atomicAdd (volatile int *p, int incr) |
int | atomicAddExchange (volatile int *p, int incr) |
int | atomicCompareAndSwap (volatile int *p, int prev, int next) |
void * | atomicFetchAndIncrement (void *const volatile *p, int offset, int incr) |
void | shutdown () |
void | reboot () |
void | delayMs (unsigned int mseconds) |
void | delayUs (unsigned int useconds) |
void | errorHandler (Error e) |
template<typename T , typename U > | |
bool | operator== (const intrusive_ref_ptr< T > &a, const intrusive_ref_ptr< U > &b) |
template<typename T , typename U > | |
bool | operator!= (const intrusive_ref_ptr< T > &a, const intrusive_ref_ptr< U > &b) |
template<typename T , typename U > | |
bool | operator< (const intrusive_ref_ptr< T > &a, const intrusive_ref_ptr< U > &b) |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const intrusive_ref_ptr< T > &p) |
template<typename T , typename U > | |
intrusive_ref_ptr< T > | static_pointer_cast (const intrusive_ref_ptr< U > &r) |
template<typename T , typename U > | |
intrusive_ref_ptr< T > | dynamic_pointer_cast (const intrusive_ref_ptr< U > &r) |
template<typename T , typename U > | |
intrusive_ref_ptr< T > | const_pointer_cast (const intrusive_ref_ptr< U > &r) |
template<typename T > | |
intrusive_ref_ptr< T > | atomic_load (const intrusive_ref_ptr< T > *p) |
template<typename T > | |
void | atomic_store (intrusive_ref_ptr< T > *p, intrusive_ref_ptr< T > r) |
template<typename T > | |
intrusive_ref_ptr< T > | atomic_exchange (intrusive_ref_ptr< T > *p, intrusive_ref_ptr< T > r) |
void | disableInterrupts () |
void | enableInterrupts () |
void | pauseKernel () |
void | restartKernel () |
bool | areInterruptsEnabled () |
bool | isKernelRunning () |
long long | getTick () |
void | fastDisableInterrupts () |
void | fastEnableInterrupts () |
void * | mainLoader (void *argv) |
unsigned short | crc16 (const void *message, unsigned int length) |
void | memDump (const void *start, int len) |
const char * | getMiosixVersion () |
Variables | |
const unsigned int | SERIAL_PORT_SPEED =115200 |
Serial port baudrate. | |
const unsigned int | AUX_SERIAL_SPEED =9600 |
Aux serial port baudrate. More... | |
const unsigned int | MAIN_STACK_SIZE =4*1024 |
const unsigned int | TICK_FREQ =200 |
const unsigned int | defaultSerial =1 |
Serial port. | |
const unsigned char | MAX_OPEN_FILES =8 |
const unsigned int | STACK_MIN =256 |
Minimum stack size (MUST be divisible by 4) | |
const unsigned int | STACK_DEFAULT_FOR_PTHREAD =2048 |
const unsigned int | MAX_PROCESS_IMAGE_SIZE =64*1024 |
const unsigned int | MIN_PROCESS_STACK_SIZE =STACK_MIN |
const unsigned int | SYSTEM_MODE_PROCESS_STACK_SIZE =2*1024 |
const short int | PRIORITY_MAX =4 |
const unsigned char | MAIN_PRIORITY =1 |
const float | kpi =0.5 |
const int | multFactor =static_cast<int>(1.0f/kpi) |
All user available kernel functions, classes are inside this namespace.
enum miosix::Error |
This enum will be passed as argument to the error handler.
If the error is marked UNRECOVERABLE, then the error handler will not return.
intrusive_ref_ptr<T> miosix::atomic_exchange | ( | intrusive_ref_ptr< T > * | p, |
intrusive_ref_ptr< T > | r | ||
) |
Allows concurrent access to an instance of intrusive_ref_ptr. Multiple threads can cooncurrently perform atomic_load(), atomic_store() and atomic_exchange() on the same intrusive_ref_ptr. Any other concurent access not protected by explicit locking (such as threads calling reset(), or using the copy constructor, or deleting the intrusive_ref_ptr) yields undefined behaviour.
p | pointer to an intrusive_ref_ptr shared among threads |
r | value to be stored in *p |
intrusive_ref_ptr<T> miosix::atomic_load | ( | const intrusive_ref_ptr< T > * | p | ) |
Allows concurrent access to an instance of intrusive_ref_ptr. Multiple threads can cooncurrently perform atomic_load(), atomic_store() and atomic_exchange() on the same intrusive_ref_ptr. Any other concurent access not protected by explicit locking (such as threads calling reset(), or using the copy constructor, or deleting the intrusive_ref_ptr) yields undefined behaviour.
p | pointer to an intrusive_ref_ptr shared among threads |
void miosix::atomic_store | ( | intrusive_ref_ptr< T > * | p, |
intrusive_ref_ptr< T > | r | ||
) |
Allows concurrent access to an instance of intrusive_ref_ptr. Multiple threads can cooncurrently perform atomic_load(), atomic_store() and atomic_exchange() on the same intrusive_ref_ptr. Any other concurent access not protected by explicit locking (such as threads calling reset(), or using the copy constructor, or deleting the intrusive_ref_ptr) yields undefined behaviour.
p | pointer to an intrusive_ref_ptr shared among threads |
r | intrusive_ref_ptr that will be stored in *p |
|
inline |
Atomically read the content of a memory location, add a number to the loaded value, and store the result. Performs atomically the following operation:
p | pointer to memory location where the atomic add will take place |
incr | value to be added to *p |
|
inline |
Atomically read the content of a memory location, add a number to the loaded value, store the result and return the previous value stored. Performs atomically the following operation:
pointer | to memory location where the atomic add will take place |
incr | value to be added to *p |
|
inline |
Atomically read the value of a memory location, and store a new value in it if it matches a given value. Also, return the previously stored value. Performs atomically the following operation:
p | pointer to the memory location to compare and swap |
prev | value to be compared against the content of *p |
next | value to be stored in *p if *p==prev |
|
inline |
An implementation of atomicFetchAndIncrement, as described in http://www.drdobbs.com/atomic-reference-counting-pointers/184401888 Atomically read a pointer stored in one memory loaction, and add a constant to a memory loaction placed at a given offset from the pointer. Performs atomically the following operation:
p | pointer to a const volatile pointer to object. While p is not subject to thread contention, *p is. |
offset | the memory location to increment is **p+offset*sizeof(int) |
incr | value to be added to **p+offset*sizeof(int) |
|
inline |
Store a value in one memory location, and atomically read back the previously stored value. Performs atomically the following operation:
p | pointer to memory location where the atomic swap will take place |
v | new value to be stored in *p |
void miosix::basicFilesystemSetup | ( | intrusive_ref_ptr< Device > | dev | ) |
This is a simplified function to mount the root and /dev filesystems, meant to be called from bspInit2(). It mounts a MountpointFs as root, then creates a /dev directory, and mounts /dev there. It also takes the passed device and if it is not null it adds the device di DevFs as /dev/sda. Last, it attempts to mount /dev/sda at /sd as a Fat32 filesystem. In case the bsp needs another filesystem setup, such as having a fat32 filesystem as /, this function can't be used, but instead the bsp needs to mount the filesystems manually.
dev | disk device that will be added as /dev/sda and mounted on /sd |
intrusive_ref_ptr<T> miosix::const_pointer_cast | ( | const intrusive_ref_ptr< U > & | r | ) |
Performs const_cast between intrusive_ref_ptr
r | intrusive_ref_ptr of source type |
unsigned short miosix::crc16 | ( | const void * | message, |
unsigned int | length | ||
) |
Calculate the ccitt crc16 on a string of bytes
message | string of bytes |
length | message length |
intrusive_ref_ptr<T> miosix::dynamic_pointer_cast | ( | const intrusive_ref_ptr< U > & | r | ) |
Performs dynamic_cast between intrusive_ref_ptr
r | intrusive_ref_ptr of source type |
void miosix::errorHandler | ( | 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.
FileDescriptorTable & miosix::getFileDescriptorTable | ( | ) |
< The only file table
void * miosix::mainLoader | ( | void * | argv | ) |
This function will perform the part of system initialization that must be done after the kernel is started. At the end, it will call main()
argv | ignored parameter |
bool miosix::operator!= | ( | const intrusive_ref_ptr< T > & | a, |
const intrusive_ref_ptr< U > & | b | ||
) |
Operator!=
a | first pointer |
b | second pointer |
bool miosix::operator< | ( | const intrusive_ref_ptr< T > & | a, |
const intrusive_ref_ptr< U > & | b | ||
) |
Operator<, allows to create containers of objects
a | first pointer |
b | second pointer |
std::ostream& miosix::operator<< | ( | std::ostream & | os, |
const intrusive_ref_ptr< T > & | p | ||
) |
Operator<<, allows printing of the pointer value on an ostream
os | ostream where to print the pointer value |
p | intrusive_ref_ptr to print |
bool miosix::operator== | ( | const intrusive_ref_ptr< T > & | a, |
const intrusive_ref_ptr< U > & | b | ||
) |
Operator==
a | first pointer |
b | second pointer |
intrusive_ref_ptr<T> miosix::static_pointer_cast | ( | const intrusive_ref_ptr< U > & | r | ) |
Performs static_cast between intrusive_ref_ptr
r | intrusive_ref_ptr of source type |
const float miosix::kpi =0.5 |
Run the scheduler using fixed point math only. Faster but less precise. Note that the inner integral regulators are always fixed point, this affects round partitioning and the external PI regulator. Also note this imposes a number of limits:
const int miosix::multFactor =static_cast<int>(1.0f/kpi) |
Implementation detail resulting from a fixed point implementation of the inner integral regulators. Never change this, change kpi instead.