os_core.lis

来自「将本站的UCOSFORAVR128V276版本升级到了280版」· LIS 代码 · 共 1,342 行 · 第 1/5 页

LIS
1,342
字号
 014A           ;             OS_EXIT_CRITICAL();
 014A 042F              mov R16,R20
 014C 0E940000          xcall _OS_CPU_SR_Restore
 0150                   .dbline 422
 0150           ;         }
 0150           L27:
 0150                   .dbline 423
 0150           L24:
 0150                   .dbline -2
 0150           L23:
 0150 0E940000          xcall pop_gset1
 0154                   .dbline 0 ; func end
 0154 0895              ret
 0156                   .dbsym r cpu_sr 20 c
 0156                   .dbend
 0156                   .dbfunc e OSStart _OSStart fV
                        .even
 0156           _OSStart::
 0156                   .dbline -1
 0156                   .dbline 449
 0156                   .dbline 450
 0156 20909E01          lds R2,_OSRunning
 015A 2220              tst R2
 015C C1F4              brne L33
 015E                   .dbline 450
 015E                   .dbline 451
 015E C8D2              xcall _OS_SchedNew
 0160                   .dbline 452
 0160 2090A201          lds R2,_OSPrioHighRdy
 0164 2092A301          sts _OSPrioCur,R2
 0168                   .dbline 453
 0168 82E0              ldi R24,2
 016A 829D              mul R24,R2
 016C F001              movw R30,R0
 016E 80E0              ldi R24,<_OSTCBPrioTbl
 0170 90E0              ldi R25,>_OSTCBPrioTbl
 0172 E80F              add R30,R24
 0174 F91F              adc R31,R25
 0176 2080              ldd R2,z+0
 0178 3180              ldd R3,z+1
 017A 30929400          sts _OSTCBHighRdy+1,R3
 017E 20929300          sts _OSTCBHighRdy,R2
 0182                   .dbline 454
 0182 30929800          sts _OSTCBCur+1,R3
 0186 20929700          sts _OSTCBCur,R2
 018A                   .dbline 455
 018A 0E940000          xcall _OSStartHighRdy
 018E                   .dbline 456
 018E           L33:
 018E                   .dbline -2
 018E           L32:
 018E                   .dbline 0 ; func end
 018E 0895              ret
 0190                   .dbend
 0190                   .dbfunc e OSTimeTick _OSTimeTick fV
 0190                   .dbstruct 0 8 os_event
 0190                   .dbfield 0 OSEventType c
 0190                   .dbfield 1 OSEventPtr pV
 0190                   .dbfield 3 OSEventCnt i
 0190                   .dbfield 5 OSEventGrp c
 0190                   .dbfield 6 OSEventTbl A[2:2]c
 0190                   .dbend
 0190                   .dbstruct 0 18 os_tcb
 0190                   .dbfield 0 OSTCBStkPtr pc
 0190                   .dbfield 2 OSTCBNext pS[os_tcb]
 0190                   .dbfield 4 OSTCBPrev pS[os_tcb]
 0190                   .dbfield 6 OSTCBEventPtr pS[os_event]
 0190                   .dbfield 8 OSTCBDly i
 0190                   .dbfield 10 OSTCBStat c
 0190                   .dbfield 11 OSTCBPendTO c
 0190                   .dbfield 12 OSTCBPrio c
 0190                   .dbfield 13 OSTCBX c
 0190                   .dbfield 14 OSTCBY c
 0190                   .dbfield 15 OSTCBBitX c
 0190                   .dbfield 16 OSTCBBitY c
 0190                   .dbfield 17 OSTCBDelReq c
 0190                   .dbend
 0190           ;           step -> R20
 0190           ;         cpu_sr -> R22
 0190           ;           ptcb -> R20,R21
                        .even
 0190           _OSTimeTick::
 0190 0E940000          xcall push_gset2
 0194                   .dbline -1
 0194                   .dbline 515
 0194           ;     }
 0194           ; }
 0194           ; #endif
 0194           ; 
 0194           ; /*$PAGE*/
 0194           ; /*
 0194           ; *********************************************************************************************************
 0194           ; *                                          START MULTITASKING
 0194           ; *
 0194           ; * Description: This function is used to start the multitasking process which lets uC/OS-II manages the
 0194           ; *              task that you have created.  Before you can call OSStart(), you MUST have called OSInit()
 0194           ; *              and you MUST have created at least one task.
 0194           ; *
 0194           ; * Arguments  : none
 0194           ; *
 0194           ; * Returns    : none
 0194           ; *
 0194           ; * Note       : OSStartHighRdy() MUST:
 0194           ; *                 a) Call OSTaskSwHook() then,
 0194           ; *                 b) Set OSRunning to TRUE.
 0194           ; *                 c) Load the context of the task pointed to by OSTCBHighRdy.
 0194           ; *                 d_ Execute the task.
 0194           ; *********************************************************************************************************
 0194           ; */
 0194           ; 
 0194           ; void  OSStart (void)
 0194           ; {
 0194           ;     if (OSRunning == FALSE) {
 0194           ;         OS_SchedNew();                               /* Find highest priority's task priority number   */
 0194           ;         OSPrioCur     = OSPrioHighRdy;
 0194           ;         OSTCBHighRdy  = OSTCBPrioTbl[OSPrioHighRdy]; /* Point to highest priority task ready to run    */
 0194           ;         OSTCBCur      = OSTCBHighRdy;
 0194           ;         OSStartHighRdy();                            /* Execute target specific code to start task     */
 0194           ;     }
 0194           ; }
 0194           ; /*$PAGE*/
 0194           ; /*
 0194           ; *********************************************************************************************************
 0194           ; *                                        STATISTICS INITIALIZATION
 0194           ; *
 0194           ; * Description: This function is called by your application to establish CPU usage by first determining
 0194           ; *              how high a 32-bit counter would count to in 1 second if no other tasks were to execute
 0194           ; *              during that time.  CPU usage is then determined by a low priority task which keeps track
 0194           ; *              of this 32-bit counter every second but this time, with other tasks running.  CPU usage is
 0194           ; *              determined by:
 0194           ; *
 0194           ; *                                             OSIdleCtr
 0194           ; *                 CPU Usage (%) = 100 * (1 - ------------)
 0194           ; *                                            OSIdleCtrMax
 0194           ; *
 0194           ; * Arguments  : none
 0194           ; *
 0194           ; * Returns    : none
 0194           ; *********************************************************************************************************
 0194           ; */
 0194           ; 
 0194           ; #if OS_TASK_STAT_EN > 0
 0194           ; void  OSStatInit (void)
 0194           ; {
 0194           ; #if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
 0194           ;     OS_CPU_SR  cpu_sr = 0;
 0194           ; #endif
 0194           ; 
 0194           ; 
 0194           ; 
 0194           ;     OSTimeDly(2);                                /* Synchronize with clock tick                        */
 0194           ;     OS_ENTER_CRITICAL();
 0194           ;     OSIdleCtr    = 0L;                           /* Clear idle counter                                 */
 0194           ;     OS_EXIT_CRITICAL();
 0194           ;     OSTimeDly(OS_TICKS_PER_SEC / 10);            /* Determine MAX. idle counter value for 1/10 second  */
 0194           ;     OS_ENTER_CRITICAL();
 0194           ;     OSIdleCtrMax = OSIdleCtr;                    /* Store maximum idle counter count in 1/10 second    */
 0194           ;     OSStatRdy    = TRUE;
 0194           ;     OS_EXIT_CRITICAL();
 0194           ; }
 0194           ; #endif
 0194           ; /*$PAGE*/
 0194           ; /*
 0194           ; *********************************************************************************************************
 0194           ; *                                         PROCESS SYSTEM TICK
 0194           ; *
 0194           ; * Description: This function is used to signal to uC/OS-II the occurrence of a 'system tick' (also known
 0194           ; *              as a 'clock tick').  This function should be called by the ticker ISR but, can also be
 0194           ; *              called by a high priority task.
 0194           ; *
 0194           ; * Arguments  : none
 0194           ; *
 0194           ; * Returns    : none
 0194           ; *********************************************************************************************************
 0194           ; */
 0194           ; 
 0194           ; void  OSTimeTick (void)
 0194           ; {
 0194                   .dbline 521
 0194           ;     OS_TCB    *ptcb;
 0194           ; #if OS_TICK_STEP_EN > 0
 0194           ;     BOOLEAN    step;
 0194           ; #endif
 0194           ; #if OS_CRITICAL_METHOD == 3                                /* Allocate storage for CPU status register     */
 0194           ;     OS_CPU_SR  cpu_sr = 0;
 0194 6627              clr R22
 0196                   .dbline 534
 0196           ; #endif
 0196           ; 
 0196           ; 
 0196           ; 
 0196           ; #if OS_TIME_TICK_HOOK_EN > 0
 0196           ;     OSTimeTickHook();                                      /* Call user definable hook                     */
 0196           ; #endif
 0196           ; #if OS_TIME_GET_SET_EN > 0
 0196           ;     OS_ENTER_CRITICAL();                                   /* Update the 32-bit tick counter               */
 0196           ;     OSTime++;
 0196           ;     OS_EXIT_CRITICAL();
 0196           ; #endif
 0196           ;     if (OSRunning == TRUE) {
 0196 80919E01          lds R24,_OSRunning
 019A 8130              cpi R24,1
 019C 09F0              breq X5
 019E 71C0              xjmp L36
 01A0           X5:
 01A0                   .dbline 534
 01A0                   .dbline 536
 01A0 40910000          lds R20,_OSTickStepState
 01A4 5527              clr R21
 01A6 4030              cpi R20,0
 01A8 4507              cpc R20,R21
 01AA 49F0              breq L41
 01AC           X1:
 01AC 4130              cpi R20,1
 01AE E0E0              ldi R30,0
 01B0 5E07              cpc R21,R30
 01B2 39F0              breq L42
 01B4 4230              cpi R20,2
 01B6 E0E0              ldi R30,0
 01B8 5E07              cpc R21,R30
 01BA 29F0              breq L43
 01BC 09C0              xjmp L38
 01BE           X2:
 01BE                   .dbline 536
 01BE           ; #if OS_TICK_STEP_EN > 0
 01BE           ;         switch (OSTickStepState) {                         /* Determine whether we need to process a tick  */
 01BE           L41:
 01BE                   .dbline 538
 01BE           ;             case OS_TICK_STEP_DIS:                         /* Yes, stepping is disabled                    */
 01BE           ;                  step = TRUE;
 01BE 41E0              ldi R20,1
 01C0                   .dbline 539
 01C0           ;                  break;
 01C0 0BC0              xjmp L39
 01C2           L42:
 01C2                   .dbline 542
 01C2           ; 
 01C2           ;             case OS_TICK_STEP_WAIT:                        /* No,  waiting for uC/OS-View to set ...       */
 01C2           ;                  step = FALSE;                             /*      .. OSTickStepState to OS_TICK_STEP_ONCE */
 01C2 4427              clr R20
 01C4                   .dbline 543
 01C4           ;                  break;
 01C4 09C0              xjmp L39
 01C6           L43:
 01C6                   .dbline 546
 01C6           ; 
 01C6           ;             case OS_TICK_STEP_ONCE:                        /* Yes, process tick once and wait for next ... */
 01C6           ;                  step            = TRUE;                   /*      ... step command from uC/OS-View        */
 01C6 41E0              ldi R20,1
 01C8                   .dbline 547
 01C8           ;                  OSTickStepState = OS_TICK_STEP_WAIT;
 01C8 81E0              ldi R24,1
 01CA 80930000          sts _OSTickStepState,R24
 01CE                   .dbline 548
 01CE           ;                  break;
 01CE 04C0              xjmp L39
 01D0           L38:
 01D0                   .dbline 551
 01D0           ; 
 01D0           ;             default:                                       /* Invalid case, correct situation              */
 01D0           ;                  step            = TRUE;
 01D0 41E0              ldi R20,1
 01D2                   .dbline 552
 01D2           ;                  OSTickStepState = OS_TICK_STEP_DIS;
 01D2 2224              clr R2
 01D4 20920000          sts _OSTickStepState,R2
 01D8                   .dbline 553
 01D8           ;                  break;
 01D8           L39:

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?