tick-legacy.c 999 B

12345678910111213141516171819202122232425262728293031323334353637
  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. */
  6. #include <linux/irq.h>
  7. #include <linux/profile.h>
  8. #include <linux/timekeeper_internal.h>
  9. #include "tick-internal.h"
  10. /**
  11. * legacy_timer_tick() - advances the timekeeping infrastructure
  12. * @ticks: number of ticks, that have elapsed since the last call.
  13. *
  14. * This is used by platforms that have not been converted to
  15. * generic clockevents.
  16. *
  17. * If 'ticks' is zero, the CPU is not handling timekeeping, so
  18. * only perform process accounting and profiling.
  19. *
  20. * Must be called with interrupts disabled.
  21. */
  22. void legacy_timer_tick(unsigned long ticks)
  23. {
  24. if (ticks) {
  25. raw_spin_lock(&jiffies_lock);
  26. write_seqcount_begin(&jiffies_seq);
  27. do_timer(ticks);
  28. write_seqcount_end(&jiffies_seq);
  29. raw_spin_unlock(&jiffies_lock);
  30. update_wall_time();
  31. }
  32. update_process_times(user_mode(get_irq_regs()));
  33. profile_tick(CPU_PROFILING);
  34. }