2 FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd.
\r
5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
\r
7 This file is part of the FreeRTOS distribution.
\r
9 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
10 the terms of the GNU General Public License (version 2) as published by the
\r
11 Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
\r
13 ***************************************************************************
\r
14 >>! NOTE: The modification to the GPL is included to allow you to !<<
\r
15 >>! distribute a combined work that includes FreeRTOS without being !<<
\r
16 >>! obliged to provide the source code for proprietary components !<<
\r
17 >>! outside of the FreeRTOS kernel. !<<
\r
18 ***************************************************************************
\r
20 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
\r
21 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
22 FOR A PARTICULAR PURPOSE. Full license text is available on the following
\r
23 link: http://www.freertos.org/a00114.html
\r
25 ***************************************************************************
\r
27 * FreeRTOS provides completely free yet professionally developed, *
\r
28 * robust, strictly quality controlled, supported, and cross *
\r
29 * platform software that is more than just the market leader, it *
\r
30 * is the industry's de facto standard. *
\r
32 * Help yourself get started quickly while simultaneously helping *
\r
33 * to support the FreeRTOS project by purchasing a FreeRTOS *
\r
34 * tutorial book, reference manual, or both: *
\r
35 * http://www.FreeRTOS.org/Documentation *
\r
37 ***************************************************************************
\r
39 http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
\r
40 the FAQ page "My application does not run, what could be wrong?". Have you
\r
41 defined configASSERT()?
\r
43 http://www.FreeRTOS.org/support - In return for receiving this top quality
\r
44 embedded software for free we request you assist our global community by
\r
45 participating in the support forum.
\r
47 http://www.FreeRTOS.org/training - Investing in training allows your team to
\r
48 be as productive as possible as early as possible. Now you can receive
\r
49 FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
\r
50 Ltd, and the world's leading authority on the world's leading RTOS.
\r
52 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
\r
53 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
\r
54 compatible FAT file system, and our tiny thread aware UDP/IP stack.
\r
56 http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
\r
57 Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
\r
59 http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
\r
60 Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
\r
61 licenses offer ticketed support, indemnification and commercial middleware.
\r
63 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
\r
64 engineered and independently SIL3 certified version for use in safety and
\r
65 mission critical applications that require provable dependability.
\r
72 * The register test task as described in the comments at the top of main-full.c.
\r
74 .global vRegTest1Implementation
\r
75 .global vRegTest2Implementation
\r
77 /* Variables that are incremented on each iteration of the reg test tasks -
\r
78 provided the tasks have not reported any errors. The check timer inspects these
\r
79 variables to ensure they are still incrementing as expected. If a variable
\r
80 stops incrementing then it is likely that its associate task has stalled or
\r
81 detected an error. */
\r
82 .extern ulRegTest1LoopCounter
\r
83 .extern ulRegTest2LoopCounter
\r
85 #warning Does not seem to test the floating point context register.
\r
86 /*-----------------------------------------------------------*/
\r
90 vRegTest1Implementation:
\r
91 /* First fill the relevant registers with known values. r0 is always 0, r1
\r
92 is the stack pointer, and r3 is a read only small data area pointer. */
\r
103 /* R13 = read write small data area anchour. */
\r
104 /* R14 = return address for interrupt. */
\r
105 /* R15 = return address for sub-routine. */
\r
106 /* R16 = return address for trap. */
\r
107 /* R17 = return address for exceptions. */
\r
108 /* R18 = reserved for assembler and compiler temporaries. */
\r
123 /* Now test the register values to ensure they contain the same value that
\r
124 was written to them above. This task will get preempted frequently so
\r
125 other tasks are likely to have executed since the register values were
\r
126 written. If any register contains an unexpected value then the task will
\r
127 branch to Error_Loop_1, which in turn prevents it from incrementing its
\r
128 loop counter, enabling the check timer to determine that all is not as it
\r
133 bnei r18, Error_Loop_1
\r
135 bnei r18, Error_Loop_1
\r
137 bnei r18, Error_Loop_1
\r
139 bnei r18, Error_Loop_1
\r
141 bnei r18, Error_Loop_1
\r
143 bnei r18, Error_Loop_1
\r
145 bnei r18, Error_Loop_1
\r
147 bnei r18, Error_Loop_1
\r
149 bnei r18, Error_Loop_1
\r
151 bnei r18, Error_Loop_1
\r
153 bnei r18, Error_Loop_1
\r
155 bnei r18, Error_Loop_1
\r
157 bnei r18, Error_Loop_1
\r
159 bnei r18, Error_Loop_1
\r
161 bnei r18, Error_Loop_1
\r
163 bnei r18, Error_Loop_1
\r
165 bnei r18, Error_Loop_1
\r
167 bnei r18, Error_Loop_1
\r
169 bnei r18, Error_Loop_1
\r
171 bnei r18, Error_Loop_1
\r
173 bnei r18, Error_Loop_1
\r
175 bnei r18, Error_Loop_1
\r
177 /* If this task has not branched to the error loop, then everything is ok,
\r
178 and the check variable can be incremented to indicate that this task
\r
179 is still running. Then, brach back to the top to check the register
\r
181 lwi r18, r0, ulRegTest1LoopCounter
\r
183 swi r18, r0, ulRegTest1LoopCounter
\r
187 /* The test function will branch here if it discovers an error. This part
\r
188 of the code just sits in a NULL loop, which prevents the check variable
\r
189 incrementing any further to allow the check timer to recognize that this
\r
190 test has failed. */
\r
195 /*-----------------------------------------------------------*/
\r
199 vRegTest2Implementation:
\r
200 /* First fill the relevant registers with known values. r0 is always 0, r1
\r
201 is the stack pointer, and r3 is a read only small data area pointer. */
\r
209 addi r10, r0, 100000
\r
210 addi r11, r0, 110000
\r
211 addi r12, r0, 120000
\r
212 /* R13 = read write small data area anchour. */
\r
213 /* R14 = return address for interrupt. */
\r
214 /* R15 = return address for sub-routine. */
\r
215 /* R16 = return address for trap. */
\r
216 /* R17 = return address for exceptions. */
\r
217 /* R18 = reserved for assembler and compiler temporaries. */
\r
218 addi r19, r0, 190000
\r
219 addi r20, r0, 200000
\r
220 addi r21, r0, 210000
\r
221 addi r22, r0, 220000
\r
222 addi r23, r0, 230000
\r
223 addi r24, r0, 240000
\r
224 addi r25, r0, 250000
\r
225 addi r26, r0, 260000
\r
226 addi r27, r0, 270000
\r
227 addi r28, r0, 280000
\r
228 addi r29, r0, 290000
\r
229 addi r30, r0, 300000
\r
230 addi r31, r0, 310000
\r
232 /* Now test the register values to ensure they contain the same value that
\r
233 was written to them above. This task will get preempted frequently so
\r
234 other tasks are likely to have executed since the register values were
\r
235 written. If any register contains an unexpected value then the task will
\r
236 branch to Error_Loop_2, which in turn prevents it from incrementing its
\r
237 loop counter, enabling the check timer to determine that all is not as it
\r
241 xori r18, r3, 30000
\r
242 bnei r18, Error_Loop_2
\r
243 xori r18, r4, 40000
\r
244 bnei r18, Error_Loop_2
\r
245 xori r18, r6, 60000
\r
246 bnei r18, Error_Loop_2
\r
247 xori r18, r7, 70000
\r
248 bnei r18, Error_Loop_2
\r
249 xori r18, r8, 80000
\r
250 bnei r18, Error_Loop_2
\r
251 xori r18, r9, 90000
\r
252 bnei r18, Error_Loop_2
\r
253 xori r18, r10, 100000
\r
254 bnei r18, Error_Loop_2
\r
255 xori r18, r11, 110000
\r
256 bnei r18, Error_Loop_2
\r
257 xori r18, r12, 120000
\r
258 bnei r18, Error_Loop_2
\r
259 xori r18, r19, 190000
\r
260 bnei r18, Error_Loop_2
\r
261 xori r18, r20, 200000
\r
262 bnei r18, Error_Loop_2
\r
263 xori r18, r21, 210000
\r
264 bnei r18, Error_Loop_2
\r
265 xori r18, r22, 220000
\r
266 bnei r18, Error_Loop_2
\r
267 xori r18, r23, 230000
\r
268 bnei r18, Error_Loop_2
\r
269 xori r18, r24, 240000
\r
270 bnei r18, Error_Loop_2
\r
271 xori r18, r25, 250000
\r
272 bnei r18, Error_Loop_2
\r
273 xori r18, r26, 260000
\r
274 bnei r18, Error_Loop_2
\r
275 xori r18, r27, 270000
\r
276 bnei r18, Error_Loop_2
\r
277 xori r18, r28, 280000
\r
278 bnei r18, Error_Loop_2
\r
279 xori r18, r29, 290000
\r
280 bnei r18, Error_Loop_2
\r
281 xori r18, r30, 300000
\r
282 bnei r18, Error_Loop_2
\r
283 xori r18, r31, 310000
\r
284 bnei r18, Error_Loop_2
\r
286 /* If this task has not branched to the error loop, then everything is ok,
\r
287 and the check variable can be incremented to indicate that this task
\r
288 is still running. Then, brach back to the top to check the register
\r
290 lwi r18, r0, ulRegTest2LoopCounter
\r
292 swi r18, r0, ulRegTest2LoopCounter
\r
296 /* The test function will branch here if it discovers an error. This part
\r
297 of the code just sits in a NULL loop, which prevents the check variable
\r
298 incrementing any further to allow the check timer to recognize that this
\r
299 test has failed. */
\r