summaryrefslogtreecommitdiffstats
path: root/arch/sparc64/kernel
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-02-15 02:15:32 +0000
commit86464aed71025541805e7b1515541aee89879e33 (patch)
treee01a457a4912a8553bc65524aa3125d51f29f810 /arch/sparc64/kernel
parent88f99939ecc6a95a79614574cb7d95ffccfc3466 (diff)
Merge with Linux 2.2.1.
Diffstat (limited to 'arch/sparc64/kernel')
-rw-r--r--arch/sparc64/kernel/Makefile27
-rw-r--r--arch/sparc64/kernel/time.c16
2 files changed, 30 insertions, 13 deletions
diff --git a/arch/sparc64/kernel/Makefile b/arch/sparc64/kernel/Makefile
index 4d1b1eb35..fbeb83126 100644
--- a/arch/sparc64/kernel/Makefile
+++ b/arch/sparc64/kernel/Makefile
@@ -27,7 +27,7 @@ ifdef CONFIG_PCI
O_OBJS += ebus.o
endif
-ifdef SMP
+ifdef CONFIG_SMP
O_OBJS += smp.o trampoline.o
endif
@@ -63,11 +63,17 @@ check_asm: dummy
@echo "#ifndef __ASM_OFFSETS_H__" >> asm_offsets.h
@echo "#define __ASM_OFFSETS_H__" >> asm_offsets.h
@echo "" >> asm_offsets.h
- @echo "#ifndef __SMP__" >> asm_offsets.h
+ @echo "#include <linux/config.h>" >> asm_offsets.h
@echo "" >> asm_offsets.h
- @echo "#include <linux/sched.h>" > tmp.c
+ @echo "#ifndef CONFIG_SMP" >> asm_offsets.h
+ @echo "" >> asm_offsets.h
+ @echo "#include <linux/config.h>" > tmp.c
+ @echo "#undef CONFIG_SMP" >> tmp.c
+ @echo "#include <linux/sched.h>" >> tmp.c
$(CC) -E tmp.c -o tmp.i
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
+ @echo "#include <linux/config.h>" >> check_asm.c
+ @echo "#undef CONFIG_SMP" >> check_asm.c
@echo "#include <linux/sched.h>" >> check_asm.c
@echo 'struct task_struct _task;' >> check_asm.c
@echo 'struct mm_struct _mm;' >> check_asm.c
@@ -87,13 +93,19 @@ check_asm: dummy
./check_asm >> asm_offsets.h
@rm -f check_asm check_asm.c
@echo "" >> asm_offsets.h
- @echo "#else /* __SMP__ */" >> asm_offsets.h
+ @echo "#else /* CONFIG_SMP */" >> asm_offsets.h
@echo "" >> asm_offsets.h
@echo "#ifndef SPIN_LOCK_DEBUG" >>asm_offsets.h
@echo "" >> asm_offsets.h
- @echo "#include <linux/sched.h>" > tmp.c
+ @echo "#include <linux/config.h>" > tmp.c
+ @echo "#undef CONFIG_SMP" >> tmp.c
+ @echo "#define CONFIG_SMP 1" >> tmp.c
+ @echo "#include <linux/sched.h>" >> tmp.c
$(CC) -D__SMP__ -E tmp.c -o tmp.i
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
+ @echo "#include <linux/config.h>" >> check_asm.c
+ @echo "#undef CONFIG_SMP" >> check_asm.c
+ @echo "#define CONFIG_SMP 1" >> check_asm.c
@echo "#include <linux/sched.h>" >> check_asm.c
@echo 'struct task_struct _task;' >> check_asm.c
@echo 'struct mm_struct _mm;' >> check_asm.c
@@ -118,6 +130,9 @@ check_asm: dummy
@echo "#include <linux/sched.h>" > tmp.c
$(CC) -D__SMP__ -DSPIN_LOCK_DEBUG -E tmp.c -o tmp.i
@echo "/* Automatically generated. Do not edit. */" > check_asm.c
+ @echo "#include <linux/config.h>" >> check_asm.c
+ @echo "#undef CONFIG_SMP" >> check_asm.c
+ @echo "#define CONFIG_SMP 1" >> check_asm.c
@echo "#include <linux/sched.h>" >> check_asm.c
@echo 'struct task_struct _task;' >> check_asm.c
@echo 'struct mm_struct _mm;' >> check_asm.c
@@ -138,7 +153,7 @@ check_asm: dummy
@rm -f check_asm check_asm.c
@echo "#endif /* SPIN_LOCK_DEBUG */" >> asm_offsets.h
@echo "" >> asm_offsets.h
- @echo "#endif /* __SMP__ */" >> asm_offsets.h
+ @echo "#endif /* CONFIG_SMP */" >> asm_offsets.h
@echo "" >> asm_offsets.h
@echo "#endif /* __ASM_OFFSETS_H__ */" >> asm_offsets.h
@if test -r $(HPATH)/asm/asm_offsets.h; then \
diff --git a/arch/sparc64/kernel/time.c b/arch/sparc64/kernel/time.c
index e95bf0727..c826ce56d 100644
--- a/arch/sparc64/kernel/time.c
+++ b/arch/sparc64/kernel/time.c
@@ -53,9 +53,10 @@ static __inline__ void timer_check_rtc(void)
static long last_rtc_update=0;
/* Determine when to update the Mostek clock. */
- if (time_state != TIME_BAD && xtime.tv_sec > last_rtc_update + 660 &&
- xtime.tv_usec > 500000 - (tick >> 1) &&
- xtime.tv_usec < 500000 + (tick >> 1)) {
+ if ((time_status & STA_UNSYNC) == 0 &&
+ xtime.tv_sec > last_rtc_update + 660 &&
+ xtime.tv_usec >= 500000 - ((unsigned) tick) / 2 &&
+ xtime.tv_usec <= 500000 + ((unsigned) tick) / 2) {
if (set_rtc_mmss(xtime.tv_sec) == 0)
last_rtc_update = xtime.tv_sec;
else
@@ -458,10 +459,11 @@ void do_settimeofday(struct timeval *tv)
}
xtime = *tv;
- time_state = TIME_BAD;
- time_maxerror = 0x70000000;
- time_esterror = 0x70000000;
-
+ time_adjust = 0; /* stop active adjtime() */
+ time_status |= STA_UNSYNC;
+ time_state = TIME_ERROR; /* p. 24, (a) */
+ time_maxerror = NTP_PHASE_LIMIT;
+ time_esterror = NTP_PHASE_LIMIT;
sti();
}