2 FreeRTOS V9.0.0rc2 - Copyright (C) 2016 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 /*-----------------------------------------------------------*/
\r
89 vRegTest1Implementation:
\r
90 /* First fill the relevant registers with known values. r0 is always 0, r1
\r
91 is the stack pointer, and r3 is a read only small data area pointer. */
\r
102 /* R13 = read write small data area anchour. */
\r
103 /* R14 = return address for interrupt. */
\r
104 /* R15 = return address for sub-routine. */
\r
105 /* R16 = return address for trap. */
\r
106 /* R17 = return address for exceptions. */
\r
107 /* R18 = reserved for assembler and compiler temporaries. */
\r
122 /* Now test the register values to ensure they contain the same value that
\r
123 was written to them above. This task will get preempted frequently so
\r
124 other tasks are likely to have executed since the register values were
\r
125 written. If any register contains an unexpected value then the task will
\r
126 branch to Error_Loop_1, which in turn prevents it from incrementing its
\r
127 loop counter, enabling the check timer to determine that all is not as it
\r
132 bnei r18, Error_Loop_1
\r
134 bnei r18, Error_Loop_1
\r
136 bnei r18, Error_Loop_1
\r
138 bnei r18, Error_Loop_1
\r
140 bnei r18, Error_Loop_1
\r
142 bnei r18, Error_Loop_1
\r
144 bnei r18, Error_Loop_1
\r
146 bnei r18, Error_Loop_1
\r
148 bnei r18, Error_Loop_1
\r
150 bnei r18, Error_Loop_1
\r
152 bnei r18, Error_Loop_1
\r
154 bnei r18, Error_Loop_1
\r
156 bnei r18, Error_Loop_1
\r
158 bnei r18, Error_Loop_1
\r
160 bnei r18, Error_Loop_1
\r
162 bnei r18, Error_Loop_1
\r
164 bnei r18, Error_Loop_1
\r
166 bnei r18, Error_Loop_1
\r
168 bnei r18, Error_Loop_1
\r
170 bnei r18, Error_Loop_1
\r
172 bnei r18, Error_Loop_1
\r
174 bnei r18, Error_Loop_1
\r
176 /* If this task has not branched to the error loop, then everything is ok,
\r
177 and the check variable can be incremented to indicate that this task
\r
178 is still running. Then, brach back to the top to check the register
\r
180 lwi r18, r0, ulRegTest1LoopCounter
\r
182 swi r18, r0, ulRegTest1LoopCounter
\r
186 /* The test function will branch here if it discovers an error. This part
\r
187 of the code just sits in a NULL loop, which prevents the check variable
\r
188 incrementing any further to allow the check timer to recognize that this
\r
189 test has failed. */
\r
194 /*-----------------------------------------------------------*/
\r
198 vRegTest2Implementation:
\r
199 /* First fill the relevant registers with known values. r0 is always 0, r1
\r
200 is the stack pointer, and r3 is a read only small data area pointer. */
\r
208 addi r10, r0, 100000
\r
209 addi r11, r0, 110000
\r
210 addi r12, r0, 120000
\r
211 /* R13 = read write small data area anchour. */
\r
212 /* R14 = return address for interrupt. */
\r
213 /* R15 = return address for sub-routine. */
\r
214 /* R16 = return address for trap. */
\r
215 /* R17 = return address for exceptions. */
\r
216 /* R18 = reserved for assembler and compiler temporaries. */
\r
217 addi r19, r0, 190000
\r
218 addi r20, r0, 200000
\r
219 addi r21, r0, 210000
\r
220 addi r22, r0, 220000
\r
221 addi r23, r0, 230000
\r
222 addi r24, r0, 240000
\r
223 addi r25, r0, 250000
\r
224 addi r26, r0, 260000
\r
225 addi r27, r0, 270000
\r
226 addi r28, r0, 280000
\r
227 addi r29, r0, 290000
\r
228 addi r30, r0, 300000
\r
229 addi r31, r0, 310000
\r
231 /* Now test the register values to ensure they contain the same value that
\r
232 was written to them above. This task will get preempted frequently so
\r
233 other tasks are likely to have executed since the register values were
\r
234 written. If any register contains an unexpected value then the task will
\r
235 branch to Error_Loop_2, which in turn prevents it from incrementing its
\r
236 loop counter, enabling the check timer to determine that all is not as it
\r
240 xori r18, r3, 30000
\r
241 bnei r18, Error_Loop_2
\r
242 xori r18, r4, 40000
\r
243 bnei r18, Error_Loop_2
\r
244 xori r18, r6, 60000
\r
245 bnei r18, Error_Loop_2
\r
246 xori r18, r7, 70000
\r
247 bnei r18, Error_Loop_2
\r
248 xori r18, r8, 80000
\r
249 bnei r18, Error_Loop_2
\r
250 xori r18, r9, 90000
\r
251 bnei r18, Error_Loop_2
\r
252 xori r18, r10, 100000
\r
253 bnei r18, Error_Loop_2
\r
254 xori r18, r11, 110000
\r
255 bnei r18, Error_Loop_2
\r
256 xori r18, r12, 120000
\r
257 bnei r18, Error_Loop_2
\r
258 xori r18, r19, 190000
\r
259 bnei r18, Error_Loop_2
\r
260 xori r18, r20, 200000
\r
261 bnei r18, Error_Loop_2
\r
262 xori r18, r21, 210000
\r
263 bnei r18, Error_Loop_2
\r
264 xori r18, r22, 220000
\r
265 bnei r18, Error_Loop_2
\r
266 xori r18, r23, 230000
\r
267 bnei r18, Error_Loop_2
\r
268 xori r18, r24, 240000
\r
269 bnei r18, Error_Loop_2
\r
270 xori r18, r25, 250000
\r
271 bnei r18, Error_Loop_2
\r
272 xori r18, r26, 260000
\r
273 bnei r18, Error_Loop_2
\r
274 xori r18, r27, 270000
\r
275 bnei r18, Error_Loop_2
\r
276 xori r18, r28, 280000
\r
277 bnei r18, Error_Loop_2
\r
278 xori r18, r29, 290000
\r
279 bnei r18, Error_Loop_2
\r
280 xori r18, r30, 300000
\r
281 bnei r18, Error_Loop_2
\r
282 xori r18, r31, 310000
\r
283 bnei r18, Error_Loop_2
\r
285 /* If this task has not branched to the error loop, then everything is ok,
\r
286 and the check variable can be incremented to indicate that this task
\r
287 is still running. Then, brach back to the top to check the register
\r
289 lwi r18, r0, ulRegTest2LoopCounter
\r
291 swi r18, r0, ulRegTest2LoopCounter
\r
295 /* The test function will branch here if it discovers an error. This part
\r
296 of the code just sits in a NULL loop, which prevents the check variable
\r
297 incrementing any further to allow the check timer to recognize that this
\r
298 test has failed. */
\r