From 7bbf21e2d307ff3300a42fb33ac94438a5e930ac Mon Sep 17 00:00:00 2001 From: Francois Berder <18538310+francois-berder@users.noreply.github.com> Date: Fri, 10 Jan 2020 18:31:18 +0000 Subject: [PATCH] cpu: mips32r2_common: Implement mips32r2_isr_end Signed-off-by: Francois Berder <18538310+francois-berder@users.noreply.github.com> --- cpu/mips32r2_common/include/cpu.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cpu/mips32r2_common/include/cpu.h b/cpu/mips32r2_common/include/cpu.h index 57002564aa..08708b7def 100644 --- a/cpu/mips32r2_common/include/cpu.h +++ b/cpu/mips32r2_common/include/cpu.h @@ -25,6 +25,7 @@ #include #include "cpu_conf.h" +#include "thread.h" #include "irq.h" #ifdef __cplusplus @@ -46,6 +47,18 @@ static inline void cpu_print_last_instruction(void) */ void cpu_init(void); +/** + * @brief Trigger a conditional context scheduler run / context switch + * + * This function is supposed to be called in the end of each ISR. + */ +static inline void mips32r2_isr_end(void) +{ + if (sched_context_switch_request) { + thread_yield_higher(); + } +} + #ifdef __cplusplus } #endif