示例#1
0
int main(int argc, const char *argv[])
{
#if 1
	CIRCLEQ_HEAD(circleq, _Data)	head = CIRCLEQ_HEAD_INITIALIZER(head);
#else
	CIRCLEQ_HEAD(circleq, _Data)	head;
	CIRCLEQ_INIT(&head);
#endif
	exit(EXIT_SUCCESS);
}
示例#2
0
文件: sched.c 项目: cod5/kielder
/*
 * SchedUnready();
 *
 * Removes process from the ready queue.  See SchedReady() above.
 */

void SchedUnready (struct Process *proc)
{
	int32 bm; 
	int32 q;
	int32 unsigned_pri;
	

	unsigned_pri = (int32)proc->priority + 128;
	bm = unsigned_pri / 32;
	q = unsigned_pri % 32;
		
	reschedule_request = TRUE;

	proc->quanta_used = 0;
	
	CIRCLEQ_REM_ENTRY (&sched_queue[unsigned_pri], proc, sched_entry);
	
	if (CIRCLEQ_HEAD (&sched_queue[unsigned_pri]) == NULL)
示例#3
0
文件: sched.c 项目: cod5/kielder
void PickProc (void)
{
	int32 bm;
	int32 q;
	

	if (reschedule_request == TRUE && current_process->preempt_cnt == 0)
	{
		if (current_process->state == PROC_STATE_RUNNING)
			current_process->state = PROC_STATE_READY;
		
		/*if (current_process->quanta_used > 4)
		{*/
			CIRCLEQ_FORWARD (&sched_queue[current_process->priority+128], sched_entry);
			current_process->quanta_used = 0;
		
		/*}*/
		
		
		current_process = NULL;
		
		for (bm=7; bm >= 0 && current_process == NULL; bm--)
		{
			for (q=31; q >= 0 && current_process == NULL; q--)
			{
				if (sched_queue_bitmap[bm] & (1<<q))
				{
					current_process = CIRCLEQ_HEAD (&sched_queue[(bm*32)+q]);
					current_process->state = PROC_STATE_RUNNING;
				}
			}
		}

	
		ArchPickProc (current_process);
		
		reschedule_request = FALSE;
	}
}