]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX600_RX64M_RSK_GCC_e2studio/src/RegTest.S
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Demo / RX600_RX64M_RSK_GCC_e2studio / src / RegTest.S
1 ;/*\r
2 ;    FreeRTOS V8.1.2 - Copyright (C) 2014 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 the guard byte of the accumulators. */\r
79         MOV.L   #10, R1\r
80         MVTACGU R1, A0\r
81         MOV.L   #20, R1\r
82         MVTACGU R1, A1\r
83 \r
84         ;/* Put a known value in each register. */\r
85         MOV.L   #1, R1\r
86         MOV.L   #2, R2\r
87         MOV.L   #3, R3\r
88         MOV.L   #4, R4\r
89         MOV.L   #5, R5\r
90         MOV.L   #6, R6\r
91         MOV.L   #7, R7\r
92         MOV.L   #8, R8\r
93         MOV.L   #9, R9\r
94         MOV.L   #10, R10\r
95         MOV.L   #11, R11\r
96         MOV.L   #12, R12\r
97         MOV.L   #13, R13\r
98         MOV.L   #14, R14\r
99         MOV.L   #15, R15\r
100         \r
101         ;/* Put a known value in the hi and low of the accumulators. */\r
102         MVTACHI R1, A0\r
103         MVTACLO R2, A0\r
104         MVTACHI R3, A1\r
105         MVTACLO R4, A1\r
106 \r
107         ;/* Loop, checking each itteration that each register still contains the\r
108         ;expected value. */\r
109 TestLoop1:                                                              \r
110 \r
111         ;/* Push the registers that are going to get clobbered. */\r
112         PUSHM   R14-R15                                         \r
113         \r
114         ;/* Increment the loop counter to show this task is still getting CPU time. */\r
115         MOV.L   #_ulRegTest1LoopCounter, R14\r
116         MOV.L   [ R14 ], R15\r
117         ADD     #1, R15                                         \r
118         MOV.L   R15, [ R14 ]\r
119         \r
120         ;/* Yield to extend the text coverage.  Set the bit in the ITU SWINTR register. */\r
121         MOV.L   #1, R14\r
122         MOV.L   #0872E0H, R15\r
123         MOV.B   R14, [R15]\r
124         NOP                                                             \r
125         NOP                                                             \r
126         \r
127         ;/* Check accumulators. */\r
128         MVFACHI #0, A0, R15\r
129         CMP #1, R15\r
130         BNE RegTest1Error\r
131         MVFACLO #0, A0, R15\r
132         CMP #2, R15\r
133         BNE RegTest1Error\r
134         MVFACGU #0, A0, R15\r
135         CMP #10, R15\r
136         BNE RegTest1Error\r
137         MVFACHI #0, A1, R15\r
138         CMP #3, R15\r
139         BNE RegTest1Error\r
140         MVFACLO #0, A1, R15\r
141         CMP #4, R15\r
142         BNE RegTest1Error\r
143         MVFACGU #0, A1, R15\r
144         CMP #20, R15\r
145         BNE RegTest1Error\r
146 \r
147         ;/* Restore the clobbered registers. */\r
148         POPM    R14-R15                                         \r
149         \r
150         ;/* Now compare each register to ensure it still contains the value that was\r
151         ;set before this loop was entered. */\r
152         CMP     #1, R1                                          \r
153         BNE     RegTest1Error                           \r
154         CMP     #2, R2                                          \r
155         BNE     RegTest1Error                           \r
156         CMP     #3, R3                                          \r
157         BNE     RegTest1Error                           \r
158         CMP     #4, R4                                          \r
159         BNE     RegTest1Error                           \r
160         CMP     #5, R5                                          \r
161         BNE     RegTest1Error                           \r
162         CMP     #6, R6                                          \r
163         BNE     RegTest1Error                           \r
164         CMP     #7, R7                                          \r
165         BNE     RegTest1Error                           \r
166         CMP     #8, R8                                          \r
167         BNE     RegTest1Error                           \r
168         CMP     #9, R9                                          \r
169         BNE     RegTest1Error                           \r
170         CMP     #10, R10                                        \r
171         BNE     RegTest1Error                           \r
172         CMP     #11, R11                                        \r
173         BNE     RegTest1Error                           \r
174         CMP     #12, R12                                        \r
175         BNE     RegTest1Error                           \r
176         CMP     #13, R13                                        \r
177         BNE     RegTest1Error                           \r
178         CMP     #14, R14                                        \r
179         BNE     RegTest1Error                           \r
180         CMP     #15, R15                                        \r
181         BNE     RegTest1Error                           \r
182 \r
183         ;/* All comparisons passed, start a new itteratio of this loop. */\r
184         BRA             TestLoop1                               \r
185         \r
186 RegTest1Error:                                                  \r
187         ;/* A compare failed, just loop here so the loop counter stops incrementing\r
188         ;- causing the check task to indicate the error. */\r
189         BRA RegTest1Error                                       \r
190 ;/*-----------------------------------------------------------*/\r
191 \r
192 ;/* This function is explained in the comments at the top of main.c. */\r
193 _vRegTest2Implementation:\r
194 \r
195         ;/* Put a known value in the guard byte of the accumulators. */\r
196         MOV.L   #1H, R1\r
197         MVTACGU R1, A0\r
198         MOV.L   #2H, R1\r
199         MVTACGU R1, A1\r
200 \r
201         ;/* Put a known value in each general purpose register. */\r
202         MOV.L   #10H, R1\r
203         MOV.L   #20H, R2\r
204         MOV.L   #30H, R3\r
205         MOV.L   #40H, R4\r
206         MOV.L   #50H, R5\r
207         MOV.L   #60H, R6\r
208         MOV.L   #70H, R7\r
209         MOV.L   #80H, R8\r
210         MOV.L   #90H, R9\r
211         MOV.L   #100H, R10\r
212         MOV.L   #110H, R11\r
213         MOV.L   #120H, R12\r
214         MOV.L   #130H, R13\r
215         MOV.L   #140H, R14\r
216         MOV.L   #150H, R15\r
217 \r
218         ;/* Put a known value in the hi and low of the accumulators. */\r
219         MVTACHI R1, A0\r
220         MVTACLO R2, A0\r
221         MVTACHI R3, A1\r
222         MVTACLO R4, A1\r
223 \r
224         ;/* Loop, checking each itteration that each register still contains the\r
225         ;expected value. */\r
226 TestLoop2:                                                              \r
227 \r
228         ;/* Push the registers that are going to get clobbered. */\r
229         PUSHM   R14-R15                                         \r
230         \r
231         ;/* Increment the loop counter to show this task is still getting CPU time. */\r
232         MOV.L   #_ulRegTest2LoopCounter, R14\r
233         MOV.L   [ R14 ], R15\r
234         ADD     #1, R15                                         \r
235         MOV.L   R15, [ R14 ]\r
236         \r
237         ;/* Check accumulators. */\r
238         MVFACHI #0, A0, R15\r
239         CMP #10H, R15\r
240         BNE RegTest1Error\r
241         MVFACLO #0, A0, R15\r
242         CMP #20H, R15\r
243         BNE RegTest1Error\r
244         MVFACGU #0, A0, R15\r
245         CMP #1H, R15\r
246         BNE RegTest1Error\r
247         MVFACHI #0, A1, R15\r
248         CMP #30H, R15\r
249         BNE RegTest1Error\r
250         MVFACLO #0, A1, R15\r
251         CMP #40H, R15\r
252         BNE RegTest1Error\r
253         MVFACGU #0, A1, R15\r
254         CMP #2H, R15\r
255         BNE RegTest1Error\r
256 \r
257         ;/* Restore the clobbered registers. */\r
258         POPM    R14-R15                                         \r
259         \r
260         ;/* Now compare each register to ensure it still contains the value that was\r
261         ;set before this loop was entered. */\r
262         CMP     #10H, R1                                        \r
263         BNE     RegTest2Error                           \r
264         CMP     #20H, R2                                        \r
265         BNE     RegTest2Error                           \r
266         CMP     #30H, R3                                        \r
267         BNE     RegTest2Error                           \r
268         CMP     #40H, R4                                        \r
269         BNE     RegTest2Error                           \r
270         CMP     #50H, R5                                        \r
271         BNE     RegTest2Error                           \r
272         CMP     #60H, R6                                        \r
273         BNE     RegTest2Error                           \r
274         CMP     #70H, R7                                        \r
275         BNE     RegTest2Error                           \r
276         CMP     #80H, R8                                        \r
277         BNE     RegTest2Error                           \r
278         CMP     #90H, R9                                        \r
279         BNE     RegTest2Error                           \r
280         CMP     #100H, R10                                      \r
281         BNE     RegTest2Error                           \r
282         CMP     #110H, R11                                      \r
283         BNE     RegTest2Error                           \r
284         CMP     #120H, R12                                      \r
285         BNE     RegTest2Error                           \r
286         CMP     #130H, R13                                      \r
287         BNE     RegTest2Error                           \r
288         CMP     #140H, R14                                      \r
289         BNE     RegTest2Error                           \r
290         CMP     #150H, R15                                      \r
291         BNE     RegTest2Error                           \r
292 \r
293         ;/* All comparisons passed, start a new itteratio of this loop. */\r
294         BRA     TestLoop2                                       \r
295         \r
296 RegTest2Error:                                                  \r
297         ;/* A compare failed, just loop here so the loop counter stops incrementing\r
298         ;- causing the check task to indicate the error. */\r
299         BRA RegTest2Error                                       \r
300 \r
301         \r
302         .END\r