📄 pollq.lst
字号:
##############################################################################
# #
# IAR ARM ANSI C/C++ Compiler V4.30A/W32 KICKSTART 14/Dec/2005 14:41:42 #
# 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 #
# \PollQ.c #
# Command line = D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal #
# \PollQ.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\PollQ.lst #
# Object file = D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\ARM7_STR71x_IA #
# R\binary\Obj\PollQ.r79 #
# #
# #
##############################################################################
D:\board\FreeRTOSV3.2.3\FreeRTOS\Demo\Common\Minimal\PollQ.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 * This version of PollQ. c is for use on systems that have limited stack
35 * space and no display facilities. The complete version can be found in
36 * the Demo/Common/Full directory.
37 *
38 * Creates two tasks that communicate over a single queue. One task acts as a
39 * producer, the other a consumer.
40 *
41 * The producer loops for three iteration, posting an incrementing number onto the
42 * queue each cycle. It then delays for a fixed period before doing exactly the
43 * same again.
44 *
45 * The consumer loops emptying the queue. Each item removed from the queue is
46 * checked to ensure it contains the expected value. When the queue is empty it
47 * blocks for a fixed period, then does the same again.
48 *
49 * All queue access is performed without blocking. The consumer completely empties
50 * the queue each time it runs so the producer should never find the queue full.
51 *
52 * An error is flagged if the consumer obtains an unexpected value or the producer
53 * find the queue is full.
54 */
55
56 /*
57 Changes from V2.0.0
58
59 + Delay periods are now specified using variables and constants of
60 portTickType rather than unsigned portLONG.
61 */
62
63 #include <stdlib.h>
64
65 /* Scheduler include files. */
66 #include "FreeRTOS.h"
67 #include "task.h"
68 #include "queue.h"
69
70 /* Demo program include files. */
71 #include "PollQ.h"
72
73 #define pollqSTACK_SIZE configMINIMAL_STACK_SIZE
74 #define pollqQUEUE_SIZE ( 10 )
75 #define pollqDELAY ( ( portTickType ) 200 / portTICK_RATE_MS )
76 #define pollqNO_DELAY ( ( portTickType ) 0 )
77 #define pollqVALUES_TO_PRODUCE ( ( signed portBASE_TYPE ) 3 )
78 #define pollqINITIAL_VALUE ( ( signed portBASE_TYPE ) 0 )
79
80 /* The task that posts the incrementing number onto the queue. */
81 static portTASK_FUNCTION_PROTO( vPolledQueueProducer, pvParameters );
82
83 /* The task that empties the queue. */
84 static portTASK_FUNCTION_PROTO( vPolledQueueConsumer, pvParameters );
85
86 /* Variables that are used to check that the tasks are still running with no
87 errors. */
\ In segment DATA_Z, align 4, align-sorted
88 static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;
\ ??xPollingConsumerCount:
\ 00000000 DS8 4
\ In segment DATA_Z, align 4, align-sorted
\ ??xPollingProducerCount:
\ 00000000 DS8 4
89
90 /*-----------------------------------------------------------*/
91
\ In segment CODE, align 4, keep-with-next
92 void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
93 {
\ vStartPolledQueueTasks:
\ 00000000 30B5 PUSH {R4,R5,LR}
\ 00000002 041C MOV R4,R0
94 static xQueueHandle xPolledQueue;
95
96 /* Create the queue used by the producer and consumer. */
97 xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned portSHORT ) );
\ 00000004 0D4D LDR R5,??vStartPolledQueueTasks_0 ;; ??xPolledQueue
\ 00000006 0221 MOV R1,#+0x2
\ 00000008 0A20 MOV R0,#+0xA
\ 0000000A ........ _BLF xQueueCreate,xQueueCreate??rT
\ 0000000E 2860 STR R0,[R5, #+0]
98
99 /* Spawn the producer and consumer. */
100 xTaskCreate( vPolledQueueConsumer, ( const signed portCHAR * const ) "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
\ 00000010 0021 MOV R1,#+0
\ 00000012 201C MOV R0,R4
\ 00000014 03B4 PUSH {R0,R1}
\ 00000016 2B1C MOV R3,R5
\ 00000018 6422 MOV R2,#+0x64
\ 0000001A 0949 LDR R1,??vStartPolledQueueTasks_0+0x4 ;; `?<Constant "QConsNB">`
\ 0000001C 0948 LDR R0,??vStartPolledQueueTasks_0+0x8 ;; ??vPolledQueueConsumer
\ 0000001E ........ _BLF xTaskCreate,xTaskCreate??rT
101 xTaskCreate( vPolledQueueProducer, ( const signed portCHAR * const ) "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
\ 00000022 0020 MOV R0,#+0
\ 00000024 01B4 PUSH {R0}
\ 00000026 10B4 PUSH {R4}
\ 00000028 2B1C MOV R3,R5
\ 0000002A 6422 MOV R2,#+0x64
\ 0000002C 0649 LDR R1,??vStartPolledQueueTasks_0+0xC ;; `?<Constant "QProdNB">`
\ 0000002E 0748 LDR R0,??vStartPolledQueueTasks_0+0x10 ;; ??vPolledQueueProducer
\ 00000030 ........ _BLF xTaskCreate,xTaskCreate??rT
102 }
\ 00000034 04B0 ADD SP,#+0x10
\ 00000036 30BC POP {R4,R5}
\ 00000038 01BC POP {R0}
\ 0000003A 0047 BX R0 ;; return
\ ??vStartPolledQueueTasks_0:
\ 0000003C ........ DC32 ??xPolledQueue
\ 00000040 ........ DC32 `?<Constant "QConsNB">`
\ 00000044 ........ DC32 ??vPolledQueueConsumer
\ 00000048 ........ DC32 `?<Constant "QProdNB">`
\ 0000004C ........ DC32 ??vPolledQueueProducer
\ In segment DATA_Z, align 4, align-sorted
\ ??xPolledQueue:
\ 00000000 DS8 4
103 /*-----------------------------------------------------------*/
104
\ In segment CODE, align 4, keep-with-next
105 static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )
106 {
\ ??vPolledQueueProducer:
\ 00000000 B0B5 PUSH {R4,R5,R7,LR}
\ 00000002 81B0 SUB SP,#+0x4
\ 00000004 041C MOV R4,R0
107 unsigned portSHORT usValue = ( unsigned portSHORT ) 0;
\ 00000006 6846 MOV R0,SP
\ 00000008 0021 MOV R1,#+0
\ 0000000A 0180 STRH R1,[R0, #+0]
108 signed portBASE_TYPE xError = pdFALSE, xLoop;
\ 0000000C 0025 MOV R5,#+0
\ 0000000E 13E0 B ??vPolledQueueProducer_1
109
110 for( ;; )
111 {
112 for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ )
113 {
114 /* Send an incrementing number on the queue without blocking. */
115 if( xQueueSend( *( ( xQueueHandle * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )
116 {
117 /* We should never find the queue full so if we get here there
118 has been an error. */
119 xError = pdTRUE;
120 }
121 else
122 {
123 if( xError == pdFALSE )
\ ??vPolledQueueProducer_2:
\ 00000010 002D CMP R5,#+0
\ 00000012 07D1 BNE ??vPolledQueueProducer_3
124 {
125 /* If an error has ever been recorded we stop incrementing the
126 check variable. */
127 portENTER_CRITICAL();
\ 00000014 ........ _BLF vPortEnterCritical,vPortEnterCritical??rT
128 xPollingProducerCount++;
\ 00000018 .... LDR R0,??DataTable2 ;; ??xPollingProducerCount
\ 0000001A 0168 LDR R1,[R0, #+0]
\ 0000001C 491C ADD R1,R1,#+0x1
\ 0000001E 0160 STR R1,[R0, #+0]
129 portEXIT_CRITICAL();
\ 00000020 ........ _BLF vPortExitCritical,vPortExitCritical??rT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -