1 // SPDX-License-Identifier: GPL-2.0
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
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>
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
);
46 cris_do_profile(struct pt_regs
* regs
)
49 #ifdef CONFIG_SYSTEM_PROFILER
50 cris_profile_sample(regs
);
53 #ifdef CONFIG_PROFILING
54 profile_tick(CPU_PROFILING
);
58 #ifndef CONFIG_GENERIC_SCHED_CLOCK
59 unsigned long long sched_clock(void)
61 return (unsigned long long)jiffies
* (NSEC_PER_SEC
/ HZ
) +
67 __init
init_udelay(void)
69 loops_per_usec
= (loops_per_jiffy
* HZ
) / 1000000;
73 __initcall(init_udelay
);