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

📄 blockq.lst

📁 本代码已经经过修改
💻 LST
📖 第 1 页 / 共 3 页
字号:
##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.30A/W32 KICKSTART     14/Dec/2005  14:41:41 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal #
#                       \BlockQ.c                                            #
#    Command line    =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal #
#                       \BlockQ.c -D _NDEBUG -D STR71X_IAR -lC               #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\List\ --diag_suppress pe191,pa082 -o        #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\Obj\ -s9 --no_clustering --cpu_mode thumb   #
#                       --endian little --cpu ARM7TDMI --stack_align 4       #
#                       --interwork -e --require_prototypes --fpu None       #
#                       --dlib_config "C:\Program Files\IAR                  #
#                       Systems\Embedded Workbench 4.0                       #
#                       Kickstart\arm\LIB\dl4tptinl8n.h" -I                  #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\ -I D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR #
#                       71x_IAR\library\include\ -I                          #
#                       D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\..\common\include\ -I D:\board\FreeRTOSV3.2.3\Free #
#                       RTOS\Demo\ARM7_STR71x_IAR\..\..\source\include\ -I   #
#                       "C:\Program Files\IAR Systems\Embedded Workbench     #
#                       4.0 Kickstart\arm\INC\"                              #
#    List file       =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\List\BlockQ.lst                             #
#    Object file     =  D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
#                       R\binary\Obj\BlockQ.r79                              #
#                                                                            #
#                                                                            #
##############################################################################

D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal\BlockQ.c
      1          /*
      2          	FreeRTOS V3.2.3 - Copyright (C) 2003-2005 Richard Barry.
      3          
      4          	This file is part of the FreeRTOS distribution.
      5          
      6          	FreeRTOS is free software; you can redistribute it and/or modify
      7          	it under the terms of the GNU General Public License as published by
      8          	the Free Software Foundation; either version 2 of the License, or
      9          	(at your option) any later version.
     10          
     11          	FreeRTOS is distributed in the hope that it will be useful,
     12          	but WITHOUT ANY WARRANTY; without even the implied warranty of
     13          	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     14          	GNU General Public License for more details.
     15          
     16          	You should have received a copy of the GNU General Public License
     17          	along with FreeRTOS; if not, write to the Free Software
     18          	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     19          
     20          	A special exception to the GPL can be applied should you wish to distribute
     21          	a combined work that includes FreeRTOS, without being obliged to provide
     22          	the source code for any proprietary components.  See the licensing section
     23          	of http://www.FreeRTOS.org for full details of how and when the exception
     24          	can be applied.
     25          
     26          	***************************************************************************
     27          	See http://www.FreeRTOS.org for documentation, latest information, license
     28          	and contact details.  Please ensure to read the configuration and relevant
     29          	port sections of the online documentation.
     30          	***************************************************************************
     31          */
     32          
     33          /*
     34           * Creates six tasks that operate on three queues as follows:
     35           *
     36           * The first two tasks send and receive an incrementing number to/from a queue.
     37           * One task acts as a producer and the other as the consumer.  The consumer is a
     38           * higher priority than the producer and is set to block on queue reads.  The queue
     39           * only has space for one item - as soon as the producer posts a message on the
     40           * queue the consumer will unblock, pre-empt the producer, and remove the item.
     41           *
     42           * The second two tasks work the other way around.  Again the queue used only has
     43           * enough space for one item.  This time the consumer has a lower priority than the
     44           * producer.  The producer will try to post on the queue blocking when the queue is
     45           * full.  When the consumer wakes it will remove the item from the queue, causing
     46           * the producer to unblock, pre-empt the consumer, and immediately re-fill the
     47           * queue.
     48           *
     49           * The last two tasks use the same queue producer and consumer functions.  This time the queue has
     50           * enough space for lots of items and the tasks operate at the same priority.  The
     51           * producer will execute, placing items into the queue.  The consumer will start
     52           * executing when either the queue becomes full (causing the producer to block) or
     53           * a context switch occurs (tasks of the same priority will time slice).
     54           *
     55           */
     56          
     57          
     58          
     59          #include <stdlib.h>
     60          
     61          /* Scheduler include files. */
     62          #include "FreeRTOS.h"
     63          #include "task.h"
     64          #include "queue.h"
     65          
     66          /* Demo program include files. */
     67          #include "BlockQ.h"
     68          
     69          #define blckqSTACK_SIZE		configMINIMAL_STACK_SIZE
     70          #define blckqNUM_TASK_SETS	( 3 )
     71          
     72          /* Structure used to pass parameters to the blocking queue tasks. */
     73          typedef struct BLOCKING_QUEUE_PARAMETERS
     74          {
     75          	xQueueHandle xQueue;					/*< The queue to be used by the task. */
     76          	portTickType xBlockTime;				/*< The block time to use on queue reads/writes. */
     77          	volatile portSHORT *psCheckVariable;	/*< Incremented on each successful cycle to check the task is still running. */
     78          } xBlockingQueueParameters;
     79          
     80          /* Task function that creates an incrementing number and posts it on a queue. */
     81          static portTASK_FUNCTION_PROTO( vBlockingQueueProducer, pvParameters );
     82          
     83          /* Task function that removes the incrementing number from a queue and checks that
     84          it is the expected number. */
     85          static portTASK_FUNCTION_PROTO( vBlockingQueueConsumer, pvParameters );
     86          
     87          /* Variables which are incremented each time an item is removed from a queue, and
     88          found to be the expected value.
     89          These are used to check that the tasks are still running. */

   \                                 In segment DATA_Z, align 4, align-sorted
     90          static volatile portSHORT sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
   \                     ??sBlockingConsumerCount:
   \   00000000                      DS8 8
     91          
     92          /* Variable which are incremented each time an item is posted on a queue.   These
     93          are used to check that the tasks are still running. */

   \                                 In segment DATA_Z, align 4, align-sorted
     94          static volatile portSHORT sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0, ( unsigned portSHORT ) 0 };
   \                     ??sBlockingProducerCount:
   \   00000000                      DS8 8
     95          
     96          /*-----------------------------------------------------------*/
     97          

   \                                 In segment CODE, align 4, keep-with-next
     98          void vStartBlockingQueueTasks( unsigned portBASE_TYPE uxPriority )
     99          {
   \                     vStartBlockingQueueTasks:
   \   00000000   F1B5               PUSH        {R0,R4-R7,LR}
    100          xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;
    101          xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;
    102          xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;
    103          const unsigned portBASE_TYPE uxQueueSize1 = 1, uxQueueSize5 = 5;
    104          const portTickType xBlockTime = ( portTickType ) 1000 / portTICK_RATE_MS;
    105          const portTickType xDontBlock = ( portTickType ) 0;
    106          
    107          	/* Create the first two tasks as described at the top of the file. */
    108          	
    109          	/* First create the structure used to pass parameters to the consumer tasks. */
    110          	pxQueueParameters1 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );
   \   00000002   0C20               MOV         R0,#+0xC
   \   00000004   ........           _BLF        pvPortMalloc,pvPortMalloc??rT
   \   00000008   061C               MOV         R6,R0
    111          
    112          	/* Create the queue used by the first two tasks to pass the incrementing number.
    113          	Pass a pointer to the queue in the parameter structure. */
    114          	pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
   \   0000000A   0221               MOV         R1,#+0x2
   \   0000000C   0120               MOV         R0,#+0x1
   \   0000000E   ........           _BLF        xQueueCreate,xQueueCreate??rT
   \   00000012   3060               STR         R0,[R6, #+0]
    115          
    116          	/* The consumer is created first so gets a block time as described above. */
    117          	pxQueueParameters1->xBlockTime = xBlockTime;
   \   00000014   FA24               MOV         R4,#+0xFA
   \   00000016   A400               LSL         R4,R4,#+0x2        ;; #+0x3E8
   \   00000018   7460               STR         R4,[R6, #+0x4]
   \   0000001A   ....               LDR         R0,??DataTable2    ;; ??sBlockingConsumerCount
   \   0000001C   B060               STR         R0,[R6, #+0x8]
    118          
    119          	/* Pass in the variable that this task is going to increment so we can check it
    120          	is still running. */
    121          	pxQueueParameters1->psCheckVariable = &( sBlockingConsumerCount[ 0 ] );
    122          		
    123          	/* Create the structure used to pass parameters to the producer task. */
    124          	pxQueueParameters2 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );
   \   0000001E   0C20               MOV         R0,#+0xC
   \   00000020   ........           _BLF        pvPortMalloc,pvPortMalloc??rT
   \   00000024   071C               MOV         R7,R0
    125          
    126          	/* Pass the queue to this task also, using the parameter structure. */
    127          	pxQueueParameters2->xQueue = pxQueueParameters1->xQueue;
   \   00000026   3068               LDR         R0,[R6, #+0]
   \   00000028   3860               STR         R0,[R7, #+0]
    128          
    129          	/* The producer is not going to block - as soon as it posts the consumer will
    130          	wake and remove the item so the producer should always have room to post. */
    131          	pxQueueParameters2->xBlockTime = xDontBlock;
   \   0000002A   0025               MOV         R5,#+0
   \   0000002C   7D60               STR         R5,[R7, #+0x4]
   \   0000002E   ....               LDR         R0,??DataTable3    ;; ??sBlockingProducerCount
   \   00000030   B860               STR         R0,[R7, #+0x8]
   \   00000032   0020               MOV         R0,#+0
   \   00000034   01B4               PUSH        {R0}
   \   00000036   0198               LDR         R0,[SP, #+0x4]
   \   00000038   01B4               PUSH        {R0}
   \   0000003A   331C               MOV         R3,R6
   \   0000003C   6422               MOV         R2,#+0x64
   \   0000003E   3149               LDR         R1,??vStartBlockingQueueTasks_0  ;; `?<Constant "QConsB1">`
   \   00000040   3148               LDR         R0,??vStartBlockingQueueTasks_0+0x4  ;; ??vBlockingQueueConsumer
    132          
    133          	/* Pass in the variable that this task is going to increment so we can check
    134          	it is still running. */
    135          	pxQueueParameters2->psCheckVariable = &( sBlockingProducerCount[ 0 ] );
    136          
    137          
    138          	/* Note the producer has a lower priority than the consumer when the tasks are
    139          	spawned. */
    140          	xTaskCreate( vBlockingQueueConsumer, "QConsB1", blckqSTACK_SIZE, ( void * ) pxQueueParameters1, uxPriority, NULL );
   \   00000042   ........           _BLF        xTaskCreate,xTaskCreate??rT
    141          	xTaskCreate( vBlockingQueueProducer, "QProdB2", blckqSTACK_SIZE, ( void * ) pxQueueParameters2, tskIDLE_PRIORITY, NULL );

⌨️ 快捷键说明

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