|
414 | 414 | </typedef> |
415 | 415 |
|
416 | 416 | <!-- OS Configuration structure --> |
417 | | - <typedef name="osRtxConfig_t" const="1" info="OS Configuration Structure" size="104"> |
| 417 | + <typedef name="osRtxConfig_t" const="1" info="OS Configuration Structure" size="112"> |
418 | 418 | <member name="flags" type="uint32_t" offset="0" info="OS configuration flags"/> |
419 | 419 | <member name="tick_freq" type="uint32_t" offset="4" info="Kernel tick frequency"/> |
420 | 420 |
|
|
444 | 444 | <member name="thread_stack_size" type="uint32_t" offset="84" info="Default thread stack size"/> |
445 | 445 | <member name="idle_thread_attr" type="uint32_t" offset="88" info="Idle thread attributes (type is osThreadAttr_s *)"/> |
446 | 446 | <member name="timer_thread_attr" type="uint32_t" offset="92" info="Timer thread attributes (type is osThreadAttr_s *)"/> |
447 | | - <member name="timer_mq_attr" type="uint32_t" offset="96" info="Timer message queue attributes (type is osMessageQueueAttr_s *)"/> |
448 | | - <member name="timer_mq_mcnt" type="uint32_t" offset="100" info="Timer message queue maximum messages"/> |
| 447 | + <member name="timer_thread" type="uint32_t" offset="96" info="Timer Thread Function (type is void(*func)(void *)"/> |
| 448 | + <member name="timer_setup" type="uint32_t" offset="100" info="Timer Setup Function (type is int32_t(*func)(void)"/> |
| 449 | + <member name="timer_mq_attr" type="uint32_t" offset="104" info="Timer message queue attributes (type is osMessageQueueAttr_s *)"/> |
| 450 | + <member name="timer_mq_mcnt" type="uint32_t" offset="108" info="Timer message queue maximum messages"/> |
| 451 | + |
| 452 | + <var name="stack_check" type="uint8_t" info="Stack checking (0:disabled, 1:enabled)"/> |
| 453 | + <var name="stack_wmark" type="uint8_t" info="Stack watermark (0:disabled, 1:enabled)"/> |
449 | 454 | </typedef> |
450 | 455 |
|
451 | 456 | <!-- Memory Pool Header --> |
|
668 | 673 | <read name="os_Info" type="osRtxInfo_t" symbol="osRtxInfo"/> |
669 | 674 | <read name="os_Config" type="osRtxConfig_t" symbol="osRtxConfig" const="1"/> |
670 | 675 |
|
| 676 | + <calc> |
| 677 | + os_Config.stack_check = (os_Config.flags >> 1) & 1; |
| 678 | + os_Config.stack_wmark = (os_Config.flags >> 2) & 1; |
| 679 | + </calc> |
| 680 | + |
671 | 681 | <calc cond="((os_Info.version / 10000000) == 5) && (os_Info.kernel_state > 0) && (os_Info.kernel_state < 5)"> |
672 | 682 | RTX_En = 1; |
673 | 683 | </calc> |
|
682 | 692 | StaticMp_En = 1; |
683 | 693 | </calc> |
684 | 694 |
|
685 | | - <var name="stack_check" type="uint8_t" value="(os_Config.flags >> 1) & 1"/> |
686 | | - <var name="stack_wmark" type="uint8_t" value="(os_Config.flags >> 2) & 1"/> |
687 | | - |
688 | 695 | <!-- Read ISR FIFO queue --> |
689 | 696 | <read name="ISR_FIFO" cond="RTX_En" type="uint32_t" offset="os_Config.isr_queue_data" size="os_Config.isr_queue_max"/> |
690 | 697 |
|
|
866 | 873 | </calc> |
867 | 874 |
|
868 | 875 | <!-- Check also control values to determine maximum stack usage --> |
869 | | - <calc cond="(stack_wmark != 0) && (TCB[i].sp != 0) && (TCB[i].stack_over == 0) && (TCB[i].stack_size < 65536)"> |
| 876 | + <calc cond="(os_Config.stack_wmark != 0) && (TCB[i].sp != 0) && (TCB[i].stack_over == 0) && (TCB[i].stack_size < 65536)"> |
870 | 877 | TCB[i].stack_val = __CalcMemUsed (TCB[i].stack_mem, sp - TCB[i].stack_mem, 0xCCCCCCCC, 0xE25A2EA5); |
871 | 878 | TCB[i].stack_over = TCB[i].stack_val >> 31; |
872 | 879 | TCB[i].stack_maxb = (TCB[i].stack_mem + TCB[i].stack_size) - sp; |
|
1058 | 1065 | <calc>TCB_En += TCB[i].cb_valid; </calc> |
1059 | 1066 |
|
1060 | 1067 | <calc cond="TCB[i].cb_valid == 0"> TCB[i].out_type = 0;</calc> |
1061 | | - <calc cond="TCB[i].cb_valid && (TCB[i].name == 0) && (stack_wmark == 0)"> TCB[i].out_type = 1; </calc> |
1062 | | - <calc cond="TCB[i].cb_valid && (TCB[i].name == 0) && (stack_wmark != 0)"> TCB[i].out_type = 2; </calc> |
1063 | | - <calc cond="TCB[i].cb_valid && (TCB[i].name != 0) && (stack_wmark == 0)"> TCB[i].out_type = 3; </calc> |
1064 | | - <calc cond="TCB[i].cb_valid && (TCB[i].name != 0) && (stack_wmark != 0)"> TCB[i].out_type = 4; </calc> |
| 1068 | + <calc cond="TCB[i].cb_valid && (TCB[i].name == 0) && (os_Config.stack_wmark == 0)"> TCB[i].out_type = 1; </calc> |
| 1069 | + <calc cond="TCB[i].cb_valid && (TCB[i].name == 0) && (os_Config.stack_wmark != 0)"> TCB[i].out_type = 2; </calc> |
| 1070 | + <calc cond="TCB[i].cb_valid && (TCB[i].name != 0) && (os_Config.stack_wmark == 0)"> TCB[i].out_type = 3; </calc> |
| 1071 | + <calc cond="TCB[i].cb_valid && (TCB[i].name != 0) && (os_Config.stack_wmark != 0)"> TCB[i].out_type = 4; </calc> |
1065 | 1072 |
|
1066 | 1073 | <calc cond="TCB[i].sp_valid == 0"> TCB[i].out_type += 4; </calc> |
1067 | 1074 | </list> |
|
1097 | 1104 | <item property="Round Robin Timeout" value="%d[os_Config.robin_timeout]" cond="(os_Config.robin_timeout > 0) && (RTX_En != 0)" /> |
1098 | 1105 | <item property="Global Dynamic Memory" value="Not used" cond="(os_Config.mem_common_size == 0) && (RTX_En != 0)"/> |
1099 | 1106 | <item property="Global Dynamic Memory" value="Base: %x[mem_head_com._addr], Size: %d[mem_head_com.size], Used: %d[mem_head_com.used], Max used: %d[mem_head_com.max_used]" cond="(os_Config.mem_common_size != 0) && (RTX_En != 0)"/> |
1100 | | - <item property="Stack Overrun Check" value="%t[stack_check ? "Enabled" : "Disabled"]" cond="RTX_En != 0"/> |
1101 | | - <item property="Stack Usage Watermark" value="%t[stack_wmark ? "Enabled" : "Disabled"]" cond="RTX_En != 0"/> |
| 1107 | + <item property="Stack Overrun Check" value="%t[os_Config.stack_check ? "Enabled" : "Disabled"]" cond="RTX_En != 0"/> |
| 1108 | + <item property="Stack Usage Watermark" value="%t[os_Config.stack_wmark ? "Enabled" : "Disabled"]" cond="RTX_En != 0"/> |
1102 | 1109 | <item property="Default Thread Stack Size" value="%d[os_Config.thread_stack_size]" cond="RTX_En != 0"/> |
1103 | 1110 |
|
1104 | 1111 | <item property="ISR FIFO Queue" value="Size: %d[os_Info.isr_queue_max], Used: %d[os_Info.isr_queue_cnt]" cond="RTX_En"> |
|
1197 | 1204 | </item> |
1198 | 1205 |
|
1199 | 1206 | <item> |
1200 | | - <print cond="(TCB[i].sp_valid == 0) && (stack_wmark == 0)" property="Stack" value="Used: unknown"/> |
1201 | | - <print cond="(TCB[i].sp_valid == 0) && (stack_wmark != 0)" property="Stack" value="Used: unknown, Max: %d[TCB[i].stack_maxp]%% [%d[TCB[i].stack_maxb]]"/> |
1202 | | - <print cond="(TCB[i].sp_valid == 1) && (stack_wmark == 0)" property="Stack" value="Used: %d[TCB[i].stack_curp]%% [%d[TCB[i].stack_curb]]"/> |
1203 | | - <print cond="(TCB[i].sp_valid == 1) && (stack_wmark != 0)" property="Stack" value="Used: %d[TCB[i].stack_curp]%% [%d[TCB[i].stack_curb]], Max: %d[TCB[i].stack_maxp]%% [%d[TCB[i].stack_maxb]]"/> |
| 1207 | + <print cond="(TCB[i].sp_valid == 0) && (os_Config.stack_wmark == 0)" property="Stack" value="Used: unknown"/> |
| 1208 | + <print cond="(TCB[i].sp_valid == 0) && (os_Config.stack_wmark != 0)" property="Stack" value="Used: unknown, Max: %d[TCB[i].stack_maxp]%% [%d[TCB[i].stack_maxb]]"/> |
| 1209 | + <print cond="(TCB[i].sp_valid == 1) && (os_Config.stack_wmark == 0)" property="Stack" value="Used: %d[TCB[i].stack_curp]%% [%d[TCB[i].stack_curb]]"/> |
| 1210 | + <print cond="(TCB[i].sp_valid == 1) && (os_Config.stack_wmark != 0)" property="Stack" value="Used: %d[TCB[i].stack_curp]%% [%d[TCB[i].stack_curb]], Max: %d[TCB[i].stack_maxp]%% [%d[TCB[i].stack_maxb]]"/> |
1204 | 1211 |
|
1205 | 1212 | <item> |
1206 | 1213 | <print cond="TCB[i].sp_valid == 0" property="Used" value="unknown"/> |
1207 | 1214 | <print cond="TCB[i].sp_valid == 1" property="Used" value="%d[TCB[i].stack_curb]"/> |
1208 | 1215 | </item> |
1209 | | - <item property="Max" value="%d[TCB[i].stack_maxb]" cond="stack_wmark != 0"/> |
| 1216 | + <item property="Max" value="%d[TCB[i].stack_maxb]" cond="os_Config.stack_wmark != 0"/> |
1210 | 1217 | <item property="Top" value="%x[TCB[i].stack_mem + TCB[i].stack_size]"/> |
1211 | 1218 | <item> |
1212 | 1219 | <print cond="TCB[i].sp_valid == 0" property="Current" value="unknown"/> |
|
0 commit comments