RIOT-OS/RIOT — pull request #716 by Kijewski (2014-02-15 21:18:01+00:00)
Title: Make proper use of tcb_t::status bits

The run level of a thread is coded in its tcb_t::status. The values of
status are currently aligned like a bitmask. Nevertheless the run levels
are (of course) mutual exclusive: A thread cannot be sleeping and
running at the same time.

This change fixes this waste of bits. The run level is now coded in a
consecutive sequence. With LSB remaining a marker whether the thread is
on the run queue, there are five bits coding the run level of a thread.
Seven more run levels can be invented before the (new) run level mask
has to be incresed.

This edit changes quite a lot core code (`msg.c`, `sched.c`, `thread.c`)
as well as rather unrelated codes (`sixlowpan`, `destiny`, and `ps`).

Two new functions are introduced (`thread_runlevel()` and
`thread_runlevel_get()`), and one function is removed
`thread_getstatus()`. The rationale for the latter one is the lack of a
proper justification for this helper function. The new functions are
`static inline`, as they are trivial.