]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX200_RX231-RSK_GCC_e2studio_IAR/src/Full_Demo/RegTest_GCC.S
Update version number to 9.0.0rc2.
[freertos] / FreeRTOS / Demo / RX200_RX231-RSK_GCC_e2studio_IAR / src / Full_Demo / RegTest_GCC.S
1 ;/*\r
2 ;    FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
3 ;    All rights reserved\r
4 ;\r
5 ;    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 ;\r
7 ;    ***************************************************************************\r
8 ;     *                                                                       *\r
9 ;     *    FreeRTOS provides completely free yet professionally developed,    *\r
10 ;     *    robust, strictly quality controlled, supported, and cross          *\r
11 ;     *    platform software that has become a de facto standard.             *\r
12 ;     *                                                                       *\r
13 ;     *    Help yourself get started quickly and support the FreeRTOS         *\r
14 ;     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
15 ;     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
16 ;     *                                                                       *\r
17 ;     *    Thank you!                                                         *\r
18 ;     *                                                                       *\r
19 ;    ***************************************************************************\r
20 ;\r
21 ;    This file is part of the FreeRTOS distribution.\r
22 ;\r
23 ;    FreeRTOS is free software; you can redistribute it and/or modify it under\r
24 ;    the terms of the GNU General Public License (version 2) as published by the\r
25 ;    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
26 ;\r
27 ;    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
28 ;    >>! a combined work that includes FreeRTOS without being obliged to provide\r
29 ;    >>! the source code for proprietary components outside of the FreeRTOS\r
30 ;    >>! kernel.\r
31 ;\r
32 ;    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
33 ;    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
34 ;    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
35 ;    link: http://www.freertos.org/a00114.html\r
36 ;\r
37 ;    1 tab == 4 spaces!\r
38 ;\r
39 ;    ***************************************************************************\r
40 ;     *                                                                       *\r
41 ;     *    Having a problem?  Start by reading the FAQ "My application does   *\r
42 ;     *    not run, what could be wrong?"                                     *\r
43 ;     *                                                                       *\r
44 ;     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
45 ;     *                                                                       *\r
46 ;    ***************************************************************************\r
47 ;\r
48 ;    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
49 ;    license and Real Time Engineers Ltd. contact details.;\r
50 ;\r
51 ;    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
52 ;    including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
53 ;    compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
54 ;\r
55 ;    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
56 ;    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
57 ;    licenses offer ticketed support, indemnification and middleware.\r
58 ;\r
59 ;    http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
60 ;    engineered and independently SIL3 certified version for use in safety and\r
61 ;    mission critical applications that require provable dependability.\r
62 ;\r
63 ;    1 tab == 4 spaces!\r
64 ;*/\r
65 \r
66         .global _vRegTest1Implementation\r
67         .global _vRegTest2Implementation\r
68 \r
69         .extern _ulRegTest1LoopCounter\r
70         .extern _ulRegTest2LoopCounter\r
71 \r
72         .text\r
73 \r
74 \r
75 ;/* This function is explained in the comments at the top of main.c. */\r
76 _vRegTest1Implementation:\r
77 \r
78         ; Put a known value in each register.\r
79         MOV.L   #1, R1\r
80         MOV.L   #2, R2\r
81         MOV.L   #3, R3\r
82         MOV.L   #4, R4\r
83         MOV.L   #5, R5\r
84         MOV.L   #6, R6\r
85         MOV.L   #7, R7\r
86         MOV.L   #8, R8\r
87         MOV.L   #9, R9\r
88         MOV.L   #10, R10\r
89         MOV.L   #11, R11\r
90         MOV.L   #12, R12\r
91         MOV.L   #13, R13\r
92         MOV.L   #14, R14\r
93         MOV.L   #15, R15\r
94 \r
95         ; Loop, checking each iteration that each register still contains the\r
96         ; expected value.\r
97 TestLoop1:\r
98 \r
99         ; Push the registers that are going to get clobbered.\r
100         PUSHM   R14-R15\r
101 \r
102         ; Increment the loop counter to show this task is still getting CPU time.\r
103         MOV.L   #_ulRegTest1LoopCounter, R14\r
104         MOV.L   [ R14 ], R15\r
105         ADD             #1, R15\r
106         MOV.L   R15, [ R14 ]\r
107 \r
108         ; Yield to extend the text coverage.  Set the bit in the ITU SWINTR register.\r
109         MOV.L   #1, R14\r
110         MOV.L   #0872E0H, R15\r
111         MOV.B   R14, [R15]\r
112         NOP\r
113         NOP\r
114 \r
115         ; Restore the clobbered registers.\r
116         POPM    R14-R15\r
117 \r
118         ; Now compare each register to ensure it still contains the value that was\r
119         ; set before this loop was entered.\r
120         CMP             #1, R1\r
121         BNE             RegTest1Error\r
122         CMP             #2, R2\r
123         BNE             RegTest1Error\r
124         CMP             #3, R3\r
125         BNE             RegTest1Error\r
126         CMP             #4, R4\r
127         BNE             RegTest1Error\r
128         CMP             #5, R5\r
129         BNE             RegTest1Error\r
130         CMP             #6, R6\r
131         BNE             RegTest1Error\r
132         CMP             #7, R7\r
133         BNE             RegTest1Error\r
134         CMP             #8, R8\r
135         BNE             RegTest1Error\r
136         CMP             #9, R9\r
137         BNE             RegTest1Error\r
138         CMP             #10, R10\r
139         BNE             RegTest1Error\r
140         CMP             #11, R11\r
141         BNE             RegTest1Error\r
142         CMP             #12, R12\r
143         BNE             RegTest1Error\r
144         CMP             #13, R13\r
145         BNE             RegTest1Error\r
146         CMP             #14, R14\r
147         BNE             RegTest1Error\r
148         CMP             #15, R15\r
149         BNE             RegTest1Error\r
150 \r
151         ; All comparisons passed, start a new itteratio of this loop.\r
152         BRA             TestLoop1\r
153 \r
154 RegTest1Error:\r
155         ; A compare failed, just loop here so the loop counter stops incrementing\r
156         ; causing the check task to indicate the error.\r
157         BRA RegTest1Error\r
158 ;/*-----------------------------------------------------------*/\r
159 \r
160 ;/* This function is explained in the comments at the top of main.c. */\r
161 _vRegTest2Implementation:\r
162 \r
163         ; Put a known value in each register.\r
164         MOV.L   #10, R1\r
165         MOV.L   #20, R2\r
166         MOV.L   #30, R3\r
167         MOV.L   #40, R4\r
168         MOV.L   #50, R5\r
169         MOV.L   #60, R6\r
170         MOV.L   #70, R7\r
171         MOV.L   #80, R8\r
172         MOV.L   #90, R9\r
173         MOV.L   #100, R10\r
174         MOV.L   #110, R11\r
175         MOV.L   #120, R12\r
176         MOV.L   #130, R13\r
177         MOV.L   #140, R14\r
178         MOV.L   #150, R15\r
179 \r
180         ; Loop, checking on each iteration that each register still contains the\r
181         ; expected value.\r
182 TestLoop2:\r
183 \r
184         ; Push the registers that are going to get clobbered.\r
185         PUSHM   R14-R15\r
186 \r
187         ; Increment the loop counter to show this task is still getting CPU time.\r
188         MOV.L   #_ulRegTest2LoopCounter, R14\r
189         MOV.L   [ R14 ], R15\r
190         ADD             #1, R15\r
191         MOV.L   R15, [ R14 ]\r
192 \r
193         ; Restore the clobbered registers.\r
194         POPM    R14-R15\r
195 \r
196         CMP             #10, R1\r
197         BNE             RegTest2Error\r
198         CMP             #20, R2\r
199         BNE             RegTest2Error\r
200         CMP             #30, R3\r
201         BNE             RegTest2Error\r
202         CMP             #40, R4\r
203         BNE             RegTest2Error\r
204         CMP             #50, R5\r
205         BNE             RegTest2Error\r
206         CMP             #60, R6\r
207         BNE             RegTest2Error\r
208         CMP             #70, R7\r
209         BNE             RegTest2Error\r
210         CMP             #80, R8\r
211         BNE             RegTest2Error\r
212         CMP             #90, R9\r
213         BNE             RegTest2Error\r
214         CMP             #100, R10\r
215         BNE             RegTest2Error\r
216         CMP             #110, R11\r
217         BNE             RegTest2Error\r
218         CMP             #120, R12\r
219         BNE             RegTest2Error\r
220         CMP             #130, R13\r
221         BNE             RegTest2Error\r
222         CMP             #140, R14\r
223         BNE             RegTest2Error\r
224         CMP             #150, R15\r
225         BNE             RegTest2Error\r
226 \r
227         ; All comparisons passed, start a new itteratio of this loop.\r
228         BRA             TestLoop2\r
229 \r
230 RegTest2Error:\r
231         ; A compare failed, just loop here so the loop counter stops incrementing\r
232         ; - causing the check task to indicate the error.\r
233         BRA RegTest2Error\r
234         \r
235         .END\r