os_task.txt 62.4 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403
; generated by Component: ARM Compiler 5.06 update 6 (build 750) Tool: ArmCC [4d3637]
; commandline ArmCC [--c99 --list --split_sections --debug -c --asm --interleave -o.\flash\obj\os_task.o --asm_dir=.\Flash\List\ --list_dir=.\Flash\List\ --depend=.\flash\obj\os_task.d --cpu=Cortex-M4.fp --apcs=interwork -O1 --diag_suppress=9931,870 -I..\..\Libraries\CMSIS\Include -I..\..\Libraries\CMSIS\Device\ST\STM32F4xx\Include -I..\..\Libraries\STM32F4xx_StdPeriph_Driver\inc -I..\..\uCOS-III\uC-CPU -I..\..\uCOS-III\uC-LIB -I..\..\uCOS-III\uCOS-III\Ports -I..\..\uCOS-III\uCOS-III\Source -I..\..\uCOS-III\uC-CPU\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uC-LIB\Ports\ARM-Cortex-M4\RealView -I..\..\uCOS-III\uCOS-III\Ports\ARM-Cortex-M4\Generic\RealView -I..\..\User -I..\..\User\bsp -I..\..\User\bsp\inc -I..\..\User\libapp -I..\..\RL-ARM\Config -I..\..\RL-ARM\Driver -I..\..\RL-ARM\RL-RTX\inc -I..\..\User\bsp\BSP -I..\..\RL-ARM\RL-CAN -I..\..\Libraries\DSP_LIB\Include -I..\..\MODBUS\modbus\rtu -I..\..\MODBUS\BARE\port -I..\..\MODBUS\modbus\include -I..\..\User\bsp\BSP -I..\..\PLC -I..\..\Avoid -I..\..\User\parameter -I..\..\User\LaserMotionCtr -I..\..\User\W5100S -I..\..\User\bsp -I..\..\User\CHASSIS -I..\..\User\CONTROLFUNCTION -I..\..\User\DATAUPDATE -I..\..\User\HARAWARE -I..\..\User\MOTORDRIVER -I..\..\User\NAVAGATION -I..\..\User\PLATFORM -I..\..\User\SENSOR -I.\RTE\_Flash -IC:\Users\YDJ\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include -IC:\Users\YDJ\AppData\Local\Arm\Packs\Keil\STM32F4xx_DFP\2.13.0\Drivers\CMSIS\Device\ST\STM32F4xx\Include -D__UVISION_VERSION=527 -D_RTE_ -DSTM32F407xx -DUSE_STDPERIPH_DRIVER -DSTM32F40_41xxx -D__RTX -D__FPU_USED=1 --omf_browse=.\flash\obj\os_task.crf ..\..\uCOS-III\uCOS-III\Source\os_task.c]
                          THUMB

                          AREA ||i.OSTaskCreate||, CODE, READONLY, ALIGN=2

                  OSTaskCreate PROC
;;;248    /*$PAGE*/
;;;249    void  OSTaskCreate (OS_TCB        *p_tcb,
000000  e92d4fff          PUSH     {r0-r11,lr}
;;;250                        CPU_CHAR      *p_name,
;;;251                        OS_TASK_PTR    p_task,
;;;252                        void          *p_arg,
;;;253                        OS_PRIO        prio,
;;;254                        CPU_STK       *p_stk_base,
;;;255                        CPU_STK_SIZE   stk_limit,
;;;256                        CPU_STK_SIZE   stk_size,
;;;257                        OS_MSG_QTY     q_size,
;;;258                        OS_TICK        time_quanta,
;;;259                        void          *p_ext,
;;;260                        OS_OPT         opt,
;;;261                        OS_ERR        *p_err)
;;;262    {
000004  b083              SUB      sp,sp,#0xc
000006  4604              MOV      r4,r0
000008  e9dda810          LDRD     r10,r8,[sp,#0x40]
00000c  e9dd6517          LDRD     r6,r5,[sp,#0x5c]
000010  9f13              LDR      r7,[sp,#0x4c]
000012  4693              MOV      r11,r2
;;;263        CPU_STK_SIZE   i;
;;;264    #if OS_CFG_TASK_REG_TBL_SIZE > 0u
;;;265        OS_REG_ID      reg_nbr;
;;;266    #endif
;;;267    #if defined(OS_CFG_TLS_TBL_SIZE) && (OS_CFG_TLS_TBL_SIZE > 0u)
;;;268        OS_TLS_ID      id;
;;;269    #endif
;;;270    
;;;271        CPU_STK       *p_sp;
;;;272        CPU_STK       *p_stk_limit;
;;;273        CPU_SR_ALLOC();
;;;274    
;;;275    
;;;276    
;;;277    #ifdef OS_SAFETY_CRITICAL
;;;278        if (p_err == (OS_ERR *)0) {
;;;279            OS_SAFETY_CRITICAL_EXCEPTION();
;;;280            return;
;;;281        }
;;;282    #endif
;;;283    
;;;284    #ifdef OS_SAFETY_CRITICAL_IEC61508
;;;285        if (OSSafetyCriticalStartFlag == DEF_TRUE) {
;;;286           *p_err = OS_ERR_ILLEGAL_CREATE_RUN_TIME;
;;;287            return;
;;;288        }
;;;289    #endif
;;;290    
;;;291    #if OS_CFG_CALLED_FROM_ISR_CHK_EN > 0u
;;;292        if (OSIntNestingCtr > (OS_NESTING_CTR)0) {              /* ---------- CANNOT CREATE A TASK FROM AN ISR ---------- */
;;;293           *p_err = OS_ERR_TASK_CREATE_ISR;
;;;294            return;
;;;295        }
;;;296    #endif
;;;297    
;;;298    #if OS_CFG_ARG_CHK_EN > 0u                                  /* ---------------- VALIDATE ARGUMENTS ------------------ */
;;;299        if (p_tcb == (OS_TCB *)0) {                             /* User must supply a valid OS_TCB                        */
;;;300           *p_err = OS_ERR_TCB_INVALID;
;;;301            return;
;;;302        }
;;;303        if (p_task == (OS_TASK_PTR)0) {                         /* User must supply a valid task                          */
;;;304           *p_err = OS_ERR_TASK_INVALID;
;;;305            return;
;;;306        }
;;;307        if (p_stk_base == (CPU_STK *)0) {                       /* User must supply a valid stack base address            */
;;;308           *p_err = OS_ERR_STK_INVALID;
;;;309            return;
;;;310        }
;;;311        if (stk_size < OSCfg_StkSizeMin) {                      /* User must supply a valid minimum stack size            */
;;;312           *p_err = OS_ERR_STK_SIZE_INVALID;
;;;313            return;
;;;314        }
;;;315        if (stk_limit >= stk_size) {                            /* User must supply a valid stack limit                   */
;;;316           *p_err = OS_ERR_STK_LIMIT_INVALID;
;;;317            return;
;;;318        }
;;;319        if (prio >= OS_CFG_PRIO_MAX) {                          /* Priority must be within 0 and OS_CFG_PRIO_MAX-1        */
;;;320           *p_err = OS_ERR_PRIO_INVALID;
;;;321            return;
;;;322        }
;;;323    #endif
;;;324    
;;;325    #if OS_CFG_ISR_POST_DEFERRED_EN > 0u
;;;326        if (prio == (OS_PRIO)0) {
;;;327            if (p_tcb != &OSIntQTaskTCB) {
;;;328               *p_err = OS_ERR_PRIO_INVALID;                    /* Not allowed to use priority 0                          */
;;;329                return;
;;;330            }
;;;331        }
;;;332    #endif
;;;333    
;;;334        if (prio == (OS_CFG_PRIO_MAX - 1u)) {
000014  f1ba0f0f          CMP      r10,#0xf
000018  d108              BNE      |L1.44|
;;;335            if (p_tcb != &OSIdleTaskTCB) {
00001a  4833              LDR      r0,|L1.232|
00001c  4284              CMP      r4,r0
00001e  d005              BEQ      |L1.44|
;;;336               *p_err = OS_ERR_PRIO_INVALID;                    /* Not allowed to use same priority as idle task          */
000020  f2462073          MOV      r0,#0x6273
000024  8028              STRH     r0,[r5,#0]
;;;337                return;
;;;338            }
;;;339        }
;;;340    
;;;341        OS_TaskInitTCB(p_tcb);                                  /* Initialize the TCB to default values                   */
;;;342    
;;;343       *p_err = OS_ERR_NONE;
;;;344                                                                /* --------------- CLEAR THE TASK'S STACK --------------- */
;;;345        if ((opt & OS_OPT_TASK_STK_CHK) != (OS_OPT)0) {         /* See if stack checking has been enabled                 */
;;;346            if ((opt & OS_OPT_TASK_STK_CLR) != (OS_OPT)0) {     /* See if stack needs to be cleared                       */
;;;347                p_sp = p_stk_base;
;;;348                for (i = 0u; i < stk_size; i++) {               /* Stack grows from HIGH to LOW memory                    */
;;;349                   *p_sp = (CPU_STK)0;                          /* Clear from bottom of stack and up!                     */
;;;350                    p_sp++;
;;;351                }
;;;352            }
;;;353        }
;;;354                                                                /* ------- INITIALIZE THE STACK FRAME OF THE TASK ------- */
;;;355    #if (CPU_CFG_STK_GROWTH == CPU_STK_GROWTH_HI_TO_LO)
;;;356        p_stk_limit = p_stk_base + stk_limit;
;;;357    #else
;;;358        p_stk_limit = p_stk_base + (stk_size - 1u) - stk_limit;
;;;359    #endif
;;;360    
;;;361        p_sp = OSTaskStkInit(p_task,
;;;362                             p_arg,
;;;363                             p_stk_base,
;;;364                             p_stk_limit,
;;;365                             stk_size,
;;;366                             opt);
;;;367    
;;;368                                                                /* -------------- INITIALIZE THE TCB FIELDS ------------- */
;;;369        p_tcb->TaskEntryAddr = p_task;                          /* Save task entry point address                          */
;;;370        p_tcb->TaskEntryArg  = p_arg;                           /* Save task entry argument                               */
;;;371    
;;;372        p_tcb->NamePtr       = p_name;                          /* Save task name                                         */
;;;373    
;;;374        p_tcb->Prio          = prio;                            /* Save the task's priority                               */
;;;375    
;;;376        p_tcb->StkPtr        = p_sp;                            /* Save the new top-of-stack pointer                      */
;;;377        p_tcb->StkLimitPtr   = p_stk_limit;                     /* Save the stack limit pointer                           */
;;;378    
;;;379        p_tcb->TimeQuanta    = time_quanta;                     /* Save the #ticks for time slice (0 means not sliced)    */
;;;380    #if OS_CFG_SCHED_ROUND_ROBIN_EN > 0u
;;;381        if (time_quanta == (OS_TICK)0) {
;;;382            p_tcb->TimeQuantaCtr = OSSchedRoundRobinDfltTimeQuanta;
;;;383        } else {
;;;384            p_tcb->TimeQuantaCtr = time_quanta;
;;;385        }
;;;386    #endif
;;;387        p_tcb->ExtPtr        = p_ext;                           /* Save pointer to TCB extension                          */
;;;388        p_tcb->StkBasePtr    = p_stk_base;                      /* Save pointer to the base address of the stack          */
;;;389        p_tcb->StkSize       = stk_size;                        /* Save the stack size (in number of CPU_STK elements)    */
;;;390        p_tcb->Opt           = opt;                             /* Save task options                                      */
;;;391    
;;;392    #if OS_CFG_TASK_REG_TBL_SIZE > 0u
;;;393        for (reg_nbr = 0u; reg_nbr < OS_CFG_TASK_REG_TBL_SIZE; reg_nbr++) {
;;;394            p_tcb->RegTbl[reg_nbr] = (OS_REG)0;
;;;395        }
;;;396    #endif
;;;397    
;;;398    #if OS_CFG_TASK_Q_EN > 0u
;;;399        OS_MsgQInit(&p_tcb->MsgQ,                               /* Initialize the task's message queue                    */
;;;400                    q_size);
;;;401    #else
;;;402        (void)&q_size;
;;;403    #endif
;;;404    
;;;405        OSTaskCreateHook(p_tcb);                                /* Call user defined hook                                 */
;;;406    
;;;407    #if defined(OS_CFG_TLS_TBL_SIZE) && (OS_CFG_TLS_TBL_SIZE > 0u)
;;;408        for (id = 0u; id < OS_CFG_TLS_TBL_SIZE; id++) {
;;;409            p_tcb->TLS_Tbl[id] = (OS_TLS)0;
;;;410        }
;;;411        OS_TLS_TaskCreate(p_tcb);                               /* Call TLS hook                                          */
;;;412    #endif
;;;413                                                                /* --------------- ADD TASK TO READY LIST --------------- */
;;;414        OS_CRITICAL_ENTER();
;;;415        OS_PrioInsert(p_tcb->Prio);
;;;416        OS_RdyListInsertTail(p_tcb);
;;;417    
;;;418    #if OS_CFG_DBG_EN > 0u
;;;419        OS_TaskDbgListAdd(p_tcb);
;;;420    #endif
;;;421    
;;;422        OSTaskQty++;                                            /* Increment the #tasks counter                           */
;;;423    
;;;424        if (OSRunning != OS_STATE_OS_RUNNING) {                 /* Return if multitasking has not started                 */
;;;425            OS_CRITICAL_EXIT();
;;;426            return;
;;;427        }
;;;428    
;;;429        OS_CRITICAL_EXIT_NO_SCHED();
;;;430    
;;;431        OSSched();
;;;432    }
000026  b007              ADD      sp,sp,#0x1c
000028  e8bd8ff0          POP      {r4-r11,pc}
                  |L1.44|
00002c  4620              MOV      r0,r4                 ;341
00002e  f7fffffe          BL       OS_TaskInitTCB
000032  f04f0900          MOV      r9,#0                 ;343
000036  f8a59000          STRH     r9,[r5,#0]            ;343
00003a  07f0              LSLS     r0,r6,#31             ;345
00003c  d00a              BEQ      |L1.84|
00003e  07b0              LSLS     r0,r6,#30             ;346
000040  d508              BPL      |L1.84|
000042  4645              MOV      r5,r8                 ;347
000044  2000              MOVS     r0,#0                 ;348
000046  e003              B        |L1.80|
                  |L1.72|
000048  f8c59000          STR      r9,[r5,#0]            ;349
00004c  1d2d              ADDS     r5,r5,#4              ;350
00004e  1c40              ADDS     r0,r0,#1              ;348
                  |L1.80|
000050  42b8              CMP      r0,r7                 ;348
000052  d3f9              BCC      |L1.72|
                  |L1.84|
000054  9812              LDR      r0,[sp,#0x48]         ;356
000056  eb080580          ADD      r5,r8,r0,LSL #2       ;356
00005a  e9cd7600          STRD     r7,r6,[sp,#0]         ;361
00005e  462b              MOV      r3,r5                 ;361
000060  4642              MOV      r2,r8                 ;361
000062  4658              MOV      r0,r11                ;361
000064  9906              LDR      r1,[sp,#0x18]         ;361
000066  f7fffffe          BL       OSTaskStkInit
00006a  f8c4b028          STR      r11,[r4,#0x28]        ;369
00006e  9906              LDR      r1,[sp,#0x18]         ;370
000070  62e1              STR      r1,[r4,#0x2c]         ;370
000072  9904              LDR      r1,[sp,#0x10]         ;372
000074  6221              STR      r1,[r4,#0x20]         ;372
000076  f884a037          STRB     r10,[r4,#0x37]        ;374
00007a  6020              STR      r0,[r4,#0]            ;376
00007c  60a5              STR      r5,[r4,#8]            ;377
00007e  9815              LDR      r0,[sp,#0x54]         ;379
000080  6560              STR      r0,[r4,#0x54]         ;379
000082  9816              LDR      r0,[sp,#0x58]         ;387
000084  6060              STR      r0,[r4,#4]            ;387
000086  f8c48024          STR      r8,[r4,#0x24]         ;388
00008a  63a7              STR      r7,[r4,#0x38]         ;389
00008c  87a6              STRH     r6,[r4,#0x3c]         ;390
00008e  2000              MOVS     r0,#0                 ;393
                  |L1.144|
000090  eb040180          ADD      r1,r4,r0,LSL #2       ;394
000094  f8c1905c          STR      r9,[r1,#0x5c]         ;394
000098  1c40              ADDS     r0,r0,#1              ;393
00009a  b2c0              UXTB     r0,r0                 ;393
00009c  2800              CMP      r0,#0                 ;393
00009e  d0f7              BEQ      |L1.144|
0000a0  4620              MOV      r0,r4                 ;405
0000a2  f7fffffe          BL       OSTaskCreateHook
0000a6  f7fffffe          BL       CPU_SR_Save
0000aa  4605              MOV      r5,r0                 ;414
0000ac  f8940037          LDRB     r0,[r4,#0x37]         ;415
0000b0  f7fffffe          BL       OS_PrioInsert
0000b4  4620              MOV      r0,r4                 ;416
0000b6  f7fffffe          BL       OS_RdyListInsertTail
0000ba  490c              LDR      r1,|L1.236|
0000bc  8808              LDRH     r0,[r1,#0]            ;422  ; OSTaskQty
0000be  1c40              ADDS     r0,r0,#1              ;422
0000c0  8008              STRH     r0,[r1,#0]            ;422
0000c2  480b              LDR      r0,|L1.240|
0000c4  7800              LDRB     r0,[r0,#0]            ;424  ; OSRunning
0000c6  2801              CMP      r0,#1                 ;424
0000c8  d005              BEQ      |L1.214|
0000ca  b007              ADD      sp,sp,#0x1c           ;425
0000cc  4628              MOV      r0,r5                 ;425
0000ce  e8bd4ff0          POP      {r4-r11,lr}           ;425
0000d2  f7ffbffe          B.W      CPU_SR_Restore
                  |L1.214|
0000d6  4628              MOV      r0,r5                 ;429
0000d8  f7fffffe          BL       CPU_SR_Restore
0000dc  b007              ADD      sp,sp,#0x1c           ;431
0000de  e8bd4ff0          POP      {r4-r11,lr}           ;431
0000e2  f7ffbffe          B.W      OSSched
;;;433    
                          ENDP

0000e6  0000              DCW      0x0000
                  |L1.232|
                          DCD      OSIdleTaskTCB
                  |L1.236|
                          DCD      OSTaskQty
                  |L1.240|
                          DCD      OSRunning

                          AREA ||i.OSTaskRegGet||, CODE, READONLY, ALIGN=2

                  OSTaskRegGet PROC
;;;1010   #if OS_CFG_TASK_REG_TBL_SIZE > 0u
;;;1011   OS_REG  OSTaskRegGet (OS_TCB     *p_tcb,
000000  b570              PUSH     {r4-r6,lr}
;;;1012                         OS_REG_ID   id,
;;;1013                         OS_ERR     *p_err)
;;;1014   {
000002  4604              MOV      r4,r0
000004  460d              MOV      r5,r1
000006  4616              MOV      r6,r2
;;;1015       OS_REG     value;
;;;1016       CPU_SR_ALLOC();
;;;1017   
;;;1018   
;;;1019   
;;;1020   #ifdef OS_SAFETY_CRITICAL
;;;1021       if (p_err == (OS_ERR *)0) {
;;;1022           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1023           return ((OS_REG)0);
;;;1024       }
;;;1025   #endif
;;;1026   
;;;1027   #if OS_CFG_ARG_CHK_EN > 0u
;;;1028       if (id >= OS_CFG_TASK_REG_TBL_SIZE) {
;;;1029          *p_err = OS_ERR_REG_ID_INVALID;
;;;1030           return ((OS_REG)0);
;;;1031       }
;;;1032   #endif
;;;1033   
;;;1034       CPU_CRITICAL_ENTER();
000008  f7fffffe          BL       CPU_SR_Save
;;;1035       if (p_tcb == (OS_TCB *)0) {
00000c  b90c              CBNZ     r4,|L2.18|
;;;1036           p_tcb = OSTCBCurPtr;
00000e  4905              LDR      r1,|L2.36|
000010  680c              LDR      r4,[r1,#0]  ; OSTCBCurPtr
                  |L2.18|
;;;1037       }
;;;1038       value = p_tcb->RegTbl[id];
000012  eb040185          ADD      r1,r4,r5,LSL #2
000016  6dcc              LDR      r4,[r1,#0x5c]
;;;1039       CPU_CRITICAL_EXIT();
000018  f7fffffe          BL       CPU_SR_Restore
;;;1040      *p_err = OS_ERR_NONE;
00001c  2000              MOVS     r0,#0
00001e  8030              STRH     r0,[r6,#0]
;;;1041       return ((OS_REG)value);
000020  4620              MOV      r0,r4
;;;1042   }
000022  bd70              POP      {r4-r6,pc}
;;;1043   #endif
                          ENDP

                  |L2.36|
                          DCD      OSTCBCurPtr

                          AREA ||i.OSTaskRegGetID||, CODE, READONLY, ALIGN=2

                  OSTaskRegGetID PROC
;;;1063   #if OS_CFG_TASK_REG_TBL_SIZE > 0u
;;;1064   OS_REG_ID  OSTaskRegGetID (OS_ERR  *p_err)
000000  b510              PUSH     {r4,lr}
;;;1065   {
000002  4604              MOV      r4,r0
;;;1066       OS_REG_ID  id;
;;;1067       CPU_SR_ALLOC();
;;;1068   
;;;1069   
;;;1070   
;;;1071   #ifdef OS_SAFETY_CRITICAL
;;;1072       if (p_err == (OS_ERR *)0) {
;;;1073           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1074           return ((OS_REG_ID)OS_CFG_TASK_REG_TBL_SIZE);
;;;1075       }
;;;1076   #endif
;;;1077   
;;;1078       CPU_CRITICAL_ENTER();
000004  f7fffffe          BL       CPU_SR_Save
;;;1079       if (OSTaskRegNextAvailID >= OS_CFG_TASK_REG_TBL_SIZE) {       /* See if we exceeded the number of IDs available   */
000008  4908              LDR      r1,|L3.44|
00000a  780a              LDRB     r2,[r1,#0]  ; OSTaskRegNextAvailID
00000c  b132              CBZ      r2,|L3.28|
;;;1080          *p_err = OS_ERR_NO_MORE_ID_AVAIL;                          /* Yes, cannot allocate more task register IDs      */
00000e  f64511da          MOV      r1,#0x59da
000012  8021              STRH     r1,[r4,#0]
;;;1081           CPU_CRITICAL_EXIT();
000014  f7fffffe          BL       CPU_SR_Restore
;;;1082           return ((OS_REG_ID)OS_CFG_TASK_REG_TBL_SIZE);
000018  2001              MOVS     r0,#1
;;;1083       }
;;;1084        
;;;1085       id    = OSTaskRegNextAvailID;								  /* Assign the next available ID                     */
;;;1086       OSTaskRegNextAvailID++;										  /* Increment available ID for next request          */
;;;1087       CPU_CRITICAL_EXIT();
;;;1088      *p_err = OS_ERR_NONE;
;;;1089       return (id);
;;;1090   }
00001a  bd10              POP      {r4,pc}
                  |L3.28|
00001c  2201              MOVS     r2,#1                 ;1086
00001e  700a              STRB     r2,[r1,#0]            ;1086
000020  f7fffffe          BL       CPU_SR_Restore
000024  2000              MOVS     r0,#0                 ;1088
000026  8020              STRH     r0,[r4,#0]            ;1088
000028  bd10              POP      {r4,pc}
;;;1091   #endif
                          ENDP

00002a  0000              DCW      0x0000
                  |L3.44|
                          DCD      OSTaskRegNextAvailID

                          AREA ||i.OSTaskRegSet||, CODE, READONLY, ALIGN=2

                  OSTaskRegSet PROC
;;;1119   #if OS_CFG_TASK_REG_TBL_SIZE > 0u
;;;1120   void  OSTaskRegSet (OS_TCB     *p_tcb,
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;1121                       OS_REG_ID   id,
;;;1122                       OS_REG      value,
;;;1123                       OS_ERR     *p_err)
;;;1124   {
000004  4604              MOV      r4,r0
000006  460e              MOV      r6,r1
000008  4615              MOV      r5,r2
00000a  461f              MOV      r7,r3
;;;1125       CPU_SR_ALLOC();
;;;1126   
;;;1127   
;;;1128   
;;;1129   #ifdef OS_SAFETY_CRITICAL
;;;1130       if (p_err == (OS_ERR *)0) {
;;;1131           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1132           return;
;;;1133       }
;;;1134   #endif
;;;1135   
;;;1136   #if OS_CFG_ARG_CHK_EN > 0u
;;;1137       if (id >= OS_CFG_TASK_REG_TBL_SIZE) {
;;;1138          *p_err = OS_ERR_REG_ID_INVALID;
;;;1139           return;
;;;1140       }
;;;1141   #endif
;;;1142   
;;;1143       CPU_CRITICAL_ENTER();
00000c  f7fffffe          BL       CPU_SR_Save
;;;1144       if (p_tcb == (OS_TCB *)0) {
000010  b90c              CBNZ     r4,|L4.22|
;;;1145           p_tcb = OSTCBCurPtr;
000012  4905              LDR      r1,|L4.40|
000014  680c              LDR      r4,[r1,#0]  ; OSTCBCurPtr
                  |L4.22|
;;;1146       }
;;;1147       p_tcb->RegTbl[id] = value;
000016  eb040186          ADD      r1,r4,r6,LSL #2
00001a  65cd              STR      r5,[r1,#0x5c]
;;;1148       CPU_CRITICAL_EXIT();
00001c  f7fffffe          BL       CPU_SR_Restore
;;;1149      *p_err             = OS_ERR_NONE;
000020  2000              MOVS     r0,#0
000022  8038              STRH     r0,[r7,#0]
;;;1150   }
000024  e8bd81f0          POP      {r4-r8,pc}
;;;1151   #endif
                          ENDP

                  |L4.40|
                          DCD      OSTCBCurPtr

                          AREA ||i.OSTaskSemPend||, CODE, READONLY, ALIGN=2

                  OSTaskSemPend PROC
;;;1261   
;;;1262   OS_SEM_CTR  OSTaskSemPend (OS_TICK   timeout,
000000  e92d5ff0          PUSH     {r4-r12,lr}
;;;1263                              OS_OPT    opt,
;;;1264                              CPU_TS   *p_ts,
;;;1265                              OS_ERR   *p_err)
;;;1266   {
000004  4683              MOV      r11,r0
000006  468a              MOV      r10,r1
000008  4614              MOV      r4,r2
00000a  461d              MOV      r5,r3
;;;1267       OS_SEM_CTR    ctr;
;;;1268       CPU_SR_ALLOC();
;;;1269   
;;;1270   
;;;1271   
;;;1272   #ifdef OS_SAFETY_CRITICAL
;;;1273       if (p_err == (OS_ERR *)0) {
;;;1274           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1275           return ((OS_SEM_CTR)0);
;;;1276       }
;;;1277   #endif
;;;1278   
;;;1279   #if OS_CFG_CALLED_FROM_ISR_CHK_EN > 0u
;;;1280       if (OSIntNestingCtr > (OS_NESTING_CTR)0) {              /* Not allowed to call from an ISR                        */
;;;1281          *p_err = OS_ERR_PEND_ISR;
;;;1282           return ((OS_SEM_CTR)0);
;;;1283       }
;;;1284   #endif
;;;1285   
;;;1286   #if OS_CFG_ARG_CHK_EN > 0u
;;;1287       switch (opt) {                                          /* Validate 'opt'                                         */
;;;1288           case OS_OPT_PEND_BLOCKING:
;;;1289           case OS_OPT_PEND_NON_BLOCKING:
;;;1290                break;
;;;1291   
;;;1292           default:
;;;1293               *p_err = OS_ERR_OPT_INVALID;
;;;1294                return ((OS_SEM_CTR)0);
;;;1295       }
;;;1296   #endif
;;;1297   
;;;1298       if (p_ts != (CPU_TS *)0) {
00000c  f04f0800          MOV      r8,#0
000010  2c00              CMP      r4,#0
000012  d001              BEQ      |L5.24|
;;;1299          *p_ts  = (CPU_TS  )0;                                /* Initialize the returned timestamp                      */
000014  f8c48000          STR      r8,[r4,#0]
                  |L5.24|
;;;1300       }
;;;1301   
;;;1302       CPU_CRITICAL_ENTER();
000018  f7fffffe          BL       CPU_SR_Save
00001c  4606              MOV      r6,r0
;;;1303       if (OSTCBCurPtr->SemCtr > (OS_SEM_CTR)0) {              /* See if task already been signaled                      */
00001e  f8df90b8          LDR      r9,|L5.216|
000022  f8d90000          LDR      r0,[r9,#0]  ; OSTCBCurPtr
000026  6c47              LDR      r7,[r0,#0x44]
000028  b167              CBZ      r7,|L5.68|
;;;1304           OSTCBCurPtr->SemCtr--;
00002a  1e7f              SUBS     r7,r7,#1
00002c  6447              STR      r7,[r0,#0x44]
;;;1305           ctr    = OSTCBCurPtr->SemCtr;
;;;1306           if (p_ts != (CPU_TS *)0) {
00002e  b10c              CBZ      r4,|L5.52|
;;;1307              *p_ts  = OSTCBCurPtr->TS;
000030  6c00              LDR      r0,[r0,#0x40]
000032  6020              STR      r0,[r4,#0]
                  |L5.52|
;;;1308           }
;;;1309   #if OS_CFG_TASK_PROFILE_EN > 0u
;;;1310           OSTCBCurPtr->SemPendTime = OS_TS_GET() - OSTCBCurPtr->TS;
;;;1311           if (OSTCBCurPtr->SemPendTimeMax < OSTCBCurPtr->SemPendTime) {
;;;1312               OSTCBCurPtr->SemPendTimeMax = OSTCBCurPtr->SemPendTime;
;;;1313           }
;;;1314   #endif
;;;1315           CPU_CRITICAL_EXIT();
000034  4630              MOV      r0,r6
000036  f7fffffe          BL       CPU_SR_Restore
;;;1316          *p_err = OS_ERR_NONE;
00003a  f8a58000          STRH     r8,[r5,#0]
;;;1317           return (ctr);
00003e  4638              MOV      r0,r7
                  |L5.64|
;;;1318       }
;;;1319   
;;;1320       if ((opt & OS_OPT_PEND_NON_BLOCKING) != (OS_OPT)0) {    /* Caller wants to block if not available?                */
;;;1321           CPU_CRITICAL_EXIT();
;;;1322          *p_err = OS_ERR_PEND_WOULD_BLOCK;                    /* No                                                     */
;;;1323           return ((OS_SEM_CTR)0);
;;;1324       } else {                                                /* Yes                                                    */
;;;1325           if (OSSchedLockNestingCtr > (OS_NESTING_CTR)0) {    /* Can't pend when the scheduler is locked                */
;;;1326               CPU_CRITICAL_EXIT();
;;;1327              *p_err = OS_ERR_SCHED_LOCKED;
;;;1328               return ((OS_SEM_CTR)0);
;;;1329           }
;;;1330       }
;;;1331                                                               /* Lock the scheduler/re-enable interrupts                */
;;;1332       OS_CRITICAL_ENTER_CPU_EXIT();                           
;;;1333       OS_Pend((OS_PEND_DATA *)0,                              /* Block task pending on Signal                           */
;;;1334               (OS_PEND_OBJ  *)0,
;;;1335               (OS_STATE      )OS_TASK_PEND_ON_TASK_SEM,
;;;1336               (OS_TICK       )timeout);
;;;1337       OS_CRITICAL_EXIT_NO_SCHED();
;;;1338   
;;;1339       OSSched();                                              /* Find next highest priority task ready to run           */
;;;1340   
;;;1341       CPU_CRITICAL_ENTER();
;;;1342       switch (OSTCBCurPtr->PendStatus) {                      /* See if we timed-out or aborted                         */
;;;1343           case OS_STATUS_PEND_OK:
;;;1344                if (p_ts != (CPU_TS *)0) {
;;;1345                   *p_ts                    =  OSTCBCurPtr->TS;
;;;1346   #if OS_CFG_TASK_PROFILE_EN > 0u
;;;1347                   OSTCBCurPtr->SemPendTime = OS_TS_GET() - OSTCBCurPtr->TS;
;;;1348                   if (OSTCBCurPtr->SemPendTimeMax < OSTCBCurPtr->SemPendTime) {
;;;1349                       OSTCBCurPtr->SemPendTimeMax = OSTCBCurPtr->SemPendTime;
;;;1350                   }
;;;1351   #endif
;;;1352                }
;;;1353               *p_err = OS_ERR_NONE;
;;;1354                break;
;;;1355   
;;;1356           case OS_STATUS_PEND_ABORT:
;;;1357                if (p_ts != (CPU_TS *)0) {
;;;1358                   *p_ts  =  OSTCBCurPtr->TS;
;;;1359                }
;;;1360               *p_err = OS_ERR_PEND_ABORT;                     /* Indicate that we aborted                               */
;;;1361                break;
;;;1362   
;;;1363           case OS_STATUS_PEND_TIMEOUT:
;;;1364                if (p_ts != (CPU_TS *)0) {
;;;1365                   *p_ts  = (CPU_TS  )0;
;;;1366                }
;;;1367               *p_err = OS_ERR_TIMEOUT;                        /* Indicate that we didn't get event within TO            */
;;;1368                break;
;;;1369   
;;;1370           default:
;;;1371               *p_err = OS_ERR_STATUS_INVALID;
;;;1372                break;
;;;1373       }
;;;1374       ctr = OSTCBCurPtr->SemCtr;
;;;1375       CPU_CRITICAL_EXIT();
;;;1376       return (ctr);
;;;1377   }
000040  e8bd9ff0          POP      {r4-r12,pc}
                  |L5.68|
000044  ea5f400a          LSLS     r0,r10,#16            ;1320
000048  d507              BPL      |L5.90|
00004a  4630              MOV      r0,r6                 ;1321
00004c  f7fffffe          BL       CPU_SR_Restore
000050  f24610b0          MOV      r0,#0x61b0            ;1322
000054  8028              STRH     r0,[r5,#0]            ;1322
000056  2000              MOVS     r0,#0                 ;1323
000058  e7f2              B        |L5.64|
                  |L5.90|
00005a  4820              LDR      r0,|L5.220|
00005c  7800              LDRB     r0,[r0,#0]            ;1325  ; OSSchedLockNestingCtr
00005e  b138              CBZ      r0,|L5.112|
000060  4630              MOV      r0,r6                 ;1326
000062  f7fffffe          BL       CPU_SR_Restore
000066  f6465063          MOV      r0,#0x6d63            ;1327
00006a  8028              STRH     r0,[r5,#0]            ;1327
00006c  2000              MOVS     r0,#0                 ;1328
00006e  e7e7              B        |L5.64|
                  |L5.112|
000070  2100              MOVS     r1,#0                 ;1333
000072  465b              MOV      r3,r11                ;1333
000074  2207              MOVS     r2,#7                 ;1333
000076  4608              MOV      r0,r1                 ;1333
000078  f7fffffe          BL       OS_Pend
00007c  4630              MOV      r0,r6                 ;1337
00007e  f7fffffe          BL       CPU_SR_Restore
000082  f7fffffe          BL       OSSched
000086  f7fffffe          BL       CPU_SR_Save
00008a  f8d92000          LDR      r2,[r9,#0]            ;1342  ; OSTCBCurPtr
00008e  f8921035          LDRB     r1,[r2,#0x35]         ;1342
000092  b169              CBZ      r1,|L5.176|
000094  2901              CMP      r1,#1                 ;1342
000096  d011              BEQ      |L5.188|
000098  2903              CMP      r1,#3                 ;1342
00009a  d016              BEQ      |L5.202|
00009c  f646612e          MOV      r1,#0x6e2e            ;1371
0000a0  8029              STRH     r1,[r5,#0]            ;1371
                  |L5.162|
0000a2  f8d91000          LDR      r1,[r9,#0]            ;1374  ; OSTCBCurPtr
0000a6  6c4c              LDR      r4,[r1,#0x44]         ;1374
0000a8  f7fffffe          BL       CPU_SR_Restore
0000ac  4620              MOV      r0,r4                 ;1376
0000ae  e7c7              B        |L5.64|
                  |L5.176|
0000b0  b10c              CBZ      r4,|L5.182|
0000b2  6c11              LDR      r1,[r2,#0x40]         ;1345
0000b4  6021              STR      r1,[r4,#0]            ;1345
                  |L5.182|
0000b6  f8a58000          STRH     r8,[r5,#0]            ;1353
0000ba  e7f2              B        |L5.162|
                  |L5.188|
0000bc  b10c              CBZ      r4,|L5.194|
0000be  6c11              LDR      r1,[r2,#0x40]         ;1358
0000c0  6021              STR      r1,[r4,#0]            ;1358
                  |L5.194|
0000c2  f24611a9          MOV      r1,#0x61a9            ;1360
0000c6  8029              STRH     r1,[r5,#0]            ;1360
0000c8  e7eb              B        |L5.162|
                  |L5.202|
0000ca  b10c              CBZ      r4,|L5.208|
0000cc  f8c48000          STR      r8,[r4,#0]            ;1365
                  |L5.208|
0000d0  f24721d9          MOV      r1,#0x72d9            ;1367
0000d4  8029              STRH     r1,[r5,#0]            ;1367
0000d6  e7e4              B        |L5.162|
;;;1378   
                          ENDP

                  |L5.216|
                          DCD      OSTCBCurPtr
                  |L5.220|
                          DCD      OSSchedLockNestingCtr

                          AREA ||i.OSTaskSemPost||, CODE, READONLY, ALIGN=1

                  OSTaskSemPost PROC
;;;1496   
;;;1497   OS_SEM_CTR  OSTaskSemPost (OS_TCB  *p_tcb,
000000  4613              MOV      r3,r2
;;;1498                              OS_OPT   opt,
;;;1499                              OS_ERR  *p_err)
;;;1500   {
;;;1501       OS_SEM_CTR  ctr;
;;;1502       CPU_TS      ts;
;;;1503   
;;;1504   
;;;1505   
;;;1506   #ifdef OS_SAFETY_CRITICAL
;;;1507       if (p_err == (OS_ERR *)0) {
;;;1508           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1509           return ((OS_SEM_CTR)0);
;;;1510       }
;;;1511   #endif
;;;1512   
;;;1513   #if OS_CFG_ARG_CHK_EN > 0u
;;;1514       switch (opt) {                                          /* Validate 'opt'                                         */
;;;1515           case OS_OPT_POST_NONE:
;;;1516           case OS_OPT_POST_NO_SCHED:
;;;1517                break;
;;;1518   
;;;1519           default:
;;;1520               *p_err =  OS_ERR_OPT_INVALID;
;;;1521                return ((OS_SEM_CTR)0u);
;;;1522       }
;;;1523   #endif
;;;1524   
;;;1525       ts = OS_TS_GET();                                       /* Get timestamp                                          */
000002  2200              MOVS     r2,#0
;;;1526   
;;;1527   #if OS_CFG_ISR_POST_DEFERRED_EN > 0u
;;;1528       if (OSIntNestingCtr > (OS_NESTING_CTR)0) {              /* See if called from an ISR                              */
;;;1529           OS_IntQPost((OS_OBJ_TYPE)OS_OBJ_TYPE_TASK_SIGNAL,   /* Post to ISR queue                                      */
;;;1530                       (void      *)p_tcb,
;;;1531                       (void      *)0,
;;;1532                       (OS_MSG_SIZE)0,
;;;1533                       (OS_FLAGS   )0,
;;;1534                       (OS_OPT     )0,
;;;1535                       (CPU_TS     )ts,
;;;1536                       (OS_ERR    *)p_err);
;;;1537           return ((OS_SEM_CTR)0);
;;;1538       }
;;;1539   #endif
;;;1540   
;;;1541       ctr = OS_TaskSemPost(p_tcb,
000004  f7ffbffe          B.W      OS_TaskSemPost
;;;1542                            opt,
;;;1543                            ts,
;;;1544                            p_err);
;;;1545   
;;;1546       return (ctr);
;;;1547   }
;;;1548   
                          ENDP


                          AREA ||i.OSTaskSemSet||, CODE, READONLY, ALIGN=2

                  OSTaskSemSet PROC
;;;1569   
;;;1570   OS_SEM_CTR  OSTaskSemSet (OS_TCB      *p_tcb,
000000  e92d41f0          PUSH     {r4-r8,lr}
;;;1571                             OS_SEM_CTR   cnt,
;;;1572                             OS_ERR      *p_err)
;;;1573   {
000004  4604              MOV      r4,r0
000006  460e              MOV      r6,r1
000008  4617              MOV      r7,r2
;;;1574       OS_SEM_CTR  ctr;
;;;1575       CPU_SR_ALLOC();
;;;1576   
;;;1577   
;;;1578   
;;;1579   #ifdef OS_SAFETY_CRITICAL
;;;1580       if (p_err == (OS_ERR *)0) {
;;;1581           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1582           return ((OS_SEM_CTR)0);
;;;1583       }
;;;1584   #endif
;;;1585   
;;;1586   #if OS_CFG_CALLED_FROM_ISR_CHK_EN > 0u
;;;1587       if (OSIntNestingCtr > (OS_NESTING_CTR)0) {              /* Not allowed to call from an ISR                        */
;;;1588          *p_err = OS_ERR_SET_ISR;
;;;1589           return ((OS_SEM_CTR)0);
;;;1590       }
;;;1591   #endif
;;;1592   
;;;1593       CPU_CRITICAL_ENTER();
00000a  f7fffffe          BL       CPU_SR_Save
;;;1594       if (p_tcb == (OS_TCB *)0) {
00000e  b90c              CBNZ     r4,|L7.20|
;;;1595           p_tcb = OSTCBCurPtr;
000010  4905              LDR      r1,|L7.40|
000012  680c              LDR      r4,[r1,#0]  ; OSTCBCurPtr
                  |L7.20|
;;;1596       }
;;;1597       ctr           = p_tcb->SemCtr;
000014  6c65              LDR      r5,[r4,#0x44]
;;;1598       p_tcb->SemCtr = (OS_SEM_CTR)cnt;
000016  6466              STR      r6,[r4,#0x44]
;;;1599       CPU_CRITICAL_EXIT();
000018  f7fffffe          BL       CPU_SR_Restore
;;;1600      *p_err         =  OS_ERR_NONE;
00001c  2000              MOVS     r0,#0
00001e  8038              STRH     r0,[r7,#0]
;;;1601       return (ctr);
000020  4628              MOV      r0,r5
;;;1602   }
000022  e8bd81f0          POP      {r4-r8,pc}
;;;1603   
                          ENDP

000026  0000              DCW      0x0000
                  |L7.40|
                          DCD      OSTCBCurPtr

                          AREA ||i.OSTaskStkChk||, CODE, READONLY, ALIGN=2

                  OSTaskStkChk PROC
;;;1629   #if OS_CFG_STAT_TASK_STK_CHK_EN > 0u
;;;1630   void  OSTaskStkChk (OS_TCB        *p_tcb,
000000  e92d47f0          PUSH     {r4-r10,lr}
;;;1631                       CPU_STK_SIZE  *p_free,
;;;1632                       CPU_STK_SIZE  *p_used,
;;;1633                       OS_ERR        *p_err)
;;;1634   {
000004  4606              MOV      r6,r0
000006  460f              MOV      r7,r1
000008  4690              MOV      r8,r2
00000a  4699              MOV      r9,r3
;;;1635       CPU_STK_SIZE  free_stk;
;;;1636       CPU_STK      *p_stk;
;;;1637       CPU_SR_ALLOC();
;;;1638   
;;;1639   
;;;1640   
;;;1641   #ifdef OS_SAFETY_CRITICAL
;;;1642       if (p_err == (OS_ERR *)0) {
;;;1643           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1644           return;
;;;1645       }
;;;1646   #endif
;;;1647   
;;;1648   #if OS_CFG_CALLED_FROM_ISR_CHK_EN > 0u
;;;1649       if (OSIntNestingCtr > (OS_NESTING_CTR)0) {              /* See if trying to check stack from ISR                  */
;;;1650          *p_err = OS_ERR_TASK_STK_CHK_ISR;
;;;1651           return;
;;;1652       }
;;;1653   #endif
;;;1654   
;;;1655   #if OS_CFG_ARG_CHK_EN > 0u
;;;1656       if (p_free == (CPU_STK_SIZE*)0) {                       /* User must specify valid destinations for the sizes     */
;;;1657          *p_err  = OS_ERR_PTR_INVALID;
;;;1658           return;
;;;1659       }
;;;1660   
;;;1661       if (p_used == (CPU_STK_SIZE*)0) {
;;;1662          *p_err  = OS_ERR_PTR_INVALID;
;;;1663           return;
;;;1664       }
;;;1665   #endif
;;;1666   
;;;1667       CPU_CRITICAL_ENTER();
00000c  f7fffffe          BL       CPU_SR_Save
;;;1668       if (p_tcb == (OS_TCB *)0) {                             /* Check the stack of the current task?                   */
000010  b90e              CBNZ     r6,|L8.22|
;;;1669           p_tcb = OSTCBCurPtr;                                /* Yes                                                    */
000012  4919              LDR      r1,|L8.120|
000014  680e              LDR      r6,[r1,#0]  ; OSTCBCurPtr
                  |L8.22|
;;;1670       }
;;;1671   
;;;1672       if (p_tcb->StkPtr == (CPU_STK*)0) {                     /* Make sure task exist                                   */
000016  f04f0a00          MOV      r10,#0
00001a  6831              LDR      r1,[r6,#0]
00001c  b141              CBZ      r1,|L8.48|
;;;1673           CPU_CRITICAL_EXIT();
;;;1674          *p_free = (CPU_STK_SIZE)0;
;;;1675          *p_used = (CPU_STK_SIZE)0;
;;;1676          *p_err  =  OS_ERR_TASK_NOT_EXIST;
;;;1677           return;
;;;1678       }
;;;1679   
;;;1680       if ((p_tcb->Opt & OS_OPT_TASK_STK_CHK) == (OS_OPT)0) {  /* Make sure stack checking option is set                 */
00001e  f896103c          LDRB     r1,[r6,#0x3c]
000022  07c9              LSLS     r1,r1,#31
000024  d010              BEQ      |L8.72|
;;;1681           CPU_CRITICAL_EXIT();
;;;1682          *p_free = (CPU_STK_SIZE)0;
;;;1683          *p_used = (CPU_STK_SIZE)0;
;;;1684          *p_err  =  OS_ERR_TASK_OPT;
;;;1685           return;
;;;1686       }
;;;1687       CPU_CRITICAL_EXIT();
000026  f7fffffe          BL       CPU_SR_Restore
;;;1688   
;;;1689       free_stk  = 0u;
00002a  2400              MOVS     r4,#0
;;;1690   #if CPU_CFG_STK_GROWTH == CPU_STK_GROWTH_HI_TO_LO
;;;1691       p_stk = p_tcb->StkBasePtr;                              /* Start at the lowest memory and go up                   */
00002c  6a75              LDR      r5,[r6,#0x24]
;;;1692       while (*p_stk == (CPU_STK)0) {                          /* Compute the number of zero entries on the stk          */
00002e  e018              B        |L8.98|
                  |L8.48|
000030  f7fffffe          BL       CPU_SR_Restore
000034  f8c7a000          STR      r10,[r7,#0]           ;1674
000038  f8c8a000          STR      r10,[r8,#0]           ;1675
00003c  f2471052          MOV      r0,#0x7152            ;1676
000040  f8a90000          STRH     r0,[r9,#0]            ;1676
                  |L8.68|
;;;1693           p_stk++;
;;;1694           free_stk++;
;;;1695       }
;;;1696   #else
;;;1697       p_stk = p_tcb->StkBasePtr + p_tcb->StkSize - 1u;        /* Start at the highest memory and go down                */
;;;1698       while (*p_stk == (CPU_STK)0) {
;;;1699           free_stk++;
;;;1700           p_stk--;
;;;1701       }
;;;1702   #endif
;;;1703      *p_free = free_stk;
;;;1704      *p_used = (p_tcb->StkSize - free_stk);                   /* Compute number of entries used on the stack            */
;;;1705      *p_err  = OS_ERR_NONE;
;;;1706   }
000044  e8bd87f0          POP      {r4-r10,pc}
                  |L8.72|
000048  f7fffffe          BL       CPU_SR_Restore
00004c  f8c7a000          STR      r10,[r7,#0]           ;1682
000050  f8c8a000          STR      r10,[r8,#0]           ;1683
000054  f2471054          MOV      r0,#0x7154            ;1684
000058  f8a90000          STRH     r0,[r9,#0]            ;1684
00005c  e7f2              B        |L8.68|
                  |L8.94|
00005e  1d2d              ADDS     r5,r5,#4              ;1693
000060  1c64              ADDS     r4,r4,#1              ;1694
                  |L8.98|
000062  6828              LDR      r0,[r5,#0]            ;1692
000064  2800              CMP      r0,#0                 ;1692
000066  d0fa              BEQ      |L8.94|
000068  603c              STR      r4,[r7,#0]            ;1703
00006a  6bb0              LDR      r0,[r6,#0x38]         ;1704
00006c  1b00              SUBS     r0,r0,r4              ;1704
00006e  f8c80000          STR      r0,[r8,#0]            ;1704
000072  f8a9a000          STRH     r10,[r9,#0]           ;1705
000076  e7e5              B        |L8.68|
;;;1707   #endif
                          ENDP

                  |L8.120|
                          DCD      OSTCBCurPtr

                          AREA ||i.OS_TaskInit||, CODE, READONLY, ALIGN=2

                  OS_TaskInit PROC
;;;1922   
;;;1923   void  OS_TaskInit (OS_ERR  *p_err)
000000  4a03              LDR      r2,|L9.16|
;;;1924   {
;;;1925   #ifdef OS_SAFETY_CRITICAL
;;;1926       if (p_err == (OS_ERR *)0) {
;;;1927           OS_SAFETY_CRITICAL_EXCEPTION();
;;;1928           return;
;;;1929       }
;;;1930   #endif
;;;1931   
;;;1932   #if OS_CFG_DBG_EN > 0u
;;;1933       OSTaskDbgListPtr = (OS_TCB      *)0;
;;;1934   #endif
;;;1935   
;;;1936       OSTaskQty        = (OS_OBJ_QTY   )0;                    /* Clear the number of tasks                              */
000002  2100              MOVS     r1,#0
000004  8011              STRH     r1,[r2,#0]
;;;1937       OSTaskCtxSwCtr   = (OS_CTX_SW_CTR)0;                    /* Clear the context switch counter                       */
000006  4a03              LDR      r2,|L9.20|
000008  6011              STR      r1,[r2,#0]  ; OSTaskCtxSwCtr
;;;1938   
;;;1939      *p_err            = OS_ERR_NONE;
00000a  8001              STRH     r1,[r0,#0]
;;;1940   }
00000c  4770              BX       lr
;;;1941   
                          ENDP

00000e  0000              DCW      0x0000
                  |L9.16|
                          DCD      OSTaskQty
                  |L9.20|
                          DCD      OSTaskCtxSwCtr

                          AREA ||i.OS_TaskInitTCB||, CODE, READONLY, ALIGN=2

                  OS_TaskInitTCB PROC
;;;1956   
;;;1957   void  OS_TaskInitTCB (OS_TCB  *p_tcb)
000000  2200              MOVS     r2,#0
;;;1958   {
;;;1959   #if OS_CFG_TASK_REG_TBL_SIZE > 0u
;;;1960       OS_REG_ID   reg_id;
;;;1961   #endif
;;;1962   #if defined(OS_CFG_TLS_TBL_SIZE) && (OS_CFG_TLS_TBL_SIZE > 0u)
;;;1963       OS_TLS_ID   id;
;;;1964   #endif
;;;1965   #if OS_CFG_TASK_PROFILE_EN > 0u
;;;1966       CPU_TS      ts;
;;;1967   #endif
;;;1968   
;;;1969   
;;;1970       p_tcb->StkPtr             = (CPU_STK       *)0;
000002  6002              STR      r2,[r0,#0]
;;;1971       p_tcb->StkLimitPtr        = (CPU_STK       *)0;
000004  6082              STR      r2,[r0,#8]
;;;1972   
;;;1973       p_tcb->ExtPtr             = (void          *)0;
000006  6042              STR      r2,[r0,#4]
;;;1974   
;;;1975       p_tcb->NextPtr            = (OS_TCB        *)0;
000008  60c2              STR      r2,[r0,#0xc]
;;;1976       p_tcb->PrevPtr            = (OS_TCB        *)0;
00000a  6102              STR      r2,[r0,#0x10]
;;;1977   
;;;1978       p_tcb->TickNextPtr        = (OS_TCB        *)0;
00000c  6142              STR      r2,[r0,#0x14]
;;;1979       p_tcb->TickPrevPtr        = (OS_TCB        *)0;
00000e  6182              STR      r2,[r0,#0x18]
;;;1980       p_tcb->TickSpokePtr       = (OS_TICK_SPOKE *)0;
000010  61c2              STR      r2,[r0,#0x1c]
;;;1981   
;;;1982       p_tcb->NamePtr            = (CPU_CHAR      *)((void *)"?Task");
000012  a110              ADR      r1,|L10.84|
000014  6201              STR      r1,[r0,#0x20]
;;;1983   
;;;1984       p_tcb->StkBasePtr         = (CPU_STK       *)0;
000016  6242              STR      r2,[r0,#0x24]
;;;1985   
;;;1986       p_tcb->TaskEntryAddr      = (OS_TASK_PTR    )0;
000018  6282              STR      r2,[r0,#0x28]
;;;1987       p_tcb->TaskEntryArg       = (void          *)0;
00001a  62c2              STR      r2,[r0,#0x2c]
;;;1988   
;;;1989   #if (OS_CFG_PEND_MULTI_EN > 0u)
;;;1990       p_tcb->PendDataTblPtr     = (OS_PEND_DATA  *)0;
;;;1991       p_tcb->PendDataTblEntries = (OS_OBJ_QTY     )0u;
;;;1992   #endif
;;;1993   
;;;1994       p_tcb->TS                 = (CPU_TS         )0u;
00001c  6402              STR      r2,[r0,#0x40]
;;;1995   
;;;1996   #if (OS_MSG_EN > 0u)
;;;1997       p_tcb->MsgPtr             = (void          *)0;
;;;1998       p_tcb->MsgSize            = (OS_MSG_SIZE    )0u;
;;;1999   #endif
;;;2000   
;;;2001   #if OS_CFG_TASK_Q_EN > 0u
;;;2002       OS_MsgQInit(&p_tcb->MsgQ,
;;;2003                   (OS_MSG_QTY)0u);
;;;2004   #if OS_CFG_TASK_PROFILE_EN > 0u
;;;2005       p_tcb->MsgQPendTime       = (CPU_TS         )0u;
;;;2006       p_tcb->MsgQPendTimeMax    = (CPU_TS         )0u;
;;;2007   #endif
;;;2008   #endif
;;;2009   
;;;2010   #if OS_CFG_FLAG_EN > 0u
;;;2011       p_tcb->FlagsPend          = (OS_FLAGS       )0u;
;;;2012       p_tcb->FlagsOpt           = (OS_OPT         )0u;
;;;2013       p_tcb->FlagsRdy           = (OS_FLAGS       )0u;
;;;2014   #endif
;;;2015   
;;;2016   #if OS_CFG_TASK_REG_TBL_SIZE > 0u
;;;2017       for (reg_id = 0u; reg_id < OS_CFG_TASK_REG_TBL_SIZE; reg_id++) {
00001e  2100              MOVS     r1,#0
                  |L10.32|
;;;2018           p_tcb->RegTbl[reg_id] = (OS_REG)0u;
000020  eb000381          ADD      r3,r0,r1,LSL #2
000024  65da              STR      r2,[r3,#0x5c]
000026  1c49              ADDS     r1,r1,#1              ;2017
000028  b2c9              UXTB     r1,r1                 ;2017
00002a  2900              CMP      r1,#0                 ;2017
00002c  d0f8              BEQ      |L10.32|
;;;2019       }
;;;2020   #endif
;;;2021   
;;;2022   #if defined(OS_CFG_TLS_TBL_SIZE) && (OS_CFG_TLS_TBL_SIZE > 0u)
;;;2023       for (id = 0u; id < OS_CFG_TLS_TBL_SIZE; id++) {
;;;2024           p_tcb->TLS_Tbl[id]    = (OS_TLS)0;
;;;2025       }
;;;2026   #endif
;;;2027   
;;;2028       p_tcb->SemCtr             = (OS_SEM_CTR     )0u;
00002e  3034              ADDS     r0,r0,#0x34
000030  6102              STR      r2,[r0,#0x10]
;;;2029   #if OS_CFG_TASK_PROFILE_EN > 0u
;;;2030       p_tcb->SemPendTime        = (CPU_TS         )0u;
;;;2031       p_tcb->SemPendTimeMax     = (CPU_TS         )0u;
;;;2032   #endif
;;;2033   
;;;2034       p_tcb->StkSize            = (CPU_STK_SIZE   )0u;
000032  6042              STR      r2,[r0,#4]
;;;2035   
;;;2036   
;;;2037   #if OS_CFG_TASK_SUSPEND_EN > 0u
;;;2038       p_tcb->SuspendCtr         = (OS_NESTING_CTR )0u;
;;;2039   #endif
;;;2040   
;;;2041   #if OS_CFG_STAT_TASK_STK_CHK_EN > 0u
;;;2042       p_tcb->StkFree            = (CPU_STK_SIZE   )0u;
000034  6302              STR      r2,[r0,#0x30]
;;;2043       p_tcb->StkUsed            = (CPU_STK_SIZE   )0u;
000036  62c2              STR      r2,[r0,#0x2c]
;;;2044   #endif
;;;2045   
;;;2046       p_tcb->Opt                = (OS_OPT         )0u;
000038  8102              STRH     r2,[r0,#8]
;;;2047   
;;;2048       p_tcb->TickCtrPrev        = (OS_TICK        )OS_TICK_TH_INIT;
00003a  f04f4100          MOV      r1,#0x80000000
00003e  6141              STR      r1,[r0,#0x14]
;;;2049       p_tcb->TickCtrMatch       = (OS_TICK        )0u;
000040  6182              STR      r2,[r0,#0x18]
;;;2050       p_tcb->TickRemain         = (OS_TICK        )0u;
000042  61c2              STR      r2,[r0,#0x1c]
;;;2051   
;;;2052       p_tcb->TimeQuanta         = (OS_TICK        )0u;
000044  6202              STR      r2,[r0,#0x20]
;;;2053       p_tcb->TimeQuantaCtr      = (OS_TICK        )0u;
000046  6242              STR      r2,[r0,#0x24]
;;;2054   
;;;2055   #if OS_CFG_TASK_PROFILE_EN > 0u
;;;2056       p_tcb->CPUUsage           = (OS_CPU_USAGE   )0u;
;;;2057       p_tcb->CPUUsageMax        = (OS_CPU_USAGE   )0u;
;;;2058       p_tcb->CtxSwCtr           = (OS_CTX_SW_CTR  )0u;
;;;2059       p_tcb->CyclesDelta        = (CPU_TS         )0u;
;;;2060       ts                        = OS_TS_GET();                /* Read the current timestamp and save                    */
;;;2061       p_tcb->CyclesStart        = ts;
;;;2062       p_tcb->CyclesTotal        = (OS_CYCLES      )0u;
;;;2063   #endif
;;;2064   #ifdef CPU_CFG_INT_DIS_MEAS_EN
;;;2065       p_tcb->IntDisTimeMax      = (CPU_TS         )0u;
;;;2066   #endif
;;;2067   #if OS_CFG_SCHED_LOCK_TIME_MEAS_EN > 0u
;;;2068       p_tcb->SchedLockTimeMax   = (CPU_TS         )0u;
;;;2069   #endif
;;;2070   
;;;2071       p_tcb->PendOn             = (OS_STATE       )OS_TASK_PEND_ON_NOTHING;
000048  7002              STRB     r2,[r0,#0]
;;;2072       p_tcb->PendStatus         = (OS_STATUS      )OS_STATUS_PEND_OK;
00004a  7042              STRB     r2,[r0,#1]
;;;2073       p_tcb->TaskState          = (OS_STATE       )OS_TASK_STATE_RDY;
00004c  7082              STRB     r2,[r0,#2]
;;;2074   
;;;2075       p_tcb->Prio               = (OS_PRIO        )OS_PRIO_INIT;
00004e  2110              MOVS     r1,#0x10
000050  70c1              STRB     r1,[r0,#3]
;;;2076   
;;;2077   #if OS_CFG_DBG_EN > 0u
;;;2078       p_tcb->DbgPrevPtr         = (OS_TCB        *)0;
;;;2079       p_tcb->DbgNextPtr         = (OS_TCB        *)0;
;;;2080       p_tcb->DbgNamePtr         = (CPU_CHAR      *)((void *)" ");
;;;2081   #endif
;;;2082   }
000052  4770              BX       lr
;;;2083   
                          ENDP

                  |L10.84|
000054  3f546173          DCB      "?Task",0
000058  6b00    
00005a  00                DCB      0
00005b  00                DCB      0

                          AREA ||i.OS_TaskReturn||, CODE, READONLY, ALIGN=2

                  OS_TaskReturn PROC
;;;2291   
;;;2292   void  OS_TaskReturn (void)
000000  b508              PUSH     {r3,lr}
;;;2293   {
;;;2294       OS_ERR  err;
;;;2295   
;;;2296   
;;;2297   
;;;2298       OSTaskReturnHook(OSTCBCurPtr);                          /* Call hook to let user decide on what to do             */
000002  4805              LDR      r0,|L11.24|
000004  6800              LDR      r0,[r0,#0]  ; OSTCBCurPtr
000006  f7fffffe          BL       OSTaskReturnHook
;;;2299   #if OS_CFG_TASK_DEL_EN > 0u
;;;2300       OSTaskDel((OS_TCB *)0,                                  /* Delete task if it accidentally returns!                */
;;;2301                 (OS_ERR *)&err);
;;;2302   #else
;;;2303       for (;;) {
;;;2304           OSTimeDly((OS_TICK )OSCfg_TickRate_Hz,
00000a  4c04              LDR      r4,|L11.28|
                  |L11.12|
00000c  466a              MOV      r2,sp
00000e  2100              MOVS     r1,#0
000010  6820              LDR      r0,[r4,#0]  ; OSCfg_TickRate_Hz
000012  f7fffffe          BL       OSTimeDly
000016  e7f9              B        |L11.12|
;;;2305                     (OS_OPT  )OS_OPT_TIME_DLY,
;;;2306                     (OS_ERR *)&err);
;;;2307       }
;;;2308   #endif
;;;2309   }
;;;2310   
                          ENDP

                  |L11.24|
                          DCD      OSTCBCurPtr
                  |L11.28|
                          DCD      OSCfg_TickRate_Hz

                          AREA ||i.OS_TaskSemPost||, CODE, READONLY, ALIGN=2

                  OS_TaskSemPost PROC
;;;2341   
;;;2342   OS_SEM_CTR  OS_TaskSemPost (OS_TCB  *p_tcb,
000000  e92d43f8          PUSH     {r3-r9,lr}
;;;2343                               OS_OPT   opt,
;;;2344                               CPU_TS   ts,
;;;2345                               OS_ERR  *p_err)
;;;2346   {
000004  4604              MOV      r4,r0
000006  4689              MOV      r9,r1
000008  4615              MOV      r5,r2
00000a  461e              MOV      r6,r3
;;;2347       OS_SEM_CTR  ctr;
;;;2348       CPU_SR_ALLOC();
;;;2349   
;;;2350   
;;;2351   
;;;2352       OS_CRITICAL_ENTER();
00000c  f7fffffe          BL       CPU_SR_Save
000010  4607              MOV      r7,r0
;;;2353       if (p_tcb == (OS_TCB *)0) {                             /* Post signal to 'self'?                                 */
000012  b90c              CBNZ     r4,|L12.24|
;;;2354           p_tcb = OSTCBCurPtr;
000014  4827              LDR      r0,|L12.180|
000016  6804              LDR      r4,[r0,#0]  ; OSTCBCurPtr
                  |L12.24|
;;;2355       }
;;;2356       p_tcb->TS = ts;
000018  6425              STR      r5,[r4,#0x40]
;;;2357      *p_err     = OS_ERR_NONE;                                /* Assume we won't have any errors                        */
00001a  2000              MOVS     r0,#0
00001c  8030              STRH     r0,[r6,#0]
;;;2358       switch (p_tcb->TaskState) {
00001e  f8940036          LDRB     r0,[r4,#0x36]
;;;2359           case OS_TASK_STATE_RDY:
;;;2360           case OS_TASK_STATE_DLY:
;;;2361           case OS_TASK_STATE_SUSPENDED:
;;;2362           case OS_TASK_STATE_DLY_SUSPENDED:
;;;2363                switch (sizeof(OS_SEM_CTR)) {
;;;2364                    case 1u:
;;;2365                         if (p_tcb->SemCtr == DEF_INT_08U_MAX_VAL) {
;;;2366                             OS_CRITICAL_EXIT();
;;;2367                            *p_err = OS_ERR_SEM_OVF;
000022  f64658c5          MOV      r8,#0x6dc5
000026  2808              CMP      r0,#8                 ;2358
000028  d23b              BCS      |L12.162|
00002a  e8dff000          TBB      [pc,r0]               ;2358
00002e  0404              DCB      0x04,0x04
000030  15150404          DCB      0x15,0x15,0x04,0x04
000034  1515              DCB      0x15,0x15
;;;2368                             return ((OS_SEM_CTR)0);
;;;2369                         }
;;;2370                         break;
;;;2371   
;;;2372                    case 2u:
;;;2373                         if (p_tcb->SemCtr == DEF_INT_16U_MAX_VAL) {
;;;2374                             OS_CRITICAL_EXIT();
;;;2375                            *p_err = OS_ERR_SEM_OVF;
;;;2376                             return ((OS_SEM_CTR)0);
;;;2377                         }
;;;2378                         break;
;;;2379   
;;;2380                    case 4u:
;;;2381                         if (p_tcb->SemCtr == DEF_INT_32U_MAX_VAL) {
000036  6c65              LDR      r5,[r4,#0x44]
000038  1c68              ADDS     r0,r5,#1
00003a  d005              BEQ      |L12.72|
;;;2382                             OS_CRITICAL_EXIT();
;;;2383                            *p_err = OS_ERR_SEM_OVF;
;;;2384                             return ((OS_SEM_CTR)0);
;;;2385                         }
;;;2386                         break;
;;;2387   
;;;2388                    default:
;;;2389                         break;
;;;2390                }
;;;2391                p_tcb->SemCtr++;                               /* Task signaled is not pending on anything               */
00003c  1c6d              ADDS     r5,r5,#1
00003e  6465              STR      r5,[r4,#0x44]
;;;2392                ctr = p_tcb->SemCtr;
;;;2393                OS_CRITICAL_EXIT();
000040  4638              MOV      r0,r7
000042  f7fffffe          BL       CPU_SR_Restore
000046  e033              B        |L12.176|
                  |L12.72|
000048  4638              MOV      r0,r7                 ;2382
00004a  f7fffffe          BL       CPU_SR_Restore
00004e  f8a68000          STRH     r8,[r6,#0]            ;2383
000052  2000              MOVS     r0,#0                 ;2384
                  |L12.84|
;;;2394                break;
;;;2395   
;;;2396           case OS_TASK_STATE_PEND:
;;;2397           case OS_TASK_STATE_PEND_TIMEOUT:
;;;2398           case OS_TASK_STATE_PEND_SUSPENDED:
;;;2399           case OS_TASK_STATE_PEND_TIMEOUT_SUSPENDED:
;;;2400                if (p_tcb->PendOn == OS_TASK_PEND_ON_TASK_SEM) {   /* Is task signaled waiting for a signal?             */
;;;2401                    OS_Post((OS_PEND_OBJ *)0,                      /*      Task is pending on signal                     */
;;;2402                            (OS_TCB      *)p_tcb,
;;;2403                            (void        *)0,
;;;2404                            (OS_MSG_SIZE  )0u,
;;;2405                            (CPU_TS       )ts);
;;;2406                    ctr = p_tcb->SemCtr;
;;;2407                    OS_CRITICAL_EXIT_NO_SCHED();
;;;2408                    if ((opt & OS_OPT_POST_NO_SCHED) == (OS_OPT)0) {
;;;2409                        OSSched();                                 /* Run the scheduler                                  */
;;;2410                    }
;;;2411                } else {
;;;2412                    switch (sizeof(OS_SEM_CTR)) {
;;;2413                        case 1u:
;;;2414                             if (p_tcb->SemCtr == DEF_INT_08U_MAX_VAL) {
;;;2415                                 OS_CRITICAL_EXIT();
;;;2416                                *p_err = OS_ERR_SEM_OVF;
;;;2417                                 return ((OS_SEM_CTR)0);
;;;2418                             }
;;;2419                             break;
;;;2420   
;;;2421                        case 2u:
;;;2422                             if (p_tcb->SemCtr == DEF_INT_16U_MAX_VAL) {
;;;2423                                 OS_CRITICAL_EXIT();
;;;2424                                *p_err = OS_ERR_SEM_OVF;
;;;2425                                 return ((OS_SEM_CTR)0);
;;;2426                             }
;;;2427                             break;
;;;2428   
;;;2429                        case 4u:
;;;2430                             if (p_tcb->SemCtr == DEF_INT_32U_MAX_VAL) {
;;;2431                                 OS_CRITICAL_EXIT();
;;;2432                                *p_err = OS_ERR_SEM_OVF;
;;;2433                                 return ((OS_SEM_CTR)0);
;;;2434                             }
;;;2435                             break;
;;;2436   
;;;2437                        default:
;;;2438                             break;
;;;2439                    }
;;;2440                    p_tcb->SemCtr++;                           /* No,  Task signaled is NOT pending on semaphore ...     */
;;;2441                    ctr = p_tcb->SemCtr;                       /*      ... it must be waiting on something else          */
;;;2442                    OS_CRITICAL_EXIT();
;;;2443                }
;;;2444                break;
;;;2445   
;;;2446           default:
;;;2447                OS_CRITICAL_EXIT();
;;;2448               *p_err = OS_ERR_STATE_INVALID;
;;;2449                ctr   = (OS_SEM_CTR)0;
;;;2450                break;
;;;2451       }
;;;2452       return (ctr);
;;;2453   }
000054  e8bd83f8          POP      {r3-r9,pc}
000058  f8940034          LDRB     r0,[r4,#0x34]         ;2400
00005c  2807              CMP      r0,#7                 ;2400
00005e  d008              BEQ      |L12.114|
000060  6c65              LDR      r5,[r4,#0x44]         ;2430
000062  1c68              ADDS     r0,r5,#1              ;2430
000064  d016              BEQ      |L12.148|
000066  1c6d              ADDS     r5,r5,#1              ;2440
000068  6465              STR      r5,[r4,#0x44]         ;2440
00006a  4638              MOV      r0,r7                 ;2442
00006c  f7fffffe          BL       CPU_SR_Restore
000070  e01e              B        |L12.176|
                  |L12.114|
000072  2300              MOVS     r3,#0                 ;2401
000074  461a              MOV      r2,r3                 ;2401
000076  4621              MOV      r1,r4                 ;2401
000078  4618              MOV      r0,r3                 ;2401
00007a  9500              STR      r5,[sp,#0]            ;2401
00007c  f7fffffe          BL       OS_Post
000080  6c65              LDR      r5,[r4,#0x44]         ;2406
000082  4638              MOV      r0,r7                 ;2407
000084  f7fffffe          BL       CPU_SR_Restore
000088  ea5f4009          LSLS     r0,r9,#16             ;2408
00008c  d410              BMI      |L12.176|
00008e  f7fffffe          BL       OSSched
000092  e00d              B        |L12.176|
                  |L12.148|
000094  4638              MOV      r0,r7                 ;2431
000096  f7fffffe          BL       CPU_SR_Restore
00009a  f8a68000          STRH     r8,[r6,#0]            ;2432
00009e  2000              MOVS     r0,#0                 ;2433
0000a0  e7d8              B        |L12.84|
                  |L12.162|
0000a2  4638              MOV      r0,r7                 ;2447
0000a4  f7fffffe          BL       CPU_SR_Restore
0000a8  f646602d          MOV      r0,#0x6e2d            ;2448
0000ac  8030              STRH     r0,[r6,#0]            ;2448
0000ae  2500              MOVS     r5,#0                 ;2449
                  |L12.176|
0000b0  4628              MOV      r0,r5                 ;2452
0000b2  e7cf              B        |L12.84|
;;;2454   
                          ENDP

                  |L12.180|
                          DCD      OSTCBCurPtr