2 * FreeRTOS Kernel V10.3.0
\r
3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 * this software and associated documentation files (the "Software"), to deal in
\r
7 * the Software without restriction, including without limitation the rights to
\r
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 * subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 * http://www.FreeRTOS.org
\r
23 * http://aws.amazon.com/freertos
\r
25 * 1 tab == 4 spaces!
\r
30 #include <sys/asm.h>
\r
36 /* Reg test macro helper. Test a register for a known value branching to
\r
37 error_loop if not correct otherwise continuing on */
\r
38 .macro portREG_TEST work_reg, test_reg, test_value
\r
43 /* Check each register maintains the value assigned to it for the lifetime
\r
45 addiu \work_reg, $0, 0x00
\r
46 addiu \work_reg, \test_reg, -\test_value
\r
47 beq \work_reg, $0, 1f
\r
49 /* The register value was not that expected. Jump to the error loop so the
\r
50 cycle counter stops incrementing. */
\r
62 /* Reg test tasks call the error loop when they find an error. Sitting in the
\r
63 tight error loop prevents them incrementing their ulRegTestnCycles counter, and
\r
64 so allows the check softwate timer to know an error has been found. */
\r
78 /* Fill the registers with known values. */
\r
82 /* $4 contains the address of the loop counter - don't mess with $4. */
\r
88 addiu $10, $0, 0x110
\r
89 addiu $11, $0, 0x111
\r
90 addiu $12, $0, 0x112
\r
91 addiu $13, $0, 0x113
\r
92 addiu $14, $0, 0x114
\r
93 addiu $15, $0, 0x115
\r
94 addiu $16, $0, 0x116
\r
95 addiu $17, $0, 0x117
\r
96 addiu $18, $0, 0x118
\r
97 addiu $19, $0, 0x119
\r
98 addiu $20, $0, 0x120
\r
99 addiu $21, $0, 0x121
\r
100 addiu $23, $0, 0x123
\r
101 addiu $24, $0, 0x124
\r
102 addiu $25, $0, 0x125
\r
103 addiu $30, $0, 0x130
\r
104 addiu $22, $0, 0x131
\r
107 portREG_TEST $22, $1, 0x11
\r
108 portREG_TEST $22, $2, 0x12
\r
109 portREG_TEST $22, $3, 0x13
\r
110 portREG_TEST $22, $5, 0x15
\r
111 portREG_TEST $22, $6, 0x16
\r
112 portREG_TEST $22, $7, 0x17
\r
113 portREG_TEST $22, $8, 0x18
\r
114 portREG_TEST $22, $9, 0x19
\r
115 portREG_TEST $22, $10, 0x110
\r
116 portREG_TEST $22, $11, 0x111
\r
117 portREG_TEST $22, $12, 0x112
\r
118 portREG_TEST $22, $13, 0x113
\r
119 portREG_TEST $22, $14, 0x114
\r
120 portREG_TEST $22, $15, 0x115
\r
121 portREG_TEST $22, $16, 0x116
\r
122 portREG_TEST $22, $17, 0x117
\r
123 portREG_TEST $22, $18, 0x118
\r
124 portREG_TEST $22, $19, 0x119
\r
125 portREG_TEST $22, $20, 0x120
\r
126 portREG_TEST $22, $21, 0x121
\r
127 portREG_TEST $22, $23, 0x123
\r
128 portREG_TEST $22, $24, 0x124
\r
129 portREG_TEST $22, $25, 0x125
\r
130 portREG_TEST $22, $30, 0x130
\r
132 /* No errors detected. Increment the loop count so the check timer knows
\r
133 this task is still running without error, then loop back to do it all
\r
134 again. The address of the loop counter is in $4. */
\r
136 addiu $22, $22, 0x01
\r
153 /* $4 contains the address of the loop counter - don't mess with $4. */
\r
159 addiu $10, $0, 0x210
\r
160 addiu $11, $0, 0x211
\r
161 addiu $12, $0, 0x212
\r
162 addiu $13, $0, 0x213
\r
163 addiu $14, $0, 0x214
\r
164 addiu $15, $0, 0x215
\r
165 addiu $16, $0, 0x216
\r
166 addiu $17, $0, 0x217
\r
167 addiu $18, $0, 0x218
\r
168 addiu $19, $0, 0x219
\r
169 addiu $20, $0, 0x220
\r
170 addiu $21, $0, 0x221
\r
171 addiu $23, $0, 0x223
\r
172 addiu $24, $0, 0x224
\r
173 addiu $25, $0, 0x225
\r
174 addiu $30, $0, 0x230
\r
175 addiu $22, $0, 0x231
\r
178 portREG_TEST $22, $1, 0x21
\r
179 portREG_TEST $22, $2, 0x22
\r
180 portREG_TEST $22, $3, 0x23
\r
181 portREG_TEST $22, $5, 0x25
\r
182 portREG_TEST $22, $6, 0x26
\r
183 portREG_TEST $22, $7, 0x27
\r
184 portREG_TEST $22, $8, 0x28
\r
185 portREG_TEST $22, $9, 0x29
\r
186 portREG_TEST $22, $10, 0x210
\r
187 portREG_TEST $22, $11, 0x211
\r
188 portREG_TEST $22, $12, 0x212
\r
189 portREG_TEST $22, $13, 0x213
\r
190 portREG_TEST $22, $14, 0x214
\r
191 portREG_TEST $22, $15, 0x215
\r
192 portREG_TEST $22, $16, 0x216
\r
193 portREG_TEST $22, $17, 0x217
\r
194 portREG_TEST $22, $18, 0x218
\r
195 portREG_TEST $22, $19, 0x219
\r
196 portREG_TEST $22, $20, 0x220
\r
197 portREG_TEST $22, $21, 0x221
\r
198 portREG_TEST $22, $23, 0x223
\r
199 portREG_TEST $22, $24, 0x224
\r
200 portREG_TEST $22, $25, 0x225
\r
201 portREG_TEST $22, $30, 0x230
\r
203 /* No errors detected. Increment the loop count so the check timer knows
\r
204 this task is still running without error, then loop back to do it all
\r
205 again. The address of the loop counter is in $4. */
\r
207 addiu $22, $22, 0x01
\r