本文整理汇总了C++中CHECK_TSKCTX_UNL函数的典型用法代码示例。如果您正苦于以下问题:C++ CHECK_TSKCTX_UNL函数的具体用法?C++ CHECK_TSKCTX_UNL怎么用?C++ CHECK_TSKCTX_UNL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CHECK_TSKCTX_UNL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sac_pdq
ER
sac_pdq(ID pdqid, const ACVCT *p_acvct)
{
PDQCB *p_pdqcb;
PDQINIB *p_pdqinib;
ER ercd;
LOG_SAC_PDQ_ENTER(pdqid, p_acvct);
CHECK_TSKCTX_UNL();
CHECK_PDQID(pdqid);
CHECK_MACV_READ(p_acvct, ACVCT);
p_pdqcb = get_pdqcb(pdqid);
t_lock_cpu();
if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
ercd = E_NOEXS;
}
else if (VIOLATE_ACPTN(p_pdqcb->p_pdqinib->acvct.acptn3)) {
ercd = E_OACV;
}
else if (PDQID(p_pdqcb) > tmax_spdqid) {
p_pdqinib = (PDQINIB *)(p_pdqcb->p_pdqinib);
p_pdqinib->acvct = *p_acvct;
ercd = E_OK;
}
else {
ercd = E_OBJ;
}
t_unlock_cpu();
error_exit:
LOG_SAC_PDQ_LEAVE(ercd);
return(ercd);
}
示例2: ref_alm
ER
ref_alm(ID almid, T_RALM *pk_ralm)
{
ALMCB *p_almcb;
ER ercd;
LOG_REF_ALM_ENTER(almid, pk_ralm);
CHECK_TSKCTX_UNL();
CHECK_ALMID(almid);
p_almcb = get_almcb(almid);
t_lock_cpu();
if (p_almcb->almsta) {
pk_ralm->almstat = TALM_STA;
pk_ralm->lefttim = tmevt_lefttim(&(p_almcb->tmevtb));
}
else {
pk_ralm->almstat = TALM_STP;
}
ercd = E_OK;
t_unlock_cpu();
error_exit:
LOG_REF_ALM_LEAVE(ercd, pk_ralm);
return(ercd);
}
示例3: ini_pdq
ER
ini_pdq(ID pdqid)
{
PDQCB *p_pdqcb;
ER ercd;
LOG_INI_PDQ_ENTER(pdqid);
CHECK_TSKCTX_UNL();
CHECK_ID(VALID_PDQID(pdqid));
p_pdqcb = get_pdqcb(pdqid);
lock_cpu();
init_wait_queue(&(p_pdqcb->swait_queue));
init_wait_queue(&(p_pdqcb->rwait_queue));
p_pdqcb->count = 0U;
p_pdqcb->p_head = NULL;
p_pdqcb->unused = 0U;
p_pdqcb->p_freelist = NULL;
if (p_runtsk != p_schedtsk) {
dispatch();
}
ercd = E_OK;
unlock_cpu();
error_exit:
LOG_INI_PDQ_LEAVE(ercd);
return(ercd);
}
示例4: get_pri
ER
get_pri(ID tskid, PRI *p_tskpri)
{
TCB *p_tcb;
ER ercd;
LOG_GET_PRI_ENTER(tskid, p_tskpri);
CHECK_TSKCTX_UNL();
CHECK_TSKID_SELF(tskid);
CHECK_MACV_WRITE(p_tskpri, PRI);
p_tcb = get_tcb_self(tskid);
CHECK_ACPTN(p_tcb->p_tinib->acvct.acptn4);
t_lock_cpu();
if (TSTAT_DORMANT(p_tcb->tstat)) {
ercd = E_OBJ;
}
else {
*p_tskpri = EXT_TSKPRI(p_tcb->priority);
ercd = E_OK;
}
t_unlock_cpu();
error_exit:
LOG_GET_PRI_LEAVE(ercd, *p_tskpri);
return(ercd);
}
示例5: get_pri
ER
get_pri(ID tskid, PRI *p_tskpri)
{
TCB *p_tcb;
ER ercd;
LOG_GET_PRI_ENTER(tskid, p_tskpri);
CHECK_TSKCTX_UNL(); /*[NGKI1203][NGKI1204]*/
if (tskid == TSK_SELF) {
p_tcb = p_runtsk; /*[NGKI1211]*/
}
else {
CHECK_ID(VALID_TSKID(tskid)); /*[NGKI1205]*/
p_tcb = get_tcb(tskid);
}
lock_cpu();
if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
ercd = E_NOEXS; /*[NGKI1206]*/
}
else if (TSTAT_DORMANT(p_tcb->tstat)) {
ercd = E_OBJ; /*[NGKI1209]*/
}
else {
*p_tskpri = EXT_TSKPRI(p_tcb->priority); /*[NGKI1210]*/
ercd = E_OK;
}
unlock_cpu();
error_exit:
LOG_GET_PRI_LEAVE(ercd, p_tskpri);
return(ercd);
}
示例6: rot_rdq
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);
}
示例7: ini_dtq
ER
ini_dtq(ID dtqid)
{
DTQCB *p_dtqcb;
bool_t dspreq;
ER ercd;
LOG_INI_DTQ_ENTER(dtqid);
CHECK_TSKCTX_UNL();
CHECK_DTQID(dtqid);
p_dtqcb = get_dtqcb(dtqid);
t_lock_cpu();
dspreq = init_wait_queue(&(p_dtqcb->swait_queue));
if (init_wait_queue(&(p_dtqcb->rwait_queue))) {
dspreq = true;
};
p_dtqcb->count = 0U;
p_dtqcb->head = 0U;
p_dtqcb->tail = 0U;
if (dspreq) {
dispatch();
}
ercd = E_OK;
t_unlock_cpu();
error_exit:
LOG_INI_DTQ_LEAVE(ercd);
return(ercd);
}
示例8: sig_sem
JSP_L1_CODE
SYSCALL ER
sig_sem(ID semid)
{
SEMCB *semcb;
TCB *tcb;
ER ercd;
LOG_SIG_SEM_ENTER(semid);
CHECK_TSKCTX_UNL();
CHECK_SEMID(semid);
semcb = get_semcb(semid);
t_lock_cpu();
if (!(queue_empty(&(semcb->wait_queue)))) {
tcb = (TCB *) queue_delete_next(&(semcb->wait_queue));
if (wait_complete(tcb)) {
dispatch();
}
ercd = E_OK;
}
else if (semcb->semcnt < semcb->seminib->maxsem) {
semcb->semcnt += 1;
ercd = E_OK;
}
else {
ercd = E_QOVR;
}
t_unlock_cpu();
exit:
LOG_SIG_SEM_LEAVE(ercd);
return(ercd);
}
示例9: rot_rdq
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);
}
示例10: stp_ovr
ER
stp_ovr(ID tskid)
{
TCB *p_tcb;
ER ercd;
LOG_STP_OVR_ENTER(tskid);
CHECK_TSKCTX_UNL();
CHECK_OBJ(ovrinib.ovrhdr != NULL);
CHECK_TSKID_SELF(tskid);
p_tcb = get_tcb_self(tskid);
t_lock_cpu();
if (p_tcb->p_tinib->tskatr == TA_NOEXS) {
ercd = E_NOEXS;
}
else if (VIOLATE_ACPTN(p_tcb->p_tinib->acvct.acptn2)) {
ercd = E_OACV;
}
else {
if (p_tcb->leftotm > 0U) {
if (p_tcb == p_runtsk) {
(void) target_ovrtimer_stop();
ovrtimer_flag = false;
}
p_tcb->leftotm = 0U;
}
ercd = E_OK;
}
t_unlock_cpu();
error_exit:
LOG_STP_OVR_LEAVE(ercd);
return(ercd);
}
示例11: pol_sem
JSP_L1_CODE
SYSCALL ER
pol_sem(ID semid)
{
SEMCB *semcb;
ER ercd;
LOG_POL_SEM_ENTER(semid);
CHECK_TSKCTX_UNL();
CHECK_SEMID(semid);
semcb = get_semcb(semid);
t_lock_cpu();
if (semcb->semcnt >= 1) {
semcb->semcnt -= 1;
ercd = E_OK;
}
else {
ercd = E_TMOUT;
}
t_unlock_cpu();
exit:
LOG_POL_SEM_LEAVE(ercd);
return(ercd);
}
示例12: chg_ipm
ER
chg_ipm(PRI intpri)
{
ER ercd;
LOG_CHG_IPM_ENTER(intpri);
CHECK_TSKCTX_UNL();
CHECK_INTPRI_CHGIPM(intpri);
t_lock_cpu();
t_set_ipm(intpri);
if (intpri == TIPM_ENAALL) {
ipmflg = true;
if (!disdsp) {
dspflg = true;
if (p_runtsk != p_schedtsk) {
dispatch();
}
}
if (p_runtsk->enatex && p_runtsk->texptn != 0U) {
call_texrtn();
}
}
else {
ipmflg = false;
dspflg = false;
}
ercd = E_OK;
t_unlock_cpu();
error_exit:
LOG_CHG_IPM_LEAVE(ercd);
return(ercd);
}
示例13: del_isr
ER
del_isr(ID isrid)
{
ISRCB *p_isrcb;
ISRINIB *p_isrinib;
ER ercd;
LOG_DEL_ISR_ENTER(isrid);
CHECK_TSKCTX_UNL();
CHECK_ISRID(isrid);
p_isrcb = get_isrcb(isrid);
t_lock_cpu();
if (p_isrcb->p_isrinib->isratr == TA_NOEXS) {
ercd = E_NOEXS;
}
else {
queue_delete(&(p_isrcb->isr_queue));
p_isrinib = (ISRINIB *)(p_isrcb->p_isrinib);
p_isrinib->isratr = TA_NOEXS;
queue_insert_prev(&free_isrcb, &(p_isrcb->isr_queue));
ercd = E_OK;
}
t_unlock_cpu();
error_exit:
LOG_DEL_ISR_LEAVE(ercd);
return(ercd);
}
示例14: ref_pdq
ER
ref_pdq(ID pdqid, T_RPDQ *pk_rpdq)
{
PDQCB *p_pdqcb;
ER ercd;
LOG_REF_PDQ_ENTER(pdqid, pk_rpdq);
CHECK_TSKCTX_UNL();
CHECK_PDQID(pdqid);
CHECK_MACV_WRITE(pk_rpdq, T_RPDQ);
p_pdqcb = get_pdqcb(pdqid);
t_lock_cpu();
if (p_pdqcb->p_pdqinib->pdqatr == TA_NOEXS) {
ercd = E_NOEXS;
}
else if (VIOLATE_ACPTN(p_pdqcb->p_pdqinib->acvct.acptn4)) {
ercd = E_OACV;
}
else {
pk_rpdq->stskid = wait_tskid(&(p_pdqcb->swait_queue));
pk_rpdq->rtskid = wait_tskid(&(p_pdqcb->rwait_queue));
pk_rpdq->spdqcnt = p_pdqcb->count;
ercd = E_OK;
}
t_unlock_cpu();
error_exit:
LOG_REF_PDQ_LEAVE(ercd, pk_rpdq);
return(ercd);
}
示例15: ena_tex
JSP_L1_CODE
SYSCALL ER
ena_tex()
{
ER ercd;
LOG_ENA_TEX_ENTER();
CHECK_TSKCTX_UNL();
t_lock_cpu();
if (runtsk->tinib->texrtn == NULL) {
ercd = E_OBJ;
}
else {
runtsk->enatex = TRUE;
if (runtsk->texptn != 0) {
call_texrtn();
}
ercd = E_OK;
}
t_unlock_cpu();
exit:
LOG_ENA_TEX_LEAVE(ercd);
return(ercd);
}