summaryrefslogtreecommitdiff
path: root/src/signal.c
diff options
context:
space:
mode:
authorshaojinchun <[email protected]>2018-11-22 14:40:43 +0800
committershaojinchun <[email protected]>2018-11-22 18:16:47 +0800
commitfc6bc1ad398d5fa2085320cab6cc33905f5f943d (patch)
treea6a24a6e516add6fe47fa5a58f7307ee0cd3f6e8 /src/signal.c
parent8ea5b770117cacea7f17b2b08305f360ed71bca7 (diff)
Add smp support to RT-Thread 4.0
Diffstat (limited to 'src/signal.c')
-rw-r--r--src/signal.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/signal.c b/src/signal.c
index 890f16f497..05632b2c4a 100644
--- a/src/signal.c
+++ b/src/signal.c
@@ -6,6 +6,8 @@
* Change Logs:
* Date Author Notes
* 2017/10/5 Bernard the first version
+ * 2018/09/17 Jesven fix: in _signal_deliver RT_THREAD_STAT_MASK to RT_THREAD_STAT_SIGNAL_MASK
+ * 2018/11/22 Jesven in smp version rt_hw_context_switch_to add a param
*/
#include <stdint.h>
@@ -60,10 +62,14 @@ static void _signal_entry(void *parameter)
tid->sp = tid->sig_ret;
tid->sig_ret = RT_NULL;
- LOG_D("switch back to: 0x%08x", tid->sp);
+ LOG_D("switch back to: 0x%08x\n", tid->sp);
tid->stat &= ~RT_THREAD_STAT_SIGNAL;
- rt_hw_context_switch_to((rt_uint32_t) & (tid->sp));
+#ifdef RT_USING_SMP
+ rt_hw_context_switch_to((rt_ubase_t)&(tid->sp), tid);
+#else
+ rt_hw_context_switch_to((rt_ubase_t)&(tid->sp));
+#endif /*RT_USING_SMP*/
}
/*
@@ -108,7 +114,7 @@ static void _signal_deliver(rt_thread_t tid)
/* do signal action in self thread context */
rt_thread_handle_sig(RT_TRUE);
}
- else if (!((tid->stat & RT_THREAD_STAT_MASK) & RT_THREAD_STAT_SIGNAL))
+ else if (!((tid->stat & RT_THREAD_STAT_SIGNAL_MASK) & RT_THREAD_STAT_SIGNAL))
{
/* add signal state */
tid->stat |= RT_THREAD_STAT_SIGNAL;