2 FreeRTOS V8.2.3 - 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 #include <sys/asm.h>
\r
73 #include "FreeRTOSConfig.h"
\r
82 /************************************************************************/
\r
83 /* Reg test macro helper. Test a register for a known value branching to
\r
84 error_loop if not correct otherwise continuing on */
\r
85 .macro portREG_TEST work_reg, test_reg, test_value
\r
87 /* Check each register maintains the value assigned to it for the lifetime
\r
89 addiu \work_reg, $0, 0x00
\r
90 addiu \work_reg, \test_reg, -\test_value
\r
91 beq \work_reg, $0, 1f
\r
93 /* The register value was not that expected. Jump to the error loop so the
\r
94 cycle counter stops incrementing. */
\r
100 /************************************************************************/
\r
101 /* FPU reg test macro helper, Test an FPU register for a known value branching to
\r
102 error_loop if not correct otherwise continuing on */
\r
103 #if ( __mips_hard_float == 1) && ( configUSE_TASK_FPU_SUPPORT == 1 )
\r
104 .macro portFPU_REG_TEST work_reg, test_reg, test_value
\r
105 /* get the lower 32 bit value from the FPU and compare to the test value */
\r
106 mfc1 \work_reg, \test_reg
\r
107 addiu \work_reg, \work_reg, -\test_value
\r
108 beq \work_reg, $0, 1f
\r
111 /* The register values was not that expected. Jump to the error loop */
\r
119 /************************************************************************/
\r
124 /* Reg test tasks call the error loop when they find an error. Sitting in the
\r
125 tight error loop prevents them incrementing their ulRegTestnCycles counter, and
\r
126 so allows the check softwate timer to know an error has been found. */
\r
139 /* Fill the registers with known values. */
\r
143 /* $4 contains the address of the loop counter - don't mess with $4. */
\r
149 addiu $10, $0, 0x110
\r
150 addiu $11, $0, 0x111
\r
151 addiu $12, $0, 0x112
\r
152 addiu $13, $0, 0x113
\r
153 addiu $14, $0, 0x114
\r
154 addiu $15, $0, 0x115
\r
155 addiu $16, $0, 0x116
\r
156 addiu $17, $0, 0x117
\r
157 addiu $18, $0, 0x118
\r
158 addiu $19, $0, 0x119
\r
159 addiu $20, $0, 0x120
\r
160 addiu $21, $0, 0x121
\r
161 addiu $23, $0, 0x123
\r
162 addiu $24, $0, 0x124
\r
163 addiu $25, $0, 0x125
\r
164 addiu $30, $0, 0x130
\r
165 addiu $22, $0, 0x131
\r
167 addiu $22, $0, 0x132
\r
169 addiu $22, $0, 0x133
\r
171 addiu $22, $0, 0x134
\r
173 addiu $22, $0, 0x135
\r
175 addiu $22, $0, 0x136
\r
178 /* Test the FPU registers if they are present on the part. */
\r
179 #if ( __mips_hard_float == 1 ) && ( configUSE_TASK_FPU_SUPPORT == 1 )
\r
180 addiu $22, $0, 0x180
\r
182 addiu $22, $0, 0x181
\r
184 addiu $22, $0, 0x182
\r
186 addiu $22, $0, 0x183
\r
188 addiu $22, $0, 0x184
\r
190 addiu $22, $0, 0x185
\r
192 addiu $22, $0, 0x186
\r
194 addiu $22, $0, 0x187
\r
196 addiu $22, $0, 0x188
\r
198 addiu $22, $0, 0x189
\r
200 addiu $22, $0, 0x18A
\r
202 addiu $22, $0, 0x18B
\r
204 addiu $22, $0, 0x18C
\r
206 addiu $22, $0, 0x18D
\r
208 addiu $22, $0, 0x18E
\r
210 addiu $22, $0, 0x18F
\r
212 addiu $22, $0, 0x190
\r
214 addiu $22, $0, 0x191
\r
216 addiu $22, $0, 0x192
\r
218 addiu $22, $0, 0x193
\r
220 addiu $22, $0, 0x194
\r
222 addiu $22, $0, 0x195
\r
224 addiu $22, $0, 0x196
\r
226 addiu $22, $0, 0x197
\r
228 addiu $22, $0, 0x198
\r
230 addiu $22, $0, 0x199
\r
232 addiu $22, $0, 0x19A
\r
234 addiu $22, $0, 0x19B
\r
236 addiu $22, $0, 0x19C
\r
238 addiu $22, $0, 0x19D
\r
240 addiu $22, $0, 0x19E
\r
242 addiu $22, $0, 0x19F
\r
247 portREG_TEST $22, $1, 0x11
\r
248 portREG_TEST $22, $2, 0x12
\r
249 portREG_TEST $22, $3, 0x13
\r
250 /* Do not test r4 as we are using it as a loop counter */
\r
251 portREG_TEST $22, $5, 0x15
\r
252 portREG_TEST $22, $6, 0x16
\r
253 portREG_TEST $22, $7, 0x17
\r
254 portREG_TEST $22, $8, 0x18
\r
255 portREG_TEST $22, $9, 0x19
\r
256 portREG_TEST $22, $10, 0x110
\r
257 portREG_TEST $22, $11, 0x111
\r
258 portREG_TEST $22, $12, 0x112
\r
259 portREG_TEST $22, $13, 0x113
\r
260 portREG_TEST $22, $14, 0x114
\r
261 portREG_TEST $22, $15, 0x115
\r
262 portREG_TEST $22, $16, 0x116
\r
263 portREG_TEST $22, $17, 0x117
\r
264 portREG_TEST $22, $18, 0x118
\r
265 portREG_TEST $22, $19, 0x119
\r
266 portREG_TEST $22, $20, 0x120
\r
267 portREG_TEST $22, $21, 0x121
\r
268 /* Do not test r22, used as a helper */
\r
269 portREG_TEST $22, $23, 0x123
\r
270 portREG_TEST $22, $24, 0x124
\r
271 portREG_TEST $22, $25, 0x125
\r
272 portREG_TEST $22, $30, 0x130
\r
275 addiu $22, $22, -0x131
\r
282 addiu $22, $22, -0x132
\r
289 addiu $22, $22, -0x133
\r
296 addiu $22, $22, -0x134
\r
303 addiu $22, $22, -0x135
\r
310 addiu $22, $22, -0x136
\r
316 /* Test the FPU registers if they are present on the part. */
\r
317 #if ( __mips_hard_float == 1 ) && ( configUSE_TASK_FPU_SUPPORT == 1 )
\r
318 portFPU_REG_TEST $22, $f0, 0x180
\r
319 portFPU_REG_TEST $22, $f1, 0x181
\r
320 portFPU_REG_TEST $22, $f2, 0x182
\r
321 portFPU_REG_TEST $22, $f3, 0x183
\r
322 portFPU_REG_TEST $22, $f4, 0x184
\r
323 portFPU_REG_TEST $22, $f5, 0x185
\r
324 portFPU_REG_TEST $22, $f6, 0x186
\r
325 portFPU_REG_TEST $22, $f7, 0x187
\r
326 portFPU_REG_TEST $22, $f8, 0x188
\r
327 portFPU_REG_TEST $22, $f9, 0x189
\r
328 portFPU_REG_TEST $22, $f10, 0x18A
\r
329 portFPU_REG_TEST $22, $f11, 0x18B
\r
330 portFPU_REG_TEST $22, $f12, 0x18C
\r
331 portFPU_REG_TEST $22, $f13, 0x18D
\r
332 portFPU_REG_TEST $22, $f14, 0x18E
\r
333 portFPU_REG_TEST $22, $f15, 0x18F
\r
334 portFPU_REG_TEST $22, $f16, 0x190
\r
335 portFPU_REG_TEST $22, $f17, 0x191
\r
336 portFPU_REG_TEST $22, $f18, 0x192
\r
337 portFPU_REG_TEST $22, $f19, 0x193
\r
338 portFPU_REG_TEST $22, $f20, 0x194
\r
339 portFPU_REG_TEST $22, $f21, 0x195
\r
340 portFPU_REG_TEST $22, $f22, 0x196
\r
341 portFPU_REG_TEST $22, $f23, 0x197
\r
342 portFPU_REG_TEST $22, $f24, 0x198
\r
343 portFPU_REG_TEST $22, $f25, 0x199
\r
344 portFPU_REG_TEST $22, $f26, 0x19A
\r
345 portFPU_REG_TEST $22, $f27, 0x19B
\r
346 portFPU_REG_TEST $22, $f28, 0x19C
\r
347 portFPU_REG_TEST $22, $f29, 0x19D
\r
348 portFPU_REG_TEST $22, $f30, 0x19E
\r
349 portFPU_REG_TEST $22, $f31, 0x19F
\r
352 /* No errors detected. Increment the loop count so the check timer knows
\r
353 this task is still running without error, then loop back to do it all
\r
354 again. The address of the loop counter is in $4. */
\r
356 addiu $22, $22, 0x01
\r
363 /************************************************************************/
\r
372 /* $4 contains the address of the loop counter - don't mess with $4. */
\r
378 addiu $10, $0, 0x210
\r
379 addiu $11, $0, 0x211
\r
380 addiu $12, $0, 0x212
\r
381 addiu $13, $0, 0x213
\r
382 addiu $14, $0, 0x214
\r
383 addiu $15, $0, 0x215
\r
384 addiu $16, $0, 0x216
\r
385 addiu $17, $0, 0x217
\r
386 addiu $18, $0, 0x218
\r
387 addiu $19, $0, 0x219
\r
388 addiu $20, $0, 0x220
\r
389 addiu $21, $0, 0x221
\r
390 addiu $23, $0, 0x223
\r
391 addiu $24, $0, 0x224
\r
392 addiu $25, $0, 0x225
\r
393 addiu $30, $0, 0x230
\r
394 addiu $22, $0, 0x231
\r
396 addiu $22, $0, 0x232
\r
398 addiu $22, $0, 0x233
\r
400 addiu $22, $0, 0x234
\r
402 addiu $22, $0, 0x235
\r
404 addiu $22, $0, 0x236
\r
407 /* Test the FPU registers if they are present on the part. */
\r
408 #if ( __mips_hard_float == 1 ) && ( configUSE_TASK_FPU_SUPPORT == 1 )
\r
409 addiu $22, $0, 0x280
\r
411 addiu $22, $0, 0x281
\r
413 addiu $22, $0, 0x282
\r
415 addiu $22, $0, 0x283
\r
417 addiu $22, $0, 0x284
\r
419 addiu $22, $0, 0x285
\r
421 addiu $22, $0, 0x286
\r
423 addiu $22, $0, 0x287
\r
425 addiu $22, $0, 0x288
\r
427 addiu $22, $0, 0x289
\r
429 addiu $22, $0, 0x28A
\r
431 addiu $22, $0, 0x28B
\r
433 addiu $22, $0, 0x28C
\r
435 addiu $22, $0, 0x28D
\r
437 addiu $22, $0, 0x28E
\r
439 addiu $22, $0, 0x28F
\r
441 addiu $22, $0, 0x290
\r
443 addiu $22, $0, 0x291
\r
445 addiu $22, $0, 0x292
\r
447 addiu $22, $0, 0x293
\r
449 addiu $22, $0, 0x294
\r
451 addiu $22, $0, 0x295
\r
453 addiu $22, $0, 0x296
\r
455 addiu $22, $0, 0x297
\r
457 addiu $22, $0, 0x298
\r
459 addiu $22, $0, 0x299
\r
461 addiu $22, $0, 0x29A
\r
463 addiu $22, $0, 0x29B
\r
465 addiu $22, $0, 0x29C
\r
467 addiu $22, $0, 0x29D
\r
469 addiu $22, $0, 0x29E
\r
471 addiu $22, $0, 0x29F
\r
476 portREG_TEST $22, $1, 0x21
\r
477 portREG_TEST $22, $2, 0x22
\r
478 portREG_TEST $22, $3, 0x23
\r
479 /* Do not test r4 as we are using it as a loop counter */
\r
480 portREG_TEST $22, $5, 0x25
\r
481 portREG_TEST $22, $6, 0x26
\r
482 portREG_TEST $22, $7, 0x27
\r
483 portREG_TEST $22, $8, 0x28
\r
484 portREG_TEST $22, $9, 0x29
\r
485 portREG_TEST $22, $10, 0x210
\r
486 portREG_TEST $22, $11, 0x211
\r
487 portREG_TEST $22, $12, 0x212
\r
488 portREG_TEST $22, $13, 0x213
\r
489 portREG_TEST $22, $14, 0x214
\r
490 portREG_TEST $22, $15, 0x215
\r
491 portREG_TEST $22, $16, 0x216
\r
492 portREG_TEST $22, $17, 0x217
\r
493 portREG_TEST $22, $18, 0x218
\r
494 portREG_TEST $22, $19, 0x219
\r
495 portREG_TEST $22, $20, 0x220
\r
496 portREG_TEST $22, $21, 0x221
\r
497 /* Do not test r22, used as a helper */
\r
498 portREG_TEST $22, $23, 0x223
\r
499 portREG_TEST $22, $24, 0x224
\r
500 portREG_TEST $22, $25, 0x225
\r
501 portREG_TEST $22, $30, 0x230
\r
504 addiu $22, $22, -0x231
\r
511 addiu $22, $22, -0x232
\r
518 addiu $22, $22, -0x233
\r
525 addiu $22, $22, -0x234
\r
532 addiu $22, $22, -0x235
\r
539 addiu $22, $22, -0x236
\r
545 /* Test the FPU registers if they are present on the part. */
\r
546 #if ( __mips_hard_float == 1 ) && ( configUSE_TASK_FPU_SUPPORT == 1 )
\r
547 portFPU_REG_TEST $22, $f0, 0x280
\r
548 portFPU_REG_TEST $22, $f1, 0x281
\r
549 portFPU_REG_TEST $22, $f2, 0x282
\r
550 portFPU_REG_TEST $22, $f3, 0x283
\r
551 portFPU_REG_TEST $22, $f4, 0x284
\r
552 portFPU_REG_TEST $22, $f5, 0x285
\r
553 portFPU_REG_TEST $22, $f6, 0x286
\r
554 portFPU_REG_TEST $22, $f7, 0x287
\r
555 portFPU_REG_TEST $22, $f8, 0x288
\r
556 portFPU_REG_TEST $22, $f9, 0x289
\r
557 portFPU_REG_TEST $22, $f10, 0x28A
\r
558 portFPU_REG_TEST $22, $f11, 0x28B
\r
559 portFPU_REG_TEST $22, $f12, 0x28C
\r
560 portFPU_REG_TEST $22, $f13, 0x28D
\r
561 portFPU_REG_TEST $22, $f14, 0x28E
\r
562 portFPU_REG_TEST $22, $f15, 0x28F
\r
563 portFPU_REG_TEST $22, $f16, 0x290
\r
564 portFPU_REG_TEST $22, $f17, 0x291
\r
565 portFPU_REG_TEST $22, $f18, 0x292
\r
566 portFPU_REG_TEST $22, $f19, 0x293
\r
567 portFPU_REG_TEST $22, $f20, 0x294
\r
568 portFPU_REG_TEST $22, $f21, 0x295
\r
569 portFPU_REG_TEST $22, $f22, 0x296
\r
570 portFPU_REG_TEST $22, $f23, 0x297
\r
571 portFPU_REG_TEST $22, $f24, 0x298
\r
572 portFPU_REG_TEST $22, $f25, 0x299
\r
573 portFPU_REG_TEST $22, $f26, 0x29A
\r
574 portFPU_REG_TEST $22, $f27, 0x29B
\r
575 portFPU_REG_TEST $22, $f28, 0x29C
\r
576 portFPU_REG_TEST $22, $f29, 0x29D
\r
577 portFPU_REG_TEST $22, $f30, 0x29E
\r
578 portFPU_REG_TEST $22, $f31, 0x29F
\r
581 /* No errors detected. Increment the loop count so the check timer knows
\r
582 this task is still running without error, then loop back to do it all
\r
583 again. The address of the loop counter is in $4. */
\r
585 addiu $22, $22, 0x01
\r