示例#1
0
ER
rot_rdq(PRI tskpri)
{
	uint_t	pri;
	QUEUE	*p_queue;
	ER		ercd;

	LOG_ROT_RDQ_ENTER(tskpri);
	CHECK_TSKCTX_UNL();
	CHECK_TPRI_SELF(tskpri);

	t_lock_cpu();
	pri = (tskpri == TPRI_SELF) ? p_runtsk->priority : INT_PRIORITY(tskpri);
	p_queue = &(ready_queue[pri]);
	if (queue_empty(p_queue)) {
		ercd = E_OK;
	}
	else if ((((TCB *)(p_queue->p_next))->p_tinib->tskatr & TA_RSTR) != 0U) {
		ercd = E_NOSPT;
	}
	else {
		if (rotate_ready_queue(p_queue)) {
			dispatch();
		}
		ercd = E_OK;
	}
	t_unlock_cpu();

  error_exit:
	LOG_ROT_RDQ_LEAVE(ercd);
	return(ercd);
}
示例#2
0
ER
irot_rdq(PRI tskpri)
{
	QUEUE	*p_queue;
	ER		ercd;

	LOG_IROT_RDQ_ENTER(tskpri);
	CHECK_INTCTX_UNL();
	CHECK_TPRI(tskpri);

	i_lock_cpu();
	p_queue = &(ready_queue[INT_PRIORITY(tskpri)]);
	if (queue_empty(p_queue)) {
		ercd = E_OK;
	}
	else if ((((TCB *)(p_queue->p_next))->p_tinib->tskatr & TA_RSTR) != 0U) {
		ercd = E_NOSPT;
	}
	else {
		if (rotate_ready_queue(p_queue)) {
			reqflg = true;
		}
		ercd = E_OK;
	}
	i_unlock_cpu();

  error_exit:
	LOG_IROT_RDQ_LEAVE(ercd);
	return(ercd);
}
示例#3
0
ER
imrot_rdq(PRI tskpri, ID prcid)
{
	ER		ercd;
	PCB		*p_pcb;
	PCB		*my_p_pcb;

	LOG_IMROT_RDQ_ENTER(tskpri, prcid);
	CHECK_INTCTX_UNL();
	CHECK_TPRI(tskpri);
	CHECK_PRCID(prcid);

	i_lock_cpu();
	p_pcb = i_acquire_tsk_lock_prcid(prcid);
	if (rotate_ready_queue(INT_PRIORITY(tskpri), p_pcb)) {
		my_p_pcb = get_my_p_pcb();
		my_p_pcb->reqflg = dispatch_request(p_pcb) ? true : my_p_pcb->reqflg;
	}
	ercd = E_OK;
	release_tsk_lock(p_pcb);
	i_unlock_cpu();

  error_exit:
	LOG_IMROT_RDQ_LEAVE(ercd);
	return(ercd);
}
示例#4
0
ER
mrot_rdq(PRI tskpri, ID prcid)
{
	uint_t	pri;
	ER		ercd;
	bool_t	dspreq = false;
	PCB		*p_pcb;
	
	LOG_MROT_RDQ_ENTER(tskpri, prcid);
	CHECK_TSKCTX_UNL();
	CHECK_TPRI_SELF(tskpri);
	CHECK_PRCID(prcid);

	t_lock_cpu();
	p_pcb = t_acquire_tsk_lock_prcid(prcid);
	pri = (tskpri == TPRI_SELF) ? (get_my_p_pcb())->p_runtsk->priority : INT_PRIORITY(tskpri);
	if (rotate_ready_queue(pri, p_pcb)) {
		dspreq = dispatch_request(p_pcb);
	}
	ercd = E_OK;
	release_tsk_lock(p_pcb);
	if (dspreq) {
		dispatch();
	}
	t_unlock_cpu();

  error_exit:
	LOG_MROT_RDQ_LEAVE(ercd);
	return(ercd);
}
示例#5
0
ER
rot_rdq(PRI tskpri)
{
	uint_t	pri;
	ER		ercd;
	bool_t	dspreq = false;
	PCB		*my_p_pcb;

	LOG_ROT_RDQ_ENTER(tskpri);
	CHECK_TSKCTX_UNL();
	CHECK_TPRI_SELF(tskpri);

	t_lock_cpu();
	my_p_pcb = t_acquire_tsk_lock_self_without_runnable_check();
	pri = (tskpri == TPRI_SELF) ? my_p_pcb->p_runtsk->priority : INT_PRIORITY(tskpri);
	dspreq = rotate_ready_queue(pri, my_p_pcb);
	ercd = E_OK;
	release_tsk_lock(my_p_pcb);
	if (dspreq) {
		dispatch();
	}
	t_unlock_cpu();

  error_exit:
	LOG_ROT_RDQ_LEAVE(ercd);
	return(ercd);
}
示例#6
0
/*
 * Rotate ready queue
 */
SYSCALL ER _tk_rot_rdq( PRI tskpri )
{
	CHECK_PRI_RUN(tskpri);

	BEGIN_CRITICAL_SECTION;
	if ( tskpri == TPRI_RUN ) {
		if ( in_indp() ) {
			rotate_ready_queue_run();
		} else {
			rotate_ready_queue(ctxtsk->priority);
		}
	} else {
		rotate_ready_queue(int_priority(tskpri));
	}
	END_CRITICAL_SECTION;

	return E_OK;
}
示例#7
0
ER
irot_rdq(PRI tskpri)
{
	ER		ercd;

	LOG_IROT_RDQ_ENTER(tskpri);
	CHECK_INTCTX_UNL();
	CHECK_TPRI(tskpri);

	i_lock_cpu();
	if (rotate_ready_queue(INT_PRIORITY(tskpri))) {
		reqflg = true;
	}
	ercd = E_OK;
	i_unlock_cpu();

  error_exit:
	LOG_IROT_RDQ_LEAVE(ercd);
	return(ercd);
}
示例#8
0
ER
rot_rdq(PRI tskpri)
{
	uint_t	pri;
	ER		ercd;

	LOG_ROT_RDQ_ENTER(tskpri);
	CHECK_TSKCTX_UNL();
	CHECK_TPRI_SELF(tskpri);

	t_lock_cpu();
	pri = (tskpri == TPRI_SELF) ? p_runtsk->priority : INT_PRIORITY(tskpri);
	if (rotate_ready_queue(pri)) {
		dispatch();
	}
	ercd = E_OK;
	t_unlock_cpu();

  error_exit:
	LOG_ROT_RDQ_LEAVE(ercd);
	return(ercd);
}
示例#9
0
ER
irot_rdq(PRI tskpri)
{
	ER		ercd;
	PCB		*my_p_pcb;

	LOG_IROT_RDQ_ENTER(tskpri);
	CHECK_INTCTX_UNL();
	CHECK_TPRI(tskpri);

	i_lock_cpu();
	my_p_pcb = i_acquire_tsk_lock_self();
	if (rotate_ready_queue(INT_PRIORITY(tskpri), my_p_pcb)) {
		my_p_pcb->reqflg = true;
	}
	ercd = E_OK;
	release_tsk_lock(my_p_pcb);
	i_unlock_cpu();

  error_exit:
	LOG_IROT_RDQ_LEAVE(ercd);
	return(ercd);
}