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

📄 os_q.lst

📁 IARSOURCECODE是基于LPC2478嵌入式软件IAR EWARM V4.42的应用实例代码
💻 LST
📖 第 1 页 / 共 5 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.42A/W32 KICKSTART     10/Jan/2008  16:48:30 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  arm                                                  #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \uCOS-II\Source\os_q.c                               #
#    Command line    =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \uCOS-II\Source\os_q.c -lCN                          #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\List\   #
#                       -o D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Softw #
#                       are\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\Obj\ #
#                        -z3 --no_cse --no_unroll --no_inline                #
#                       --no_code_motion --no_tbaa --no_clustering           #
#                       --no_scheduling --debug --cpu_mode arm --endian      #
#                       little --cpu ARM7TDMI-S --stack_align 4 -e --fpu     #
#                       None --dlib_config "C:\Program Files\IAR             #
#                       Systems\Embedded Workbench 4.0                       #
#                       Kickstart\arm\LIB\dl4tpannl8n.h" -I                  #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ -I           #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\ucos-ii\ports\arm\generic\iar\ -I                  #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\ucos-ii\source\ -I D:\work\资料\嵌入式操作系统\UCO #
#                       S-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IAR\ #
#                       OS-View\..\..\..\..\..\ucosview\source\ -I           #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\ucosview\ports\arm7\lpc2468\iar\ -I                #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\uc-lib\ -I D:\work\资料\嵌入式操作系统\UCOS-II\Mic #
#                       rium\Software\EvalBoards\NXP\LPC2468-EA\IAR\OS-View\ #
#                       ..\..\..\..\..\uc-cpu\ -I                            #
#                       D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\..\..\..\..\. #
#                       .\uc-cpu\arm\IAR\ -I D:\work\资料\嵌入式操作系统\UCO #
#                       S-II\Micrium\Software\EvalBoards\NXP\LPC2468-EA\IAR\ #
#                       OS-View\..\BSP\ -I "C:\Program Files\IAR             #
#                       Systems\Embedded Workbench 4.0 Kickstart\arm\INC\"   #
#    List file       =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\List\os #
#                       _q.lst                                               #
#    Object file     =  D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software #
#                       \EvalBoards\NXP\LPC2468-EA\IAR\OS-View\Flash\Obj\os_ #
#                       q.r79                                                #
#                                                                            #
#                                                                            #
##############################################################################

D:\work\资料\嵌入式操作系统\UCOS-II\Micrium\Software\uCOS-II\Source\os_q.c
      1          /*
      2          *********************************************************************************************************
      3          *                                                uC/OS-II
      4          *                                          The Real-Time Kernel
      5          *                                        MESSAGE QUEUE MANAGEMENT
      6          *
      7          *                          (c) Copyright 1992-2007, Jean J. Labrosse, Weston, FL
      8          *                                           All Rights Reserved
      9          *
     10          * File    : OS_Q.C
     11          * By      : Jean J. Labrosse
     12          * Version : V2.84
     13          *
     14          * LICENSING TERMS:
     15          * ---------------
     16          *   uC/OS-II is provided in source form for FREE evaluation, for educational use or for peaceful research.  
     17          * If you plan on using  uC/OS-II  in a commercial product you need to contact Micri祄 to properly license 
     18          * its use in your product. We provide ALL the source code for your convenience and to help you experience 
     19          * uC/OS-II.   The fact that the  source is provided does  NOT  mean that you can use it without  paying a 
     20          * licensing fee.
     21          *********************************************************************************************************
     22          */
     23          
     24          #ifndef  OS_MASTER_FILE
     25          #include <ucos_ii.h>
     26          #endif
     27          
     28          #if (OS_Q_EN > 0) && (OS_MAX_QS > 0)
     29          /*
     30          *********************************************************************************************************
     31          *                                      ACCEPT MESSAGE FROM QUEUE
     32          *
     33          * Description: This function checks the queue to see if a message is available.  Unlike OSQPend(),
     34          *              OSQAccept() does not suspend the calling task if a message is not available.
     35          *
     36          * Arguments  : pevent        is a pointer to the event control block
     37          *
     38          *              err           is a pointer to where an error message will be deposited.  Possible error
     39          *                            messages are:
     40          *
     41          *                            OS_ERR_NONE         The call was successful and your task received a
     42          *                                                message.
     43          *                            OS_ERR_EVENT_TYPE   You didn't pass a pointer to a queue
     44          *                            OS_ERR_PEVENT_NULL  If 'pevent' is a NULL pointer
     45          *                            OS_ERR_Q_EMPTY      The queue did not contain any messages
     46          *
     47          * Returns    : != (void *)0  is the message in the queue if one is available.  The message is removed
     48          *                            from the so the next time OSQAccept() is called, the queue will contain
     49          *                            one less entry.
     50          *              == (void *)0  if you received a NULL pointer message
     51          *                            if the queue is empty or,
     52          *                            if 'pevent' is a NULL pointer or,
     53          *                            if you passed an invalid event type
     54          *
     55          * Note(s)    : As of V2.60, you can now pass NULL pointers through queues.  Because of this, the argument
     56          *              'err' has been added to the API to tell you about the outcome of the call.
     57          *********************************************************************************************************
     58          */
     59          
     60          #if OS_Q_ACCEPT_EN > 0

   \                                 In segment CODE, align 4, keep-with-next
     61          void  *OSQAccept (OS_EVENT *pevent, INT8U *err)
     62          {
   \                     OSQAccept:
   \   00000000   30402DE9           PUSH     {R4,R5,LR}
   \   00000004   0050B0E1           MOVS     R5,R0
   \   00000008   0140B0E1           MOVS     R4,R1
     63              void      *msg;
     64              OS_Q      *pq;
     65          #if OS_CRITICAL_METHOD == 3                      /* Allocate storage for CPU status register           */
     66              OS_CPU_SR  cpu_sr = 0;
   \   0000000C   0000A0E3           MOV      R0,#+0
     67          #endif
     68          
     69          
     70          
     71          #if OS_ARG_CHK_EN > 0
     72              if (err == (INT8U *)0) {                     /* Validate 'err'                                     */
   \   00000010   000054E3           CMP      R4,#+0
   \   00000014   0100001A           BNE      ??OSQAccept_0
     73                  return ((void *)0);
   \   00000018   0000A0E3           MOV      R0,#+0
   \   0000001C   280000EA           B        ??OSQAccept_1
     74              }
     75              if (pevent == (OS_EVENT *)0) {               /* Validate 'pevent'                                  */
   \                     ??OSQAccept_0:
   \   00000020   000055E3           CMP      R5,#+0
   \   00000024   0300001A           BNE      ??OSQAccept_2
     76                  *err = OS_ERR_PEVENT_NULL;
   \   00000028   0400A0E3           MOV      R0,#+4
   \   0000002C   0000C4E5           STRB     R0,[R4, #+0]
     77                  return ((void *)0);
   \   00000030   0000A0E3           MOV      R0,#+0
   \   00000034   220000EA           B        ??OSQAccept_1
     78              }
     79          #endif
     80              if (pevent->OSEventType != OS_EVENT_TYPE_Q) {/* Validate event block type                          */
   \                     ??OSQAccept_2:
   \   00000038   0000D5E5           LDRB     R0,[R5, #+0]
   \   0000003C   020050E3           CMP      R0,#+2
   \   00000040   0300000A           BEQ      ??OSQAccept_3
     81                  *err = OS_ERR_EVENT_TYPE;
   \   00000044   0100A0E3           MOV      R0,#+1
   \   00000048   0000C4E5           STRB     R0,[R4, #+0]
     82                  return ((void *)0);
   \   0000004C   0000A0E3           MOV      R0,#+0
   \   00000050   1B0000EA           B        ??OSQAccept_1
     83              }
     84              OS_ENTER_CRITICAL();
   \                     ??OSQAccept_3:
   \   00000054   ........           _BLF     OS_CPU_SR_Save,??OS_CPU_SR_Save??rA
     85              pq = (OS_Q *)pevent->OSEventPtr;             /* Point at queue control block                       */
   \   00000058   041095E5           LDR      R1,[R5, #+4]
     86              if (pq->OSQEntries > 0) {                    /* See if any messages in the queue                   */
   \   0000005C   B621D1E1           LDRH     R2,[R1, #+22]
   \   00000060   010052E3           CMP      R2,#+1
   \   00000064   1100003A           BCC      ??OSQAccept_4
     87                  msg = *pq->OSQOut++;                     /* Yes, extract oldest message from the queue         */
   \   00000068   102091E5           LDR      R2,[R1, #+16]
   \   0000006C   043092E2           ADDS     R3,R2,#+4
   \   00000070   103081E5           STR      R3,[R1, #+16]
   \   00000074   005092E5           LDR      R5,[R2, #+0]
     88                  pq->OSQEntries--;                        /* Update the number of entries in the queue          */
   \   00000078   B621D1E1           LDRH     R2,[R1, #+22]
   \   0000007C   FF30A0E3           MOV      R3,#+255
   \   00000080   FF3C83E3           ORR      R3,R3,#0xFF00
   \   00000084   022093E0           ADDS     R2,R3,R2
   \   00000088   B621C1E1           STRH     R2,[R1, #+22]
     89                  if (pq->OSQOut == pq->OSQEnd) {          /* Wrap OUT pointer if we are at the end of the queue */
   \   0000008C   102091E5           LDR      R2,[R1, #+16]
   \   00000090   083091E5           LDR      R3,[R1, #+8]
   \   00000094   030052E1           CMP      R2,R3
   \   00000098   0100001A           BNE      ??OSQAccept_5
     90                      pq->OSQOut = pq->OSQStart;
   \   0000009C   042091E5           LDR      R2,[R1, #+4]
   \   000000A0   102081E5           STR      R2,[R1, #+16]
     91                  }
     92                  *err = OS_ERR_NONE;
   \                     ??OSQAccept_5:
   \   000000A4   0010A0E3           MOV      R1,#+0
   \   000000A8   0010C4E5           STRB     R1,[R4, #+0]
   \   000000AC   020000EA           B        ??OSQAccept_6
     93              } else {
     94                  *err = OS_ERR_Q_EMPTY;

⌨️ 快捷键说明

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