12 #include <linux/sched.h>
13 #include <linux/kernel.h>
15 #include <linux/time.h>
23 #include <asm/div64.h>
24 #include <asm/processor.h>
29 static unsigned long mn10300_last_tsc;
32 static unsigned long sched_clock_multiplier;
40 unsigned long long ll;
60 asm(
"mulu %2,%0,%3,%0 \n"
64 :
"=r"(product[0]),
"=r"(product[1]),
"=r"(product[2]),
"=r"(tmp)
65 :
"0"(tsc64.l[0]),
"1"(tsc64.l[1]),
"2"(sched_clock_multiplier)
68 result.l[0] = product[1] << 16 | product[0] >> 16;
69 result.l[1] = product[2] << 16 | product[1] >> 16;
77 static void __init mn10300_sched_clock_init(
void)
79 sched_clock_multiplier =
105 TMPSCNT |= TMPSCNT_ENABLE;
110 "timestamp counter I/O clock running at %lu.%02lu"
111 " (calibrated against RTC)\n",
114 mn10300_last_tsc = read_timestamp_counter();
118 #ifdef CONFIG_MN10300_WD_TIMER
123 mn10300_sched_clock_init();