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

📄 os_task.lst

📁 ARM仿真案例
💻 LST
📖 第 1 页 / 共 5 页
字号:
   \   0000009A   2F23               MOVS     R3,#+47
   \   0000009C   CB5C               LDRB     R3,[R1, R3]
     88              if ((OSRdyTbl[y_old] & ptcb->OSTCBBitX) != 0x00) {          /* If task is ready make it not        */
   \   0000009E   1B06               LSLS     R3,R3,#+24       ;; ZeroExtS R3,R3,#+24,#+24
   \   000000A0   1B0E               LSRS     R3,R3,#+24
   \   000000A2   ....               LDR      R4,??DataTable14  ;; OSRdyTbl
   \   000000A4   E45C               LDRB     R4,[R4, R3]
   \   000000A6   3026               MOVS     R6,#+48
   \   000000A8   8E5D               LDRB     R6,[R1, R6]
   \   000000AA   3442               TST      R4,R6
   \   000000AC   28D0               BEQ      ??OSTaskChangePrio_7
     89                  OSRdyTbl[y_old] &= ~ptcb->OSTCBBitX;
   \   000000AE   1B06               LSLS     R3,R3,#+24       ;; ZeroExtS R3,R3,#+24,#+24
   \   000000B0   1B0E               LSRS     R3,R3,#+24
   \   000000B2   ....               LDR      R4,??DataTable14  ;; OSRdyTbl
   \   000000B4   1B06               LSLS     R3,R3,#+24       ;; ZeroExtS R3,R3,#+24,#+24
   \   000000B6   1B0E               LSRS     R3,R3,#+24
   \   000000B8   ....               LDR      R6,??DataTable14  ;; OSRdyTbl
   \   000000BA   F65C               LDRB     R6,[R6, R3]
   \   000000BC   3027               MOVS     R7,#+48
   \   000000BE   CF5D               LDRB     R7,[R1, R7]
   \   000000C0   BE43               BICS     R6,R6,R7
   \   000000C2   E654               STRB     R6,[R4, R3]
     90                  if (OSRdyTbl[y_old] == 0x00) {
   \   000000C4   ....               LDR      R4,??DataTable14  ;; OSRdyTbl
   \   000000C6   E35C               LDRB     R3,[R4, R3]
   \   000000C8   002B               CMP      R3,#+0
   \   000000CA   06D1               BNE      ??OSTaskChangePrio_8
     91                      OSRdyGrp &= ~ptcb->OSTCBBitY;
   \   000000CC   ....               LDR      R3,??DataTable12  ;; OSRdyGrp
   \   000000CE   ....               LDR      R4,??DataTable12  ;; OSRdyGrp
   \   000000D0   2478               LDRB     R4,[R4, #+0]
   \   000000D2   3126               MOVS     R6,#+49
   \   000000D4   8E5D               LDRB     R6,[R1, R6]
   \   000000D6   B443               BICS     R4,R4,R6
   \   000000D8   1C70               STRB     R4,[R3, #+0]
     92                  }
     93                  OSRdyGrp    |= bity;                                    /* Make new priority ready to run      */
   \                     ??OSTaskChangePrio_8:
   \   000000DA   ....               LDR      R3,??DataTable12  ;; OSRdyGrp
   \   000000DC   ....               LDR      R4,??DataTable12  ;; OSRdyGrp
   \   000000DE   2478               LDRB     R4,[R4, #+0]
   \   000000E0   6E46               MOV      R6,SP
   \   000000E2   7678               LDRB     R6,[R6, #+1]
   \   000000E4   2643               ORRS     R6,R6,R4
   \   000000E6   1E70               STRB     R6,[R3, #+0]
     94                  OSRdyTbl[y] |= bitx;
   \   000000E8   1206               LSLS     R2,R2,#+24       ;; ZeroExtS R2,R2,#+24,#+24
   \   000000EA   120E               LSRS     R2,R2,#+24
   \   000000EC   ....               LDR      R3,??DataTable14  ;; OSRdyTbl
   \   000000EE   1206               LSLS     R2,R2,#+24       ;; ZeroExtS R2,R2,#+24,#+24
   \   000000F0   120E               LSRS     R2,R2,#+24
   \   000000F2   ....               LDR      R4,??DataTable14  ;; OSRdyTbl
   \   000000F4   A45C               LDRB     R4,[R4, R2]
   \   000000F6   6E46               MOV      R6,SP
   \   000000F8   3678               LDRB     R6,[R6, #+0]
   \   000000FA   2643               ORRS     R6,R6,R4
   \   000000FC   9E54               STRB     R6,[R3, R2]
   \   000000FE   28E0               B        ??OSTaskChangePrio_9
     95          #if OS_EVENT_EN > 0
     96              } else {                                                    /* Task was not ready ...              */
     97                  pevent = ptcb->OSTCBEventPtr;
   \                     ??OSTaskChangePrio_7:
   \   00000100   CC69               LDR      R4,[R1, #+28]
     98                  if (pevent != (OS_EVENT *)0) {                          /* ... remove from event wait list     */
   \   00000102   002C               CMP      R4,#+0
   \   00000104   25D0               BEQ      ??OSTaskChangePrio_9
     99                      pevent->OSEventTbl[y_old] &= ~ptcb->OSTCBBitX;
   \   00000106   1B06               LSLS     R3,R3,#+24       ;; ZeroExtS R3,R3,#+24,#+24
   \   00000108   1B0E               LSRS     R3,R3,#+24
   \   0000010A   E618               ADDS     R6,R4,R3
   \   0000010C   B446               MOV      R12,R6
   \   0000010E   1B06               LSLS     R3,R3,#+24       ;; ZeroExtS R3,R3,#+24,#+24
   \   00000110   1B0E               LSRS     R3,R3,#+24
   \   00000112   E618               ADDS     R6,R4,R3
   \   00000114   377A               LDRB     R7,[R6, #+8]
   \   00000116   3026               MOVS     R6,#+48
   \   00000118   8E5D               LDRB     R6,[R1, R6]
   \   0000011A   B743               BICS     R7,R7,R6
   \   0000011C   6646               MOV      R6,R12
   \   0000011E   3772               STRB     R7,[R6, #+8]
    100                      if (pevent->OSEventTbl[y_old] == 0) {
   \   00000120   E318               ADDS     R3,R4,R3
   \   00000122   1B7A               LDRB     R3,[R3, #+8]
   \   00000124   002B               CMP      R3,#+0
   \   00000126   04D1               BNE      ??OSTaskChangePrio_10
    101                          pevent->OSEventGrp &= ~ptcb->OSTCBBitY;
   \   00000128   6378               LDRB     R3,[R4, #+1]
   \   0000012A   3126               MOVS     R6,#+49
   \   0000012C   8E5D               LDRB     R6,[R1, R6]
   \   0000012E   B343               BICS     R3,R3,R6
   \   00000130   6370               STRB     R3,[R4, #+1]
    102                      }
    103                      pevent->OSEventGrp    |= bity;                      /* Add new priority to wait list       */
   \                     ??OSTaskChangePrio_10:
   \   00000132   6378               LDRB     R3,[R4, #+1]
   \   00000134   6E46               MOV      R6,SP
   \   00000136   7678               LDRB     R6,[R6, #+1]
   \   00000138   1E43               ORRS     R6,R6,R3
   \   0000013A   6670               STRB     R6,[R4, #+1]
    104                      pevent->OSEventTbl[y] |= bitx;
   \   0000013C   1206               LSLS     R2,R2,#+24       ;; ZeroExtS R2,R2,#+24,#+24
   \   0000013E   120E               LSRS     R2,R2,#+24
   \   00000140   A318               ADDS     R3,R4,R2
   \   00000142   1206               LSLS     R2,R2,#+24       ;; ZeroExtS R2,R2,#+24,#+24
   \   00000144   120E               LSRS     R2,R2,#+24
   \   00000146   A418               ADDS     R4,R4,R2
   \   00000148   247A               LDRB     R4,[R4, #+8]
   \   0000014A   6E46               MOV      R6,SP
   \   0000014C   3678               LDRB     R6,[R6, #+0]
   \   0000014E   2643               ORRS     R6,R6,R4
   \   00000150   1E72               STRB     R6,[R3, #+8]
    105                  }
    106          #endif
    107              }
    108              ptcb->OSTCBPrio = newprio;                                  /* Set new task priority               */
   \                     ??OSTaskChangePrio_9:
   \   00000152   2D23               MOVS     R3,#+45
   \   00000154   CD54               STRB     R5,[R1, R3]
    109              ptcb->OSTCBY    = y;
   \   00000156   2F23               MOVS     R3,#+47
   \   00000158   CA54               STRB     R2,[R1, R3]
    110              ptcb->OSTCBX    = x;
   \   0000015A   2E22               MOVS     R2,#+46
   \   0000015C   6B46               MOV      R3,SP
   \   0000015E   9B78               LDRB     R3,[R3, #+2]
   \   00000160   8B54               STRB     R3,[R1, R2]
    111              ptcb->OSTCBBitY = bity;
   \   00000162   3122               MOVS     R2,#+49
   \   00000164   6B46               MOV      R3,SP
   \   00000166   5B78               LDRB     R3,[R3, #+1]
   \   00000168   8B54               STRB     R3,[R1, R2]
    112              ptcb->OSTCBBitX = bitx;
   \   0000016A   3031               ADDS     R1,R1,#+48
   \   0000016C   6A46               MOV      R2,SP
   \   0000016E   1278               LDRB     R2,[R2, #+0]
   \   00000170   0A70               STRB     R2,[R1, #+0]
    113              OS_EXIT_CRITICAL();
   \   00000172   ........           _BLF     OS_CPU_SR_Restore,??OS_CPU_SR_Restore??rT
    114              OS_Sched();                                                 /* Run highest priority task ready     */
   \   00000176   ........           _BLF     OS_Sched,??OS_Sched??rT
    115              return (OS_NO_ERR);
   \   0000017A   0020               MOVS     R0,#+0
   \                     ??OSTaskChangePrio_1:
   \   0000017C   01B0               ADD      SP,SP,#+4
   \   0000017E   F0BC               POP      {R4-R7}
   \   00000180   02BC               POP      {R1}
   \   00000182   0847               BX       R1               ;; return
   \                     ??OSTaskChangePrio_6:
   \   00000184   ........           DC32     OSMapTbl
    116          }
    117          #endif
    118          
    119          /*
    120          *********************************************************************************************************
    121          *                                            CREATE A TASK
    122          *
    123          * Description: This function is used to have uC/OS-II manage the execution of a task.  Tasks can either
    124          *              be created prior to the start of multitasking or by a running task.  A task cannot be
    125          *              created by an ISR.
    126          *
    127          * Arguments  : task     is a pointer to the task's code
    128          *
    129          *              p_arg    is a pointer to an optional data area which can be used to pass parameters to
    130          *                       the task when the task first executes.  Where the task is concerned it thinks
    131          *                       it was invoked and passed the argument 'p_arg' as follows:
    132          *
    133          *                           void Task (void *p_arg)
    134          *                           {
    135          *                               for (;;) {
    136          *                                   Task code;
    137          *                               }
    138          *                           }
    139          *
    140          *              ptos     is a pointer to the task's top of stack.  If the configuration constant
    141          *                       OS_STK_GROWTH is set to 1, the stack is assumed to grow downward (i.e. from high
    142          *                       memory to low memory).  'pstk' will thus point to the highest (valid) memory
    143          *                       location of the stack.  If OS_STK_GROWTH is set to 0, 'pstk' will point to the
    144          *                       lowest memory location of the stack and the stack will grow with increasing
    145          *                       memory locations.
    146          *
    147          *              prio     is the task's priority.  A unique priority MUST be assigned to each task and the
    148          *                       lower the number, the higher the priority.
    149          *
    150          * Returns    : OS_NO_ERR        if the function was successful.
    151          *              OS_PRIO_EXIT     if the task priority already exist
    152          *                               (each task MUST have a unique priority).
    153          *              OS_PRIO_INVALID  if the priority you specify is higher that the maximum allowed
    154          *                               (i.e. >= OS_LOWEST_PRIO)
    155          *********************************************************************************************************
    156          */
    157          
    158          #if OS_TASK_CREATE_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
    159          INT8U  OSTaskCreate (void (*task)(void *pd), void *p_arg, OS_STK *ptos, INT8U prio)
    160          {
   \                     OSTaskCreate:
   \   00000000   F0B5               PUSH     {R4-R7,LR}
   \   00000002   0400               MOVS     R4,R0
   \   00000004   0D00               MOVS     R5,R1
   \   00000006   1600               MOVS     R6,R2
   \   00000008   1F00               MOVS     R7,R3
    161          #if OS_CRITICAL_METHOD == 3                  /* Allocate storage for CPU status register               */

⌨️ 快捷键说明

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