⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os_core.lst

📁 在MC68HC908JB8上移植UCOSII成功
💻 LST
📖 第 1 页 / 共 5 页
字号:
  334:  * Notes      : 1) This function is INTERNAL to uC/OS-II and your application should not call it.
  335:  *              2) Rescheduling is prevented when the scheduler is locked (see OSSchedLock())
  336:  *********************************************************************************************************
  337:  */
  338:  
  339:  void OSSched (void)
  340:  {

Function: OSSched
Source  : C:\motoctest\ucos1\sources\os_core.c
Options : -Cc -EnvGENPATH=C:\motoctest\ucos1;C:\motoctest\ucos1\bin;C:\motoctest\ucos1\cmd;C:\motoctest\ucos1\prm;C:\motoctest\ucos1\sources;C:\Metrowerks\lib\HC08c\LIB;C:\Metrowerks\lib\HC08c\src;C:\Metrowerks\lib\HC08c\INCLUDE -EnvLIBPATH=C:\Metrowerks\lib\HC08c\INCLUDE -EnvOBJPATH=C:\motoctest\ucos1\bin -EnvTEXTPATH=C:\motoctest\ucos1\bin -La=%f.inc -Lasm=%n.lst -ObjN=C:\motoctest\ucos1\ucos1_Data\MMDS-MMEVS\ObjectCode\os_core.c.o

  0000 8b               PSHH  
  341:      INT8U y;
  342:  
  343:  
  344:      OS_ENTER_CRITICAL();
  0001 9b               SEI   
  345:      if ((OSLockNesting | OSIntNesting) == 0) {   /* Task scheduling must be enabled and not ISR level  */
  0002 b600             LDA   OSLockNesting
  0004 ba00             ORA   OSIntNesting
  0006 2628             BNE   L30 ;abs = 0030
  346:          y             = OSUnMapTbl[OSRdyGrp];    /* Get pointer to highest priority task ready to run  */
  0008 be00             LDX   OSRdyGrp
  000a 8c               CLRH  
  000b d60000           LDA   @OSUnMapTbl,X
  000e 9ee701           STA   1,SP
  347:          OSPrioHighRdy = (INT8U)((y << 3) + OSUnMapTbl[OSRdyTbl[y]]);
  0011 48               LSLA  
  0012 48               LSLA  
  0013 48               LSLA  
  0014 9eee01           LDX   1,SP
  0017 ee00             LDX   @OSRdyTbl,X
  0019 db0000           ADD   @OSUnMapTbl,X
  001c b700             STA   OSPrioHighRdy
  348:          if (OSPrioHighRdy != OSPrioCur) {         /* No context switch if current task is highest ready */
  001e b100             CMP   OSPrioCur
  0020 270e             BEQ   L30 ;abs = 0030
  349:              OSTCBHighRdy = OSTCBPrioTbl[OSPrioHighRdy];
  0022 48               LSLA  
  0023 97               TAX   
  0024 ee01             LDX   @OSTCBPrioTbl:1,X
  0026 bf01             STX   OSTCBHighRdy:1
  0028 97               TAX   
  0029 ee00             LDX   @OSTCBPrioTbl,X
  002b bf00             STX   OSTCBHighRdy
  350:              OSCtxSwCtr++;                        /* Increment context switch counter                   */
  002d 3c00             INC   OSCtxSwCtr
  351:              OS_TASK_SW();                        /* Perform a context switch                           */
  002f 83               SWI   
  0030          L30:    
  352:          }
  353:      }
  354:      OS_EXIT_CRITICAL();
  0030 9a               CLI   
  355:  }
  0031 8a               PULH  
  0032 81               RTS   
  356:  /*$PAGE*/
  357:  /*
  358:  *********************************************************************************************************
  359:  *                                          PREVENT SCHEDULING
  360:  *
  361:  * Description: This function is used to prevent rescheduling to take place.  This allows your application
  362:  *              to prevent context switches until you are ready to permit context switching.
  363:  *
  364:  * Arguments  : none
  365:  *
  366:  * Returns    : none
  367:  *
  368:  * Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every 
  369:  *                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
  370:  *********************************************************************************************************
  371:  */
  372:  
  373:  void OSSchedLock (void)
  374:  {

Function: OSSchedLock
Source  : C:\motoctest\ucos1\sources\os_core.c
Options : -Cc -EnvGENPATH=C:\motoctest\ucos1;C:\motoctest\ucos1\bin;C:\motoctest\ucos1\cmd;C:\motoctest\ucos1\prm;C:\motoctest\ucos1\sources;C:\Metrowerks\lib\HC08c\LIB;C:\Metrowerks\lib\HC08c\src;C:\Metrowerks\lib\HC08c\INCLUDE -EnvLIBPATH=C:\Metrowerks\lib\HC08c\INCLUDE -EnvOBJPATH=C:\motoctest\ucos1\bin -EnvTEXTPATH=C:\motoctest\ucos1\bin -La=%f.inc -Lasm=%n.lst -ObjN=C:\motoctest\ucos1\ucos1_Data\MMDS-MMEVS\ObjectCode\os_core.c.o

  375:      if (OSRunning == TRUE) {                     /* Make sure multitasking is running                  */
  0000 b600             LDA   OSRunning
  0002 a101             CMP   #1
  0004 2604             BNE   LA ;abs = 000a
  376:          OS_ENTER_CRITICAL();
  0006 9b               SEI   
  377:          OSLockNesting++;                         /* Increment lock nesting level                       */
  0007 3c00             INC   OSLockNesting
  378:          OS_EXIT_CRITICAL();
  0009 9a               CLI   
  000a          LA:     
  379:      }
  380:  }
  000a 81               RTS   
  381:  /*$PAGE*/
  382:  /*
  383:  *********************************************************************************************************
  384:  *                                          ENABLE SCHEDULING
  385:  *
  386:  * Description: This function is used to re-allow rescheduling.  
  387:  *
  388:  * Arguments  : none
  389:  *
  390:  * Returns    : none
  391:  *
  392:  * Notes      : 1) You MUST invoke OSSchedLock() and OSSchedUnlock() in pair.  In other words, for every 
  393:  *                 call to OSSchedLock() you MUST have a call to OSSchedUnlock().
  394:  *********************************************************************************************************
  395:  */
  396:  
  397:  void OSSchedUnlock (void)
  398:  {

Function: OSSchedUnlock
Source  : C:\motoctest\ucos1\sources\os_core.c
Options : -Cc -EnvGENPATH=C:\motoctest\ucos1;C:\motoctest\ucos1\bin;C:\motoctest\ucos1\cmd;C:\motoctest\ucos1\prm;C:\motoctest\ucos1\sources;C:\Metrowerks\lib\HC08c\LIB;C:\Metrowerks\lib\HC08c\src;C:\Metrowerks\lib\HC08c\INCLUDE -EnvLIBPATH=C:\Metrowerks\lib\HC08c\INCLUDE -EnvOBJPATH=C:\motoctest\ucos1\bin -EnvTEXTPATH=C:\motoctest\ucos1\bin -La=%f.inc -Lasm=%n.lst -ObjN=C:\motoctest\ucos1\ucos1_Data\MMDS-MMEVS\ObjectCode\os_core.c.o

  399:      if (OSRunning == TRUE) {                           /* Make sure multitasking is running            */
  0000 b600             LDA   OSRunning
  0002 a101             CMP   #1
  0004 2613             BNE   L19 ;abs = 0019
  400:          OS_ENTER_CRITICAL();
  0006 9b               SEI   
  401:          if (OSLockNesting > 0) {                       /* Do not decrement if already 0                */
  0007 3d00             TST   OSLockNesting
  0009 270d             BEQ   L18 ;abs = 0018
  402:              OSLockNesting--;                           /* Decrement lock nesting level                 */
  000b 3a00             DEC   OSLockNesting
  403:              if ((OSLockNesting | OSIntNesting) == 0) { /* See if scheduling re-enabled and not an ISR  */
  000d b600             LDA   OSLockNesting
  000f ba00             ORA   OSIntNesting
  0011 2603             BNE   L16 ;abs = 0016
  404:                  OS_EXIT_CRITICAL();
  0013 9a               CLI   
  405:                  OSSched();                             /* See if a higher priority task is ready       */
  0014 2000             BRA   OSSched
  0016          L16:    
  406:              } else {
  407:                  OS_EXIT_CRITICAL();
  0016 9a               CLI   
  0017 81               RTS   
  0018          L18:    
  408:              }
  409:          } else {
  410:              OS_EXIT_CRITICAL();
  0018 9a               CLI   
  0019          L19:    
  411:          }
  412:      }
  413:  }
  0019 81               RTS   
  414:  /*$PAGE*/
  415:  /*
  416:  *********************************************************************************************************
  417:  *                                          START MULTITASKING
  418:  *
  419:  * Description: This function is used to start the multitasking process which lets uC/OS-II manages the
  420:  *              task that you have created.  Before you can call OSStart(), you MUST have called OSInit()
  421:  *              and you MUST have created at least one task.
  422:  *
  423:  * Arguments  : none
  424:  *
  425:  * Returns    : none
  426:  *
  427:  * Note       : OSStartHighRdy() MUST:
  428:  *                 a) Call OSTaskSwHook() then,
  429:  *                 b) Set OSRunning to TRUE.
  430:  *********************************************************************************************************
  431:  */
  432:  
  433:  void OSStart (void)
  434:  {

Function: OSStart
Source  : C:\motoctest\ucos1\sources\os_core.c
Options : -Cc -EnvGENPATH=C:\motoctest\ucos1;C:\motoctest\ucos1\bin;C:\motoctest\ucos1\cmd;C:\motoctest\ucos1\prm;C:\motoctest\ucos1\sources;C:\Metrowerks\lib\HC08c\LIB;C:\Metrowerks\lib\HC08c\src;C:\Metrowerks\lib\HC08c\INCLUDE -EnvLIBPATH=C:\Metrowerks\lib\HC08c\INCLUDE -EnvOBJPATH=C:\motoctest\ucos1\bin -EnvTEXTPATH=C:\motoctest\ucos1\bin -La=%f.inc -Lasm=%n.lst -ObjN=C:\motoctest\ucos1\ucos1_Data\MMDS-MMEVS\ObjectCode\os_core.c.o

  435:      INT8U y;
  436:      INT8U x;
  437:  
  438:  
  439:      if (OSRunning == FALSE) {
  0000 3d00             TST   OSRunning
  0002 262d             BNE   L31 ;abs = 0031
  440:          y             = OSUnMapTbl[OSRdyGrp];        /* Find highest priority's task priority number   */
  0004 be00             LDX   OSRdyGrp
  0006 8c               CLRH  
  0007 de0000           LDX   @OSUnMapTbl,X
  441:          x             = OSUnMapTbl[OSRdyTbl[y]];
  000a 89               PSHX  
  000b ee00             LDX   @OSRdyTbl,X
  000d d60000           LDA   @OSUnMapTbl,X
  442:          OSPrioHighRdy = (INT8U)((y << 3) + x);
  0010 88               PULX  
  0011 58               LSLX  
  0012 58               LSLX  
  0013 58               LSLX  
  0014 87               PSHA  
  0015 9f               TXA   
  0016 9eeb01           ADD   1,SP
  0019 b700             STA   OSPrioHighRdy
  443:          OSPrioCur     = OSPrioHighRdy;
  001b 4e0000           MOV   OSPrioHighRdy,OSPrioCur
  444:          OSTCBHighRdy  = OSTCBPrioTbl[OSPrioHighRdy]; /* Point to highest priority task ready to run    */
  001e 48               LSLA  
  001f 97               TAX   
  0020 ee01             LDX   @OSTCBPrioTbl:1,X
  0022 bf01             STX   OSTCBHighRdy:1
  0024 97               TAX   
  0025 ee00             LDX   @OSTCBPrioTbl,X
  0027 bf00             STX   OSTCBHighRdy
  445:          OSTCBCur      = OSTCBHighRdy;
  0029 5500             LDHX  OSTCBHighRdy
  002b 3500             STHX  OSTCBCur
  446:          OSStartHighRdy();                            /* Execute target specific code to start task     */
  002d cd0000           JSR   OSStartHighRdy
  0030 8a               PULH  
  0031          L31:    
  447:      }
  448:  }
  0031 81               RTS   
  449:  /*$PAGE*/
  450:  /*
  451:  *********************************************************************************************************
  452:  *                                        STATISTICS INITIALIZATION
  453:  *
  454:  * Description: This function is called by your application to establish CPU usage by first determining
  455:  *              how high a 32-bit counter would count to in 1 second if no other tasks were to execute
  456:  *              during that time.  CPU usage is then determined by a low priority task which keeps track
  457:  *              of this 32-bit counter every second but this time, with other tasks running.  CPU usage is
  458:  *              determined by:
  459:  *
  460:  *                                             OSIdleCtr
  461:  *                 CPU Usage (%) = 100 * (1 - ------------)
  462:  *                                            OSIdleCtrMax
  463:  *
  464:  * Arguments  : none
  465:  *
  466:  * Returns    : none
  467:  *********************************************************************************************************
  468:  */
  469:  
  470:  #if OS_TASK_STAT_EN
  471:  void OSStatInit (void)
  472:  {
  473:      OSTimeDly(2);                                /* Synchronize with clock tick                        */
  474:      OS_ENTER_CRITICAL();
  475:      OSIdleCtr    = 0L;                           /* Clear idle counter                                 */

⌨️ 快捷键说明

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