#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/bcd.h>
+#include <linux/profile.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/hwrpb.h>
+#include <asm/8253pit.h>
#include <linux/mc146818rtc.h>
#include <linux/time.h>
#include "proto.h"
#include "irq_impl.h"
-u64 jiffies_64 = INITIAL_JIFFIES;
-
-EXPORT_SYMBOL(jiffies_64);
-
extern unsigned long wall_jiffies; /* kernel/timer.c */
static int set_rtc_mmss(unsigned long);
-spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
+DEFINE_SPINLOCK(rtc_lock);
#define TICK_SIZE (tick_nsec / 1000)
#ifndef CONFIG_SMP
/* Not SMP, do kernel PC profiling here. */
- if (!user_mode(regs))
- alpha_do_profile(regs->pc);
+ profile_tick(CPU_PROFILING, regs);
#endif
write_seqlock(&xtime_lock);
while (nticks > 0) {
do_timer(regs);
+#ifndef CONFIG_SMP
+ update_process_times(user_mode(regs));
+#endif
nticks--;
}
* CMOS 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 ((time_status & STA_UNSYNC) == 0
+ if (ntp_synced()
&& xtime.tv_sec > state.last_rtc_update + 660
&& xtime.tv_nsec >= 500000 - ((unsigned) TICK_SIZE) / 2
&& xtime.tv_nsec <= 500000 + ((unsigned) TICK_SIZE) / 2) {
* arch/i386/time.c.
*/
-#define PIC_TICK_RATE 1193180UL
#define CALIBRATE_LATCH 0xffff
#define TIMEOUT_COUNT 0x100000
static unsigned long __init
-calibrate_cc_with_pic(void)
+calibrate_cc_with_pit(void)
{
int cc, count = 0;
if (count <= 1 || count == TIMEOUT_COUNT)
return 0;
- return ((long)cc * PIC_TICK_RATE) / (CALIBRATE_LATCH + 1);
+ return ((long)cc * PIT_TICK_RATE) / (CALIBRATE_LATCH + 1);
}
/* The Linux interpretation of the CMOS clock register contents:
/* Calibrate CPU clock -- attempt #1. */
if (!est_cycle_freq)
- est_cycle_freq = validate_cc_value(calibrate_cc_with_pic());
+ est_cycle_freq = validate_cc_value(calibrate_cc_with_pit());
cc1 = rpcc_after_update_in_progress();
BCD_TO_BIN(year);
}
- /* PC-like is standard; used for year < 20 || year >= 70 */
+ /* PC-like is standard; used for year >= 70 */
epoch = 1900;
if (year < 20)
epoch = 2000;
set_normalized_timespec(&xtime, sec, nsec);
set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec);
- time_adjust = 0; /* stop active adjtime() */
- time_status |= STA_UNSYNC;
- time_maxerror = NTP_PHASE_LIMIT;
- time_esterror = NTP_PHASE_LIMIT;
+ ntp_clear();
write_sequnlock_irq(&xtime_lock);
clock_was_set();
* sets the minutes. Usually you won't notice until after reboot!
*/
-extern int abs(int);
static int
set_rtc_mmss(unsigned long nowtime)