mstk48t59_regs = isadev->resource.start; 
mstk48t59_regs = (void * __iomem) isadev->resource.start; 
void __init clock_probe(void){	struct linux_prom_registers clk_reg[2];	char model[128];	int node, busnd = -1, err;	unsigned long flags;	struct linux_central *cbus;#ifdef CONFIG_PCI	struct linux_ebus *ebus = NULL;	struct sparc_isa_bridge *isa_br = NULL;#endif	static int invoked;	if (invoked)		return;	invoked = 1;	if (this_is_starfire) {		/* davem suggests we keep this within the 4M locked kernel image */		static char obp_gettod[256];		static u32 unix_tod;		sprintf(obp_gettod, "h# %08x unix-gettod",			(unsigned int) (long) &unix_tod);		prom_feval(obp_gettod);		xtime.tv_sec = unix_tod;		xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ);		set_normalized_timespec(&wall_to_monotonic,		                        -xtime.tv_sec, -xtime.tv_nsec);		return;	}	local_irq_save(flags);	cbus = central_bus;	if (cbus != NULL)		busnd = central_bus->child->prom_node;	/* Check FHC Central then EBUSs then ISA bridges then SBUSs.	 * That way we handle the presence of multiple properly.	 *	 * As a special case, machines with Central must provide the	 * timer chip there.	 */#ifdef CONFIG_PCI	if (ebus_chain != NULL) {		ebus = ebus_chain;		if (busnd == -1)			busnd = ebus->prom_node;	}	if (isa_chain != NULL) {		isa_br = isa_chain;		if (busnd == -1)			busnd = isa_br->prom_node;	}#endif	if (sbus_root != NULL && busnd == -1)		busnd = sbus_root->prom_node;	if (busnd == -1) {		prom_printf("clock_probe: problem, cannot find bus to search.\n");		prom_halt();	}	node = prom_getchild(busnd);	while (1) {		if (!node)			model[0] = 0;		else			prom_getstring(node, "model", model, sizeof(model));		if (strcmp(model, "mk48t02") &&		    strcmp(model, "mk48t08") &&		    strcmp(model, "mk48t59") &&		    strcmp(model, "m5819") &&		    strcmp(model, "m5819p") &&		    strcmp(model, "m5823") &&		    strcmp(model, "ds1287")) {			if (cbus != NULL) {				prom_printf("clock_probe: Central bus lacks timer chip.\n");				prom_halt();			}		   	if (node != 0)				node = prom_getsibling(node);#ifdef CONFIG_PCI			while ((node == 0) && ebus != NULL) {				ebus = ebus->next;				if (ebus != NULL) {					busnd = ebus->prom_node;					node = prom_getchild(busnd);				}			}			while ((node == 0) && isa_br != NULL) {				isa_br = isa_br->next;				if (isa_br != NULL) {					busnd = isa_br->prom_node;					node = prom_getchild(busnd);				}			}#endif			if (node == 0) {				prom_printf("clock_probe: Cannot find timer chip\n");				prom_halt();			}			continue;		}		err = prom_getproperty(node, "reg", (char *)clk_reg,				       sizeof(clk_reg));		if(err == -1) {			prom_printf("clock_probe: Cannot get Mostek reg property\n");			prom_halt();		}		if (cbus != NULL) {			apply_fhc_ranges(central_bus->child, clk_reg, 1);			apply_central_ranges(central_bus, clk_reg, 1);		}#ifdef CONFIG_PCI		else if (ebus != NULL) {			struct linux_ebus_device *edev;			for_each_ebusdev(edev, ebus)				if (edev->prom_node == node)					break;			if (edev == NULL) {				if (isa_chain != NULL)					goto try_isa_clock;				prom_printf("%s: Mostek not probed by EBUS\n",					    __FUNCTION__);				prom_halt();			}			if (!strcmp(model, "ds1287") ||			    !strcmp(model, "m5819") ||			    !strcmp(model, "m5819p") ||			    !strcmp(model, "m5823")) {				ds1287_regs = edev->resource[0].start;			} else {				mstk48t59_regs = edev->resource[0].start;				mstk48t02_regs = mstk48t59_regs + MOSTEK_48T59_48T02;			}			break;		}		else if (isa_br != NULL) {			struct sparc_isa_device *isadev;try_isa_clock:			for_each_isadev(isadev, isa_br)				if (isadev->prom_node == node)					break;			if (isadev == NULL) {				prom_printf("%s: Mostek not probed by ISA\n");				prom_halt();			}			if (!strcmp(model, "ds1287") ||			    !strcmp(model, "m5819") ||			    !strcmp(model, "m5819p") ||			    !strcmp(model, "m5823")) {				ds1287_regs = isadev->resource.start;			} else {				mstk48t59_regs = isadev->resource.start;				mstk48t02_regs = mstk48t59_regs + MOSTEK_48T59_48T02;			}			break;		}#endif		else {			if (sbus_root->num_sbus_ranges) {				int nranges = sbus_root->num_sbus_ranges;				int rngc;				for (rngc = 0; rngc < nranges; rngc++)					if (clk_reg[0].which_io ==					    sbus_root->sbus_ranges[rngc].ot_child_space)						break;				if (rngc == nranges) {					prom_printf("clock_probe: Cannot find ranges for "						    "clock regs.\n");					prom_halt();				}				clk_reg[0].which_io =					sbus_root->sbus_ranges[rngc].ot_parent_space;				clk_reg[0].phys_addr +=					sbus_root->sbus_ranges[rngc].ot_parent_base;			}		}		if(model[5] == '0' && model[6] == '2') {			mstk48t02_regs = (((u64)clk_reg[0].phys_addr) |					  (((u64)clk_reg[0].which_io)<<32UL));		} else if(model[5] == '0' && model[6] == '8') {			mstk48t08_regs = (((u64)clk_reg[0].phys_addr) |					  (((u64)clk_reg[0].which_io)<<32UL));			mstk48t02_regs = mstk48t08_regs + MOSTEK_48T08_48T02;		} else {			mstk48t59_regs = (((u64)clk_reg[0].phys_addr) |					  (((u64)clk_reg[0].which_io)<<32UL));			mstk48t02_regs = mstk48t59_regs + MOSTEK_48T59_48T02;		}		break;	}	if (mstk48t02_regs != 0UL) {		/* Report a low battery voltage condition. */		if (has_low_battery())			prom_printf("NVRAM: Low battery voltage!\n");		/* Kick start the clock if it is completely stopped. */		if (mostek_read(mstk48t02_regs + MOSTEK_SEC) & MSTK_STOP)			kick_start_clock();	}	set_system_time();		local_irq_restore(flags);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b4bca26c0160f48b4eb04f21d31a229832732013/time.c/buggy/arch/sparc64/kernel/time.c