mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
[linux/fpc-iii.git] / arch / cris / kernel / time.c
blob593239274f980d5c56226051c562591c56b2b401
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * linux/arch/cris/kernel/time.c
5 * Copyright (C) 1991, 1992, 1995 Linus Torvalds
6 * Copyright (C) 1999, 2000, 2001 Axis Communications AB
8 * 1994-07-02 Alan Modra
9 * fixed set_rtc_mmss, fixed time.year for >= 2000, new mktime
10 * 1995-03-26 Markus Kuhn
11 * fixed 500 ms bug at call to set_rtc_mmss, fixed DS12887
12 * precision CMOS clock update
13 * 1996-05-03 Ingo Molnar
14 * fixed time warps in do_[slow|fast]_gettimeoffset()
15 * 1997-09-10 Updated NTP code according to technical memorandum Jan '96
16 * "A Kernel Model for Precision Timekeeping" by Dave Mills
18 * Linux/CRIS specific code:
20 * Authors: Bjorn Wesen
21 * Johan Adolfsson
25 #include <linux/errno.h>
26 #include <linux/module.h>
27 #include <linux/param.h>
28 #include <linux/jiffies.h>
29 #include <linux/bcd.h>
30 #include <linux/timex.h>
31 #include <linux/init.h>
32 #include <linux/profile.h>
33 #include <linux/sched/clock.h>
36 #define D(x)
38 #define TICK_SIZE tick
40 extern unsigned long loops_per_jiffy; /* init/main.c */
41 unsigned long loops_per_usec;
43 extern void cris_profile_sample(struct pt_regs* regs);
45 void
46 cris_do_profile(struct pt_regs* regs)
49 #ifdef CONFIG_SYSTEM_PROFILER
50 cris_profile_sample(regs);
51 #endif
53 #ifdef CONFIG_PROFILING
54 profile_tick(CPU_PROFILING);
55 #endif
58 #ifndef CONFIG_GENERIC_SCHED_CLOCK
59 unsigned long long sched_clock(void)
61 return (unsigned long long)jiffies * (NSEC_PER_SEC / HZ) +
62 get_ns_in_jiffie();
64 #endif
66 static int
67 __init init_udelay(void)
69 loops_per_usec = (loops_per_jiffy * HZ) / 1000000;
70 return 0;
73 __initcall(init_udelay);