int timeout = 5000; 
int status; 
static snd_pcm_uframes_t snd_via8233_pcm_pointer(snd_pcm_substream_t *substream){	via82xx_t *chip = snd_pcm_substream_chip(substream);	viadev_t *viadev = (viadev_t *)substream->runtime->private_data;	unsigned int idx, count, res;	int timeout = 5000;		snd_assert(viadev->tbl_entries, return 0);	if (!(inb(VIADEV_REG(viadev, OFFSET_STATUS)) & VIA_REG_STAT_ACTIVE))		return 0;	spin_lock(&chip->reg_lock);	do {		count = inl(VIADEV_REG(viadev, OFFSET_CURR_COUNT));		/* some mobos read 0 count */		if ((count & 0xffffff) || ! viadev->running)			break;	} while (--timeout);	if (! timeout)		snd_printd(KERN_ERR "zero position is read\n");	idx = count >> 24;	if (idx >= viadev->tbl_entries) {#ifdef POINTER_DEBUG		printk("fail: invalid idx = %i/%i\n", idx, viadev->tbl_entries);#endif		res = viadev->lastpos;	} else {		count &= 0xffffff;		res = calc_linear_pos(viadev, idx, count);	}	spin_unlock(&chip->reg_lock);	return bytes_to_frames(substream->runtime, res);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4f550df58f4758ea023704b409830ad9c3b47771/via82xx.c/clean/sound/pci/via82xx.c