Merge tag 'regmap-fix-v5.11-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux/fpc-iii.git] / kernel / time / tick-legacy.c
blobaf225b32f5b37ed2195039614ca2a2b970ec9cbd
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Timer tick function for architectures that lack generic clockevents,
4 * consolidated here from m68k/ia64/parisc/arm.
5 */
7 #include <linux/irq.h>
8 #include <linux/profile.h>
9 #include <linux/timekeeper_internal.h>
11 #include "tick-internal.h"
13 /**
14 * legacy_timer_tick() - advances the timekeeping infrastructure
15 * @ticks: number of ticks, that have elapsed since the last call.
17 * This is used by platforms that have not been converted to
18 * generic clockevents.
20 * If 'ticks' is zero, the CPU is not handling timekeeping, so
21 * only perform process accounting and profiling.
23 * Must be called with interrupts disabled.
25 void legacy_timer_tick(unsigned long ticks)
27 if (ticks) {
28 raw_spin_lock(&jiffies_lock);
29 write_seqcount_begin(&jiffies_seq);
30 do_timer(ticks);
31 write_seqcount_end(&jiffies_seq);
32 raw_spin_unlock(&jiffies_lock);
33 update_wall_time();
35 update_process_times(user_mode(get_irq_regs()));
36 profile_tick(CPU_PROFILING);