/* $Id: time.c,v 1.42 2002/01/23 14:33:55 davem Exp $ * time.c: UltraSparc timer and TOD clock support. * * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu) * Copyright (C) 1998 Eddie C. Dost (ecd@skynet.be) * * Based largely on code which is: * * Copyright (C) 1996 Thomas K. Dyas (tdyas@eden.rutgers.edu) */#include<linux/errno.h>#include<linux/module.h>#include<linux/sched.h>#include<linux/kernel.h>#include<linux/param.h>#include<linux/string.h>#include<linux/mm.h>#include<linux/interrupt.h>#include<linux/time.h>#include<linux/timex.h>#include<linux/init.h>#include<linux/ioport.h>#include<linux/mc146818rtc.h>#include<linux/delay.h>#include<linux/profile.h>#include<linux/bcd.h>#include<linux/jiffies.h>#include<linux/cpufreq.h>#include<linux/percpu.h>#include<linux/profile.h>#include<linux/miscdevice.h>#include<linux/rtc.h>#include<linux/kernel_stat.h>#include<linux/clockchips.h>#include<linux/clocksource.h>#include<asm/oplib.h>#include<asm/mostek.h>#include<asm/timer.h>#include<asm/irq.h>#include<asm/io.h>#include<asm/prom.h>#include<asm/of_device.h>#include<asm/starfire.h>#include<asm/smp.h>#include<asm/sections.h>#include<asm/cpudata.h>#include<asm/uaccess.h>#include<asm/prom.h>#include<asm/irq_regs.h>DEFINE_SPINLOCK(mostek_lock);DEFINE_SPINLOCK(rtc_lock);void__iomem*mstk48t02_regs=NULL;#ifdef CONFIG_PCIunsignedlongds1287_regs=0UL;#endifstaticvoid__iomem*mstk48t08_regs;staticvoid__iomem*mstk48t59_regs;staticintset_rtc_mmss(unsignedlong);#define TICK_PRIV_BIT (1UL << 63)#define TICKCMP_IRQ_BIT (1UL << 63)#ifdef CONFIG_SMPunsignedlongprofile_pc(structpt_regs*regs){unsignedlongpc=instruction_pointer(regs);if(in_lock_functions(pc))returnregs->u_regs[UREG_RETPC];returnpc;}EXPORT_SYMBOL(