int i830_wait_irq(drm_device_t *dev, int irq_nr) 
static int i830_wait_irq(drm_device_t *dev, int irq_nr) 
int i830_wait_irq(drm_device_t *dev, int irq_nr){  	drm_i830_private_t *dev_priv = 	   (drm_i830_private_t *)dev->dev_private;	DECLARE_WAITQUEUE(entry, current);	unsigned long end = jiffies + HZ*3;	int ret = 0;	DRM_DEBUG("%s\n", __FUNCTION__); 	if (atomic_read(&dev_priv->irq_received) >= irq_nr)   		return 0; 	dev_priv->sarea_priv->perf_boxes |= I830_BOX_WAIT;	add_wait_queue(&dev_priv->irq_queue, &entry);	for (;;) {		__set_current_state(TASK_INTERRUPTIBLE);	   	if (atomic_read(&dev_priv->irq_received) >= irq_nr) 		   break;		if((signed)(end - jiffies) <= 0) {			DRM_ERROR("timeout iir %x imr %x ier %x hwstam %x\n",				  I830_READ16( I830REG_INT_IDENTITY_R ),				  I830_READ16( I830REG_INT_MASK_R ),				  I830_READ16( I830REG_INT_ENABLE_R ),				  I830_READ16( I830REG_HWSTAM ));		   	ret = -EBUSY;	/* Lockup?  Missed irq? */			break;		}	      	schedule_timeout(HZ*3);	      	if (signal_pending(current)) {		   	ret = -EINTR;			break;		}	}	__set_current_state(TASK_RUNNING);	remove_wait_queue(&dev_priv->irq_queue, &entry);	return ret;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c94f70298529d99ac6e1ee7709f61eab00adeb39/i830_irq.c/clean/drivers/char/drm/i830_irq.c