Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Timer tick function for architectures that lack generic clockevents,
0004  * consolidated here from m68k/ia64/parisc/arm.
0005  */
0006 
0007 #include <linux/irq.h>
0008 #include <linux/profile.h>
0009 #include <linux/timekeeper_internal.h>
0010 
0011 #include "tick-internal.h"
0012 
0013 /**
0014  * legacy_timer_tick() - advances the timekeeping infrastructure
0015  * @ticks:  number of ticks, that have elapsed since the last call.
0016  *
0017  * This is used by platforms that have not been converted to
0018  * generic clockevents.
0019  *
0020  * If 'ticks' is zero, the CPU is not handling timekeeping, so
0021  * only perform process accounting and profiling.
0022  *
0023  * Must be called with interrupts disabled.
0024  */
0025 void legacy_timer_tick(unsigned long ticks)
0026 {
0027     if (ticks) {
0028         raw_spin_lock(&jiffies_lock);
0029         write_seqcount_begin(&jiffies_seq);
0030         do_timer(ticks);
0031         write_seqcount_end(&jiffies_seq);
0032         raw_spin_unlock(&jiffies_lock);
0033         update_wall_time();
0034     }
0035     update_process_times(user_mode(get_irq_regs()));
0036     profile_tick(CPU_PROFILING);
0037 }