MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_tick_increase_tick

Function rt_tick_increase_tick

src/clock.c:170–202  ·  view source on GitHub ↗

* @brief This function will notify kernel there is n tick passed. * Normally, this function is invoked by clock ISR. */

Source from the content-addressed store, hash-verified

168 * Normally, this function is invoked by clock ISR.
169 */
170void rt_tick_increase_tick(rt_tick_t tick)
171{
172 RT_ASSERT(rt_interrupt_get_nest() > 0);
173
174 RT_OBJECT_HOOK_CALL(rt_tick_hook, ());
175
176 /* tracing cpu usage */
177 _update_process_times(tick);
178
179 /* increase the global tick */
180#ifdef RT_USING_SMP
181 /* get percpu and increase the tick */
182 rt_atomic_add(&(rt_cpu_self()->tick), tick);
183#else
184 rt_atomic_add(&(rt_tick), tick);
185#endif /* RT_USING_SMP */
186
187 /* check time slice */
188 rt_sched_tick_increase(tick);
189
190 /* check timer */
191#ifdef RT_USING_SMP
192 if (rt_cpu_get_id() != 0)
193 {
194 return;
195 }
196#endif
197 rt_timer_check();
198
199#ifdef RT_USING_VDSO
200 rt_vdso_update_glob_time();
201#endif
202}
203
204/**
205 * @brief This function will calculate the tick from millisecond.

Callers 1

_pm_change_sleep_modeFunction · 0.85

Calls 7

rt_interrupt_get_nestFunction · 0.85
_update_process_timesFunction · 0.85
rt_sched_tick_increaseFunction · 0.85
rt_cpu_get_idFunction · 0.85
rt_timer_checkFunction · 0.85
rt_cpu_selfFunction · 0.70
rt_vdso_update_glob_timeFunction · 0.50

Tested by

no test coverage detected