예제 #1
0
파일: jiq.c 프로젝트: yql612679/linux-drive
static int jiq_read_run_timer(char *buf, char **start, off_t offset,
                   int len, int *eof, void *data)
{

	jiq_data.len = 0;           /* prepare the argument for jiq_print() */
	jiq_data.buf = buf;
	jiq_data.jiffies = jiffies;

	init_timer(&jiq_timer);              /* init the timer structure */
	jiq_timer.function = jiq_timedout;
	jiq_timer.data = (unsigned long)&jiq_data;
	jiq_timer.expires = jiffies + HZ; /* one second */

	jiq_print(&jiq_data);   /* print and go to sleep */
	add_timer(&jiq_timer);
	interruptible_sleep_on(&jiq_wait);  /* RACE */
	del_timer_sync(&jiq_timer);  /* in case a signal woke us up */
    
	*eof = 1;
	return jiq_data.len;
}
예제 #2
0
파일: jiq.c 프로젝트: sciampoli/slyRepo
static void jiq_timedout(unsigned long ptr)
{
	jiq_print((void *)ptr);            /* print a line */
	wake_up_interruptible(&jiq_wait);  /* awake the process */
}
예제 #3
0
파일: jiq.c 프로젝트: sciampoli/slyRepo
/*
 * Call jiq_print from a tasklet
 */
static void jiq_print_tasklet(unsigned long ptr)
{
	if (jiq_print ((void *) ptr))
		tasklet_schedule (&jiq_tasklet);
}
예제 #4
0
파일: jiq.c 프로젝트: zxbuaa/ldd3
/*
 * Call jiq_print from a tasklet
 */
static void jiq_print_tasklet(unsigned long ptr)
{
	if (!jiq_print((struct clientdata *)ptr))
		return;
	tasklet_schedule(&jiq_tasklet);
}