Semi-decennial update. 50% code inflation.
[cbaos.git] / arch / arm-cortex-m0 / include / sched.h
blobc5b7576d9b1eca6b3f8b353ce6cde547135fae21
1 #ifndef _ARCH_SCHED_H_
2 #define _ARCH_SCHED_H_
4 #include <types.h>
6 struct task_context {
7 u32 psp;
8 /* registers (r0-3, r12, lr, pc, xPSR) are saved on stack on exception entry
9 * afterwards we manually save r4-11 */
13 static inline u32 ms2ticks(u32 msecs)
15 return msecs * (CONFIG_FCPU/1000);
18 static inline u32 ticks2ms(u32 ticks)
20 return (ticks+CONFIG_FCPU/1000-1) / (CONFIG_FCPU/1000);
23 #define MSEC_IN_TICKSOVF ((u32)((0x100000000LL + CONFIG_FCPU/1000-1) / (CONFIG_FCPU/1000)))
25 #endif