summaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/time.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
committerRalf Baechle <ralf@linux-mips.org>2001-03-09 20:33:35 +0000
commit116674acc97ba75a720329996877077d988443a2 (patch)
tree6a3f2ff0b612ae2ee8a3f3509370c9e6333a53b3 /arch/s390/kernel/time.c
parent71118c319fcae4a138f16e35b4f7e0a6d53ce2ca (diff)
Merge with Linux 2.4.2.
Diffstat (limited to 'arch/s390/kernel/time.c')
-rw-r--r--arch/s390/kernel/time.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index 8cd84ee54..f4bde27b3 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -11,7 +11,6 @@
* Copyright (C) 1991, 1992, 1995 Linus Torvalds
*/
-#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
@@ -27,15 +26,14 @@
#include <asm/uaccess.h>
#include <asm/delay.h>
+#include <asm/s390_ext.h>
-#include <linux/mc146818rtc.h>
#include <linux/timex.h>
+#include <linux/config.h>
#include <asm/irq.h>
-extern volatile unsigned long lost_ticks;
-
/* change this if you have some constant time drift */
#define USECS_PER_JIFFY ((signed long)1000000/HZ)
#define CLK_TICKS_PER_JIFFY ((signed long)USECS_PER_JIFFY<<12)
@@ -45,6 +43,7 @@ extern volatile unsigned long lost_ticks;
static uint64_t init_timer_cc, last_timer_cc;
extern rwlock_t xtime_lock;
+extern unsigned long wall_jiffies;
void tod_to_timeval(uint64_t todval, struct timeval *xtime)
{
@@ -94,9 +93,9 @@ unsigned long do_gettimeoffset(void)
*/
void do_gettimeofday(struct timeval *tv)
{
- extern volatile unsigned long lost_ticks;
unsigned long flags;
unsigned long usec, sec;
+ unsigned long lost_ticks = jiffies - wall_jiffies;
read_lock_irqsave(&xtime_lock, flags);
usec = do_gettimeoffset();
@@ -149,7 +148,7 @@ void do_settimeofday(struct timeval *tv)
extern __u16 boot_cpu_addr;
#endif
-void do_timer_interrupt(struct pt_regs *regs,int error_code)
+void do_timer_interrupt(struct pt_regs *regs, __u16 error_code)
{
unsigned long flags;
@@ -242,6 +241,9 @@ void __init time_init(void)
printk("time_init: TOD clock stopped/non-operational\n");
break;
}
+ /* request the 0x1004 external interrupt */
+ if (register_external_interrupt(0x1004, do_timer_interrupt) != 0)
+ panic("Couldn't request external interrupts 0x1004");
init_100hz_timer();
init_timer_cc = S390_lowcore.jiffy_timer_cc;
init_timer_cc -= 0x8126d60e46000000LL -