summaryrefslogtreecommitdiff
path: root/src/scheduler.c
diff options
context:
space:
mode:
authorGabriel Wang <[email protected]>2022-01-07 23:35:44 +0000
committerGabriel Wang <[email protected]>2022-01-07 23:35:44 +0000
commitd7b8cf81e6285f3cbb0817cbe79c527f10ff56b7 (patch)
tree3e47ead2e339c0f1181c9ca2f4ffbfec9536d7eb /src/scheduler.c
parent495e209f379338b2bbc4ba086e457d0fb6d22a8d (diff)
move some __on_rt_xxxxx_hook from rtdef.h to dedicated c soure files
Diffstat (limited to 'src/scheduler.c')
-rw-r--r--src/scheduler.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/scheduler.c b/src/scheduler.c
index 6ef02f3d3c..bcc74a2604 100644
--- a/src/scheduler.c
+++ b/src/scheduler.c
@@ -27,6 +27,7 @@
* rt_schedule_insert_thread won't insert current task to ready queue
* in smp version, rt_hw_context_switch_interrupt maybe switch to
* new task directly
+ * 2022-01-07 Gabriel Moving __on_rt_xxxxx_hook to scheduler.c
*
*/
@@ -47,7 +48,14 @@ struct rt_thread *rt_current_thread = RT_NULL;
rt_uint8_t rt_current_priority;
#endif /* RT_USING_SMP */
-#ifdef RT_USING_HOOK
+#ifndef __on_rt_scheduler_hook
+ #define __on_rt_scheduler_hook(from, to) __ON_HOOK_ARGS(rt_scheduler_hook, (from, to))
+#endif
+#ifndef __on_rt_scheduler_switch_hook
+ #define __on_rt_scheduler_switch_hook(tid) __ON_HOOK_ARGS(rt_scheduler_switch_hook, (tid))
+#endif
+
+#if defined(RT_USING_HOOK) && defined(RT_HOOK_USING_FUNC_PTR)
static void (*rt_scheduler_hook)(struct rt_thread *from, struct rt_thread *to);
static void (*rt_scheduler_switch_hook)(struct rt_thread *tid);