Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 146723
b: refs/heads/master
c: 5ac5496
h: refs/heads/master
i:
  146721: 1dd9d96
  146719: 801d479
v: v3
  • Loading branch information
Paul Mundt committed May 8, 2009
1 parent 7a2f6b1 commit dca3f43
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 55 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d134b9e8d3f32331ad2faca2db8186f54198931
refs/heads/master: 5ac5496411b30d41945a996fe7a7fb5abccf2aaa
5 changes: 0 additions & 5 deletions trunk/arch/sh/include/asm/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,12 @@ struct sys_timer {
struct sys_timer_ops *ops;
};

#define TICK_SIZE (tick_nsec / 1000)

extern struct sys_timer tmu_timer;
extern struct sys_timer *sys_timer;

/* arch/sh/kernel/timers/timer.c */
struct sys_timer *get_sys_timer(void);

/* arch/sh/kernel/time.c */
void handle_timer_tick(void);

extern struct clocksource clocksource_sh;

#endif /* __ASM_SH_TIMER_H */
53 changes: 4 additions & 49 deletions trunk/arch/sh/kernel/time.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
/*
* arch/sh/kernel/time_32.c
* arch/sh/kernel/time.c
*
* Copyright (C) 1999 Tetsuya Okada & Niibe Yutaka
* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
* Copyright (C) 2002 - 2009 Paul Mundt
* Copyright (C) 2002 M. R. Brown <mrbrown@linux-sh.org>
*
* Some code taken from i386 version.
* Copyright (C) 1991, 1992, 1995 Linus Torvalds
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*/
#include <linux/kernel.h>
#include <linux/module.h>
Expand All @@ -23,7 +24,6 @@
#include <asm/clock.h>
#include <asm/rtc.h>
#include <asm/timer.h>
#include <asm/kgdb.h>

struct sys_timer *sys_timer;

Expand Down Expand Up @@ -97,50 +97,6 @@ static int __init rtc_generic_init(void)
}
module_init(rtc_generic_init);

/* last time the RTC clock got updated */
static long last_rtc_update;

/*
* handle_timer_tick() needs to keep up the real-time clock,
* as well as call the "do_timer()" routine every clocktick
*/
void handle_timer_tick(void)
{
if (current->pid)
profile_tick(CPU_PROFILING);

/*
* Here we are in the timer irq handler. We just have irqs locally
* disabled but we don't know if the timer_bh is running on the other
* CPU. We need to avoid to SMP race with it. NOTE: we don' t need
* the irq version of write_lock because as just said we have irq
* locally disabled. -arca
*/
write_seqlock(&xtime_lock);
do_timer(1);

/*
* If we have an externally synchronized Linux clock, then update
* RTC clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
* called as close as possible to 500 ms before the new second starts.
*/
if (ntp_synced() &&
xtime.tv_sec > last_rtc_update + 660 &&
(xtime.tv_nsec / 1000) >= 500000 - ((unsigned) TICK_SIZE) / 2 &&
(xtime.tv_nsec / 1000) <= 500000 + ((unsigned) TICK_SIZE) / 2) {
if (rtc_sh_set_time(xtime.tv_sec) == 0)
last_rtc_update = xtime.tv_sec;
else
/* do it again in 60s */
last_rtc_update = xtime.tv_sec - 600;
}
write_sequnlock(&xtime_lock);

#ifndef CONFIG_SMP
update_process_times(user_mode(get_irq_regs()));
#endif
}

#ifdef CONFIG_PM
int timer_suspend(struct sys_device *dev, pm_message_t state)
{
Expand Down Expand Up @@ -242,4 +198,3 @@ void __init time_init(void)

late_time_init = sh_late_time_init;
}

0 comments on commit dca3f43

Please sign in to comment.