unsigned long mregs = mstk48t02_regs; 
void * __iomem mregs = mstk48t02_regs; 
static void __init set_system_time(void){	unsigned int year, mon, day, hour, min, sec;	unsigned long mregs = mstk48t02_regs;#ifdef CONFIG_PCI	unsigned long dregs = ds1287_regs;#else	unsigned long dregs = 0UL;#endif	u8 tmp;	if (!mregs && !dregs) {		prom_printf("Something wrong, clock regs not mapped yet.\n");		prom_halt();	}			if (mregs) {		spin_lock_irq(&mostek_lock);		/* Traditional Mostek chip. */		tmp = mostek_read(mregs + MOSTEK_CREG);		tmp |= MSTK_CREG_READ;		mostek_write(mregs + MOSTEK_CREG, tmp);		sec = MSTK_REG_SEC(mregs);		min = MSTK_REG_MIN(mregs);		hour = MSTK_REG_HOUR(mregs);		day = MSTK_REG_DOM(mregs);		mon = MSTK_REG_MONTH(mregs);		year = MSTK_CVT_YEAR( MSTK_REG_YEAR(mregs) );	} else {		int i;		/* Dallas 12887 RTC chip. */		/* Stolen from arch/i386/kernel/time.c, see there for		 * credits and descriptive comments.		 */		for (i = 0; i < 1000000; i++) {			if (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP)				break;			udelay(10);		}		for (i = 0; i < 1000000; i++) {			if (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP))				break;			udelay(10);		}		do {			sec  = CMOS_READ(RTC_SECONDS);			min  = CMOS_READ(RTC_MINUTES);			hour = CMOS_READ(RTC_HOURS);			day  = CMOS_READ(RTC_DAY_OF_MONTH);			mon  = CMOS_READ(RTC_MONTH);			year = CMOS_READ(RTC_YEAR);		} while (sec != CMOS_READ(RTC_SECONDS));		if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) {			BCD_TO_BIN(sec);			BCD_TO_BIN(min);			BCD_TO_BIN(hour);			BCD_TO_BIN(day);			BCD_TO_BIN(mon);			BCD_TO_BIN(year);		}		if ((year += 1900) < 1970)			year += 100;	}	xtime.tv_sec = mktime(year, mon, day, hour, min, sec);	xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);	set_normalized_timespec(&wall_to_monotonic, 	                        -xtime.tv_sec, -xtime.tv_nsec);	if (mregs) {		tmp = mostek_read(mregs + MOSTEK_CREG);		tmp &= ~MSTK_CREG_READ;		mostek_write(mregs + MOSTEK_CREG, tmp);		spin_unlock_irq(&mostek_lock);	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b4bca26c0160f48b4eb04f21d31a229832732013/time.c/buggy/arch/sparc64/kernel/time.c