add optional callback for task switching
For reasons of system monitoring it is sometimes desirable to have the ability to track task switches.
This patch does add a function (rt_switch_prehook) implemented as weak reference.
As of now this is implemented with __weak keyword of armcc.
GCC (__attribute__((weak))) and IAR (#pragma weak) have similar features, but would require some compiler selective coding.
If there is some feedback on this patch I can add support for those compilers.
Such a hook would be really great. Please add it to the RTOS. Nitpicking: I would prefer if the function was called rt_preswitch_hook() because it is a hook that is executed before switching the context. What would a pre-hook be? :-)