mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-20 00:45:22 +08:00
Add smp support to RT-Thread 4.0
This commit is contained in:
@@ -12,12 +12,17 @@
|
||||
* 2010-05-20 Bernard fix the tick exceeds the maximum limits
|
||||
* 2010-07-13 Bernard fix rt_tick_from_millisecond issue found by kuronca
|
||||
* 2011-06-26 Bernard add rt_tick_set function.
|
||||
* 2018-11-22 Jesven add per cpu tick
|
||||
*/
|
||||
|
||||
#include <rthw.h>
|
||||
#include <rtthread.h>
|
||||
|
||||
#ifdef RT_USING_SMP
|
||||
#define rt_tick rt_cpu_index(0)->tick
|
||||
#else
|
||||
static rt_tick_t rt_tick = 0;
|
||||
#endif
|
||||
|
||||
extern void rt_timer_check(void);
|
||||
|
||||
@@ -71,7 +76,11 @@ void rt_tick_increase(void)
|
||||
struct rt_thread *thread;
|
||||
|
||||
/* increase the global tick */
|
||||
#ifdef RT_USING_SMP
|
||||
rt_cpu_self()->tick ++;
|
||||
#else
|
||||
++ rt_tick;
|
||||
#endif
|
||||
|
||||
/* check time slice */
|
||||
thread = rt_thread_self();
|
||||
|
||||
Reference in New Issue
Block a user