For MSP430 boards oneway-malloc is already used *if* `malloc.h` was
included. The problem is that `malloc.h` is not a standard header, even
though it is common. `stdlib.h` in the right place to look for
`malloc()` and friends.
This change removes this discrepancy. `malloc()` is just named like
that, without the leading underscore. The symbols now are weak, which
means that they won't override library functions if MSP's standard
library will provide these functions at some point. (Unlikely, since
using `malloc()` on tiny systems is less then optimal ...)
Closes#1061 and #863.
Before only the hardware timer's own interrupt was being disabled.
This led to a race condition in the following scenario:
```
Thread1:
hwtimer_remove()
hwtimer_arch_disable_interrupt();
// INTERRUPT -> Thread2 (which has a higher priority than Thread1) gets scheduled
Thread2:
...
hwtimer_remove()
hwtimer_arch_disable_interrupt(); // hwtimer interrupt is already disabled
...
hwtimer_arch_enable_interrupt();
...
// yield | terminate -> Thread1 gets scheduled again
Thread1:
... // these instructions are being run with the hwtimer interrupt enabled
hwtimer_arch_enable_interrupt(); // hwtimer interrupt is already enabled
```
Fixes#924
- Included a collection of cpu-dependent headers in core/include/arch
- Extracted all interfaces that need to be implemented for a cpu
- Created a mapping between those interfaces and the old ones
- added flag for disabling arch interface
- added missing state to lpm_arch interface
- added arch interface for reboot
- fixed newline issues that were pointed out
- documentation fixes to cpu-core interface
and added `UNREACHABLE();` to hint the compiler unreachable lines
added right signature for first parameter of `thread_stack_init()`
added `UNREACHABLE();` macro to `cpu/lpc1768/atom.c` and `cpu/msp430-common/cpu.c`
Closes#726.
The thread state `STATUS_TIMER_WAITING` is not used anymore.
This PR removes the value.
The number in `STATUS_ON_RUNQUEUE` is replaced by a reference.