summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-09-07 00:45:04 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-09-07 00:45:04 +0000
commit1148a796fd1311ae65f87ab7215ebe472f2a24db (patch)
tree787003fcaf97b2c9589014e7b2d845c70d8cfcf1 /arch
parente564711f1ec052ffb94a86a71be77739bee0a6ce (diff)
More NTP and xtime_lock fixes.
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/baget/time.c21
-rw-r--r--arch/mips/ddb5074/irq.c1
-rw-r--r--arch/mips/ddb5074/setup.c1
-rw-r--r--arch/mips/ddb5074/time.c21
-rw-r--r--arch/mips/kernel/traps.c3
-rw-r--r--arch/mips/orion/irq.c3
6 files changed, 20 insertions, 30 deletions
diff --git a/arch/mips/baget/time.c b/arch/mips/baget/time.c
index 99dccb59d..1c1c9840f 100644
--- a/arch/mips/baget/time.c
+++ b/arch/mips/baget/time.c
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.3 1999/08/17 22:18:37 ralf Exp $
+/*
* time.c: Baget/MIPS specific time handling details
*
* Copyright (C) 1998 Gleb Raiko & Vladimir Roganov
@@ -13,7 +13,7 @@
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/timex.h>
-#include <linux/kernel_stat.h>
+#include <linux/spinlock.h>
#include <asm/bootinfo.h>
#include <asm/io.h>
@@ -23,11 +23,14 @@
#include <asm/baget/baget.h>
+extern rwlock_t xtime_lock;
+
/*
* To have precision clock, we need to fix available clock frequency
*/
#define FREQ_NOM 79125 /* Baget frequency ratio */
#define FREQ_DEN 10000
+
static inline int timer_intr_valid(void)
{
static unsigned long long ticks, valid_ticks;
@@ -47,8 +50,8 @@ static inline int timer_intr_valid(void)
void static timer_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
if (timer_intr_valid()) {
- sti();
- do_timer(regs);
+ sti();
+ do_timer(regs);
}
}
@@ -78,20 +81,18 @@ void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
- save_and_cli(flags);
+ read_lock_irqsave (&xtime_lock, flags);
*tv = xtime;
- restore_flags(flags);
+ read_unlock_irqrestore (&xtime_lock, flags);
}
void do_settimeofday(struct timeval *tv)
{
- unsigned long flags;
-
- save_and_cli(flags);
+ write_lock_irq (&xtime_lock);
xtime = *tv;
time_adjust = 0; /* stop active adjtime() */
time_status |= STA_UNSYNC;
time_maxerror = NTP_PHASE_LIMIT;
time_esterror = NTP_PHASE_LIMIT;
- restore_flags(flags);
+ write_unlock_irq (&xtime_lock);
}
diff --git a/arch/mips/ddb5074/irq.c b/arch/mips/ddb5074/irq.c
index 31813fe41..a99228691 100644
--- a/arch/mips/ddb5074/irq.c
+++ b/arch/mips/ddb5074/irq.c
@@ -228,4 +228,3 @@ void __init ddb_irq_setup(void)
set_except_vector(0, ddbIRQ);
}
-
diff --git a/arch/mips/ddb5074/setup.c b/arch/mips/ddb5074/setup.c
index 151234512..5233befac 100644
--- a/arch/mips/ddb5074/setup.c
+++ b/arch/mips/ddb5074/setup.c
@@ -251,4 +251,3 @@ void ddb5074_led_d3(int on)
pci_write_config_byte(pci_pmu, 0x7e, t);
}
}
-
diff --git a/arch/mips/ddb5074/time.c b/arch/mips/ddb5074/time.c
index 14503c66a..4b3f1dc93 100644
--- a/arch/mips/ddb5074/time.c
+++ b/arch/mips/ddb5074/time.c
@@ -3,33 +3,30 @@
*
* Copyright (C) 2000 Geert Uytterhoeven <geert@sonycom.com>
* Sony Software Development Center Europe (SDCE), Brussels
- *
- * $Id*
*/
-
#include <linux/init.h>
#include <asm/mc146818rtc.h>
static unsigned char ddb_rtc_read_data(unsigned long addr)
{
- outb_p(addr, RTC_PORT(0));
- return inb_p(RTC_PORT(1));
+ outb_p(addr, RTC_PORT(0));
+
+ return inb_p(RTC_PORT(1));
}
static void ddb_rtc_write_data(unsigned char data, unsigned long addr)
{
- outb_p(addr, RTC_PORT(0));
- outb_p(data, RTC_PORT(1));
+ outb_p(addr, RTC_PORT(0));
+ outb_p(data, RTC_PORT(1));
}
static int ddb_rtc_bcd_mode(void)
{
- return 1;
+ return 1;
}
struct rtc_ops ddb_rtc_ops = {
- ddb_rtc_read_data,
- ddb_rtc_write_data,
- ddb_rtc_bcd_mode
+ ddb_rtc_read_data,
+ ddb_rtc_write_data,
+ ddb_rtc_bcd_mode
};
-
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index 236dfa8d6..1d9284cfa 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -273,9 +273,6 @@ static void default_be_board_handler(struct pt_regs *regs)
/*
* Assume it would be too dangerous to continue ...
*/
-/* XXX */
-printk("Got Bus Error at %08x\n", (unsigned int)regs->cp0_epc);
-show_regs(regs); while(1);
force_sig(SIGBUS, current);
}
diff --git a/arch/mips/orion/irq.c b/arch/mips/orion/irq.c
index 1721b47ae..58d9ae3bf 100644
--- a/arch/mips/orion/irq.c
+++ b/arch/mips/orion/irq.c
@@ -252,7 +252,6 @@ void free_irq(unsigned int irq, void *dev_id)
request_irq(irq, NULL, 0, NULL, dev_id);
}
-
unsigned long probe_irq_on (void)
{
return 0;
@@ -272,10 +271,8 @@ int orion_irq_cannonicalize(int i)
void __init init_IRQ(void)
{
-
irq_cannonicalize = orion_irq_cannonicalize;
set_except_vector(0, orionIRQ);
}
EXPORT_SYMBOL(irq_cannonicalize);
-