Fixes#1708.
Currently involuntary preemption causes the current thread not only to
yield for a higher prioritized thread, but all other threads of its own
priority class, too.
This PR adds the function `thread_yield_higher()`, which will yield the
current thread in favor of higher prioritized functions, but not for
threads of its own priority class.
Boards now need to implement `thread_yield_higher()` instead of
`thread_yield()`, but `COREIF_NG` boards are not affected in any way.
`thread_yield()` retains its old meaning: yield for every thread that
has the same or a higher priority.
This PR does not touch the occurrences of `thread_yield()` in the periph
drivers, because the author of this PR did not look into the logic of
the various driver implementations.
Right now the core component `clist` is a generic cyclic doubly-linked list.
In the core it is used in `tcb_t::rq_entry`.
Further it is used `net_if.c`.
This commit removes the member `clist_node_t::data` which stored the
pointer to the `tcb_t` instance of which the clist is already a member.
The needless member added `sizeof (int)` bytes to every instance of
`tcb_t`.
In `net_if.c` the clist was used in a type-punned way, so that the
change won't affect it.
In many places we needlessly use `sched_active_thread->pid` whilst we
already have `sched_active_pid` with the same value, and one less
indirection.
`thread_getpid()` is made `static inline` so that there is no penalty in
using this function over accessing `sched_active_pid` directly.
`tcp_t::stack_size` is only examined by the shell command `ps` and
`DEBUG_PRINT`. For the latter one only if `DEVELHELP` was enabled.
This PR guards the member `tcp_t::stack_size` in `#ifdef DEVELHELP`.
Only if DEVELHELP was activated its value get printed by `ps`.
Closes#1287.
Instead of using differing integer types use kernel_pid_t for process
identifier. This type is introduced in a new header file to avoid
circular dependencies.
`thread_wakeup` did not check if target pid is invalid.
`thread_wakeup` used `dINT` and `eINT` directly.
It should use `disableIRQ` and `restoreIRQ` instead, because there might
be other (good) reasons why one might want to call `thread_wakeup` with
interrupts disabled.
`thread_wakeup` yielded even if the other thread had a lower priority
than the current thread.
fix documentation - the return value is the opposite of what it said
add and improve comments
renamed space to space_free (the name is documentation as well)
* increased main priority to the half of maximum priority
* introduced define for minimum stack size
* decreased stack size for uart0 thread
* merged commands for rtc shell module to one command (date)
* cleanup of header includes