aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-08-21 08:38:14 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-08-21 08:38:14 +0000
commit138c0f900d823b2c953038048bc40b14610f958a (patch)
tree6c446a2ec08cba09ac2345dbb9b708139e3e1c85 /os/kernel/src
parent29226ecec7052b72ba82e8ba2eedb4c91d27ff28 (diff)
downloadChibiOS-138c0f900d823b2c953038048bc40b14610f958a.tar.gz
ChibiOS-138c0f900d823b2c953038048bc40b14610f958a.tar.bz2
ChibiOS-138c0f900d823b2c953038048bc40b14610f958a.zip
Added new kernel hooks (on halt and on systick).
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2136 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src')
-rw-r--r--os/kernel/src/chsys.c3
-rw-r--r--os/kernel/src/chthreads.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/os/kernel/src/chsys.c b/os/kernel/src/chsys.c
index d34e7e73a..22860b317 100644
--- a/os/kernel/src/chsys.c
+++ b/os/kernel/src/chsys.c
@@ -117,6 +117,9 @@ void chSysTimerHandlerI(void) {
currp->p_time++;
#endif
chVTDoTickI();
+#if defined(SYSTEM_TICK_EVENT_HOOK)
+ SYSTEM_TICK_EVENT_HOOK();
+#endif
}
#if CH_USE_NESTED_LOCKS && !CH_OPTIMIZE_SPEED
diff --git a/os/kernel/src/chthreads.c b/os/kernel/src/chthreads.c
index 3f2f88899..ae38dc11a 100644
--- a/os/kernel/src/chthreads.c
+++ b/os/kernel/src/chthreads.c
@@ -94,7 +94,9 @@ Thread *init_thread(Thread *tp, tprio_t prio) {
#if CH_USE_EVENTS
tp->p_epending = 0;
#endif
- THREAD_EXT_INIT(tp);
+#if defined(THREAD_EXT_EXIT_HOOK)
+ THREAD_EXT_INIT_HOOK(tp);
+#endif
return tp;
}
@@ -357,7 +359,9 @@ void chThdExit(msg_t msg) {
chSysLock();
tp->p_u.exitcode = msg;
- THREAD_EXT_EXIT(tp);
+#if defined(THREAD_EXT_EXIT_HOOK)
+ THREAD_EXT_EXIT_HOOK(tp);
+#endif
#if CH_USE_WAITEXIT
while (notempty(&tp->p_waiting))
chSchReadyI(list_remove(&tp->p_waiting));