API providing standardized access to various aspects required by userland. More...
API providing standardized access to various aspects required by userland.
uint32_t diff_microtime | ( | uint32_t | older_timestamp, |
uint32_t | newer_timestamp | ||
) |
Calculate a distance of two timestamps Small helper function to calculate the time between two timestamps.
It will calculate the distance of two timestamps taking possible time counter wraparound. It assumes the order of timestamps is older first, newer last.
[in] | older_timestamp | timestamp of event that happened first |
[in] | newer_timestamp | timestamp of event that happened last |
__SYSCALL long get_cpu_freq | ( | void | ) |
Obtain the current CPU frequency.
Give userspace applications access to the current CPU frequency.
__SYSCALL uint32_t getmicrotime | ( | void | ) |
Obtain the current scheduler time.
Returns current scheduler time. The time is returned with nanosecond resolution and precision depending on the timing provider implemented.
This value wraps around after about 4000 seconds on 32-bit CPUs
__SYSCALL uint32_t shutdown | ( | void | ) |
Shutdown CMRX kernel.
This syscall will initiate CMRX kernel shutdown. Kernel shutdown ensures that the timing provider is stopped. Interrupts are also disabled globally. No check on existing threads status is made. It is up to the application developer to ensure that threads are in stable state before kernel is shut down. Any work done and not saved in threads still active will be lost.
It is not possible to call CMRX system calls once kernel has been shut down. While in general, the possibility of restarting kernel after it has been shut down is not ruled out this workflow is considered as unsupported.
After kernel is shut down the execution will continue in function named cmrx_shutdown_handler(). If this function is not defined, then the CPU will be reset.
CPU state when cmrx_shutdown_handler() is called: