📄 jsp_check.cpp
字号:
"僞僗僋椺奜偵柍岠側懏惈(TA_HLNG,TA_ASM埲奜) 偑愝掕偝傟偰偄傑偡"));
// 懏惈抣偵 TA_ASM 偑娷傑傟偰偄傞
if((*texatr & 0x1) != 0)
notify( RESTRICTED,
Message("TA_ASM, specified as texatr, does not always take effect.",
"僞僗僋椺奜偵TA_ASM偑巜掕偝傟偰偄傑偡"));
/*
* 僗僞僢僋僠僃僢僋
*/
// 僗僞僢僋僒僀僘偑0
if(*stksz == 0)
notify(RESTRICTED,
Message("Stack size is equal to zero.",
"僗僞僢僋僒僀僘偵0偑愝掕偝傟偰偄傑偡"));
// 僗僞僢僋偺斣抧偑0
if(*stksz == 0)
notify(RESTRICTED,
Message("The address of task stack is equal to zero.",
"僗僞僢僋奐巒斣抧偵0偑愝掕偝傟偰偄傑偡"));
++ tskatr, ++ task, ++ ipriority, ++ texatr, ++ stksz;
}
return old_error_count == error_count;
}
bool ConfigurationChecker::check_semaphoreblock(Directory & parameter, FileContainer * container)
{
unsigned int id;
unsigned int old_error_count = error_count;
Message object("Semaphore","僙儅僼僅");
TargetVariable<DT_UINT> _kernel_tmax_semid("_kernel_tmax_semid");
if(*_kernel_tmax_semid < 1)
return true;
TargetVariable<DT_UINT> sematr("_kernel_seminib_table","semaphore_initialization_block::sematr");
TargetVariable<DT_UINT> maxsem("_kernel_seminib_table","semaphore_initialization_block::maxsem");
TargetVariable<DT_UINT> isemcnt("_kernel_seminib_table","semaphore_initialization_block::isemcnt");
VerboseMessage("% object : % items\n","%僆僽僕僃僋僩 : % 屄\n")
<< object << *_kernel_tmax_semid;
for(id = 1; id <= *_kernel_tmax_semid; id++)
{
set_banner(parameter, object, SEMAPHORE, id);
//attribute validation check
if((*sematr & ~0x1) != 0)
notify(STANDARD,
Message("Illegal attribute (It should be (TA_TFIFO||TA_TPRI)).",
"(TA_TFIFO||TA_TPRI)埲奜偺懏惈偑巜掕偝傟偰偄傞"));
//maxcnt < isemcnt
if(*maxsem < *isemcnt)
notify(STANDARD,
Message("Initial count[%] is greater than the maximum count[%] of this semaphore",
"弶婜抣[%]偑嵟戝抣[%]傪挻偊偰偄傞") << *isemcnt << *maxsem);
if(*maxsem == 0)
notify(STANDARD,
Message("Maximum count must be greater than zero.",
"僙儅僼僅偺嵟戝僇僂儞僩偼1埲忋偱側偗傟偽偄偗傑偣傫"));
++ sematr, ++ maxsem, ++ isemcnt;
}
return old_error_count == error_count;
}
bool ConfigurationChecker::check_eventflagblock(Directory & parameter, FileContainer * container)
{
unsigned int id;
unsigned int old_error_count = error_count;
Message object("Event flag","僀儀儞僩僼儔僌");
TargetVariable<DT_UINT> _kernel_tmax_flgid("_kernel_tmax_flgid");
if(*_kernel_tmax_flgid < 1)
return true;
TargetVariable<DT_UINT> flgatr("_kernel_flginib_table","eventflag_initialization_block::flgatr");
VerboseMessage("% object : % items\n","%僆僽僕僃僋僩 : % 屄\n")
<< object << *_kernel_tmax_flgid;
for(id = 1; id <= *_kernel_tmax_flgid; id++)
{
set_banner(parameter, object, EVENTFLAG, id);
//attribute validation check
if((*flgatr & ~0x7) != 0)
notify(STANDARD,
Message("Illegal attribute value [0x%]",
"偍偐偟側懏惈抣 [0x%]") << setbase(16) << (*flgatr & ~0x7));
if((*flgatr & 0x2) != 0)
notify(TOPPERS, //埶懚晹偱捈傜側偄偺偱RESTRICTED偵偟側偄
Message("Attribute TA_WMUL is not supported in current version.",
"TA_WMUL偼僒億乕僩奜"));
++ flgatr;
}
return old_error_count == error_count;
}
bool ConfigurationChecker::check_dataqueueblock(Directory & parameter, FileContainer * container)
{
unsigned int id;
unsigned int old_error_count = error_count;
Message object("Data queue","僨乕僞僉儏乕");
TargetVariable<DT_UINT> _kernel_tmax_dtqid("_kernel_tmax_dtqid");
if(*_kernel_tmax_dtqid < 1)
return true;
TargetVariable<DT_UINT> dtqatr("_kernel_dtqinib_table", "dataqueue_initialization_block::dtqatr");
TargetVariable<DT_UINT> dtqcnt("_kernel_dtqinib_table", "dataqueue_initialization_block::dtqcnt");
TargetVariable<DT_VP_INT> dtq("_kernel_dtqinib_table", "dataqueue_initialization_block::dtq");
VerboseMessage("% object : % items\n","%僆僽僕僃僋僩 : % 屄\n")
<< object << *_kernel_tmax_dtqid;
for(id = 1; id <= *_kernel_tmax_dtqid; id++)
{
set_banner(parameter, object, DATAQUEUE, id);
//attribute validation check
if((*dtqatr & ~0x1) != 0)
notify(STANDARD,
Message("Illegal attribute value [0x%]",
"偍偐偟側懏惈抣 [0x%]") << setbase(16) << (*dtqatr & ~0x1));
if(*dtqcnt != 0 && *dtq == 0)
notify(TOPPERS,
Message("Dataqueue buffer should not be NULL", "僨乕僞僉儏乕偺僶僢僼傽偑NULL抣"));
++ dtqatr, ++ dtqcnt, ++ dtq;
}
return old_error_count == error_count;
}
bool ConfigurationChecker::check_mailboxblock(Directory & parameter, FileContainer * container)
{
unsigned int id;
unsigned int old_error_count = error_count;
Message object("Mailbox","儊乕儖儃僢僋僗");
TargetVariable<DT_UINT> _kernel_tmax_mbxid("_kernel_tmax_mbxid");
if(*_kernel_tmax_mbxid < 1)
return true;
TargetVariable<DT_UINT> mbxatr("_kernel_mbxinib_table","mailbox_initialization_block::mbxatr");
TargetVariable<DT_INT> maxmpri("_kernel_mbxinib_table","mailbox_initialization_block::maxmpri");
DT_INT maxpri = container->getVariableInfo("TMAX_MPRI").value;
DT_INT minpri = container->getVariableInfo("TMIN_MPRI").value;
VerboseMessage("% object : % items\n","%僆僽僕僃僋僩 : % 屄\n") << object << *_kernel_tmax_mbxid;
for(id = 1; id <= *_kernel_tmax_mbxid; id++)
{
set_banner(parameter, object, MAILBOX, id);
//attribute validation check
if((*mbxatr & ~0x3) != 0)
notify(STANDARD,
Message("Illegal attribute value [0x%]",
"偍偐偟側懏惈抣 [0x%]") << setbase(16) << (*mbxatr & ~0x3));
//mailbox message priority check
if(*maxmpri < 0)
notify(STANDARD,
Message("Priority must not be a negative number.","桪愭搙偑晧抣"));
if(*maxmpri < minpri)
notify(STANDARD,
Message("Message priority should be greater than or equal to %.",
"儊僢僙乕僕桪愭搙偼%埲忋偱側偗傟偽偄偗傑偣傫") << minpri);
if(*maxmpri > maxpri)
notify(STANDARD,
Message("Message priority should be less than or equal to %.",
"儊僢僙乕僕桪愭搙偼%埲壓偱側偗傟偽偄偗傑偣傫") << maxpri);
++ mbxatr, ++ maxmpri;
}
return old_error_count == error_count;
}
bool ConfigurationChecker::check_fixed_memorypoolblock(Directory & parameter, FileContainer * container)
{
unsigned int id;
unsigned int old_error_count = error_count;
Message object("Fixed size memory pool","屌掕挿儊儌儕僾乕儖");
TargetVariable<DT_UINT> _kernel_tmax_mpfid("_kernel_tmax_mpfid");
if(*_kernel_tmax_mpfid < 1)
return true;
TargetVariable<DT_UINT> mpfatr("_kernel_mpfinib_table", "fixed_memorypool_initialization_block::mpfatr");
TargetVariable<DT_UINT> limit ("_kernel_mpfinib_table", "fixed_memorypool_initialization_block::limit");
TargetVariable<DT_VP> mpf ("_kernel_mpfinib_table", "fixed_memorypool_initialization_block::mpf");
TargetVariable<DT_UINT> blksz ("_kernel_mpfinib_table", "fixed_memorypool_initialization_block::blksz");
VerboseMessage("% object : % items\n","%僆僽僕僃僋僩 : % 屄\n") << object << *_kernel_tmax_mpfid;
for(id = 1; id <= *_kernel_tmax_mpfid; id++)
{
set_banner(parameter, object, FIXEDSIZEMEMORYPOOL, id);
//attribute validation check
if((*mpfatr & ~0x1) != 0)
notify(STANDARD,
Message("Illegal attribute value [0x%]","偍偐偟側懏惈抣 [0x%]") << (*mpfatr & ~0x1));
//僽儘僢僋悢偑0
if(*mpf == *limit)
notify(STANDARD,
Message("blkcnt should be a non-zero value.","僽儘僢僋悢偑0偱偡"));
//僽儘僢僋僒僀僘偑0
if(*blksz == 0)
notify(STANDARD,
Message("blksz should be a non-zero value.","僽儘僢僋僒僀僘偑0偱偡"));
//僶僢僼傽傾僪儗僗偑0
if(*mpf == 0)
notify(TOPPERS,
Message("buffer address is a NULL pointer.","僶僢僼傽傾僪儗僗偑NULL億僀儞僞偵側偭偰偄傑偡"));
++ mpfatr, ++ limit, ++ mpf, ++ blksz;
}
return old_error_count == error_count;
}
bool ConfigurationChecker::check_cyclic_handlerblock(Directory & parameter, FileContainer * container)
{
unsigned int id;
unsigned int old_error_count = error_count;
Message object("Cyclic handler","廃婜僴儞僪儔");
TargetVariable<DT_UINT> _kernel_tmax_cycid("_kernel_tmax_cycid");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -