sdk/linux_kernel_drivers/xocl/xocl_exec.c
/**
 * scheduler_wait_condition() - Check status of scheduler wait condition
 * 
 * Scheduler must wait (sleep) if 
 *   1. there are no pending commands
 *   2. no pending interrupt from embedded scheduler
 *   3. no pending complete commands in polling mode
 *
 * Return: 1 if scheduler must wait, 0 othewise
 */
Check status of scheduler wait condition

Scheduler must wait (sleep) if
1. there are no pending commands
2. no pending interrupt from embedded scheduler
3. no pending complete commands in polling mode

1 if scheduler must wait, 0 othewise
Check status of scheduler wait condition Scheduler must wait ( sleep ) if 1 . there are no pending commands 2 . no pending interrupt from embedded scheduler 3 . no pending complete commands in polling mode 1 if scheduler must wait 0 othewise
static int
scheduler_wait_condition(struct xocl_sched *xs)
{
	if (kthread_should_stop() || xs->error) {
		SCHED_DEBUG("scheduler wakes kthread_should_stop\n");
		return 0;
	}
	if (atomic_read(&num_pending)) {
		SCHED_DEBUG("scheduler wakes to copy new pending commands\n");
		return 0;
	}
	if (atomic_read(&xs->intc)) {
		SCHED_DEBUG("scheduler wakes on interrupt\n");
		atomic_set(&xs->intc,0);
		return 0;
	}
	if (atomic_read(&xs->poll)) {
		SCHED_DEBUG("scheduler wakes to poll\n");
		return 0;
	}
	SCHED_DEBUG("scheduler waits ...\n");
	return 1;
}
static int scheduler_wait_condition ( struct xocl_sched * xs ) { if ( kthread_should_stop ( ) || xs -> error ) { SCHED_DEBUG ( " \n " ) ; return 0 ; } if ( atomic_read ( & num_pending ) ) { SCHED_DEBUG ( " \n " ) ; return 0 ; } if ( atomic_read ( & xs -> intc ) ) { SCHED_DEBUG ( " \n " ) ; atomic_set ( & xs -> intc , 0 ) ; return 0 ; } if ( atomic_read ( & xs -> poll ) ) { SCHED_DEBUG ( " \n " ) ; return 0 ; } SCHED_DEBUG ( " \n " ) ; return 1 ; }
scheduler_wait_condition() - Check status of scheduler wait condition
scheduler_wait_condition () - Check status of scheduler wait condition