From 392e8802486cb573b916e746010e141a75f507e6 Mon Sep 17 00:00:00 2001 From: Kevin Date: Sat, 15 Nov 2014 09:58:27 +0800 Subject: init android origin source code --- ANDROID_3.4.5/arch/h8300/kernel/time.c | 65 ++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 ANDROID_3.4.5/arch/h8300/kernel/time.c (limited to 'ANDROID_3.4.5/arch/h8300/kernel/time.c') diff --git a/ANDROID_3.4.5/arch/h8300/kernel/time.c b/ANDROID_3.4.5/arch/h8300/kernel/time.c new file mode 100644 index 00000000..32263a13 --- /dev/null +++ b/ANDROID_3.4.5/arch/h8300/kernel/time.c @@ -0,0 +1,65 @@ +/* + * linux/arch/h8300/kernel/time.c + * + * Yoshinori Sato + * + * Copied/hacked from: + * + * linux/arch/m68k/kernel/time.c + * + * Copyright (C) 1991, 1992, 1995 Linus Torvalds + * + * This file contains the m68k-specific time handling details. + * Most of the stuff is located in the machine specific files. + * + * 1997-09-10 Updated NTP code according to technical memorandum Jan '96 + * "A Kernel Model for Precision Timekeeping" by Dave Mills + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define TICK_SIZE (tick_nsec / 1000) + +void h8300_timer_tick(void) +{ + if (current->pid) + profile_tick(CPU_PROFILING); + xtime_update(1); + update_process_times(user_mode(get_irq_regs())); +} + +void read_persistent_clock(struct timespec *ts) +{ + unsigned int year, mon, day, hour, min, sec; + + /* FIX by dqg : Set to zero for platforms that don't have tod */ + /* without this time is undefined and can overflow time_t, causing */ + /* very strange errors */ + year = 1980; + mon = day = 1; + hour = min = sec = 0; +#ifdef CONFIG_H8300_GETTOD + h8300_gettod (&year, &mon, &day, &hour, &min, &sec); +#endif + if ((year += 1900) < 1970) + year += 100; + ts->tv_sec = mktime(year, mon, day, hour, min, sec); + ts->tv_nsec = 0; +} + +void __init time_init(void) +{ + + h8300_timer_setup(); +} -- cgit