2 * FreeRTOS Kernel V10.2.1
\r
3 * Copyright (C) 2019 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
28 .extern ulRegTest1LoopCounter
\r
29 .extern ulRegTest2LoopCounter
\r
31 .global vRegTest1Implementation
\r
32 .global vRegTest2Implementation
\r
34 /*-----------------------------------------------------------*/
\r
37 * The register check tasks are described in the comments at the top of
\r
42 vRegTest1Implementation:
\r
44 /* Fill the core registers with known values. */
\r
74 /* Check each register still contains the expected known value.
\r
75 vRegTest1Implementation uses x31 as the temporary, vRegTest2Implementation
\r
76 uses x5 as the temporary. */
\r
78 bne x31, x5, reg1_error_loop
\r
80 bne x31, x6, reg1_error_loop
\r
82 bne x31, x7, reg1_error_loop
\r
84 bne x31, x8, reg1_error_loop
\r
86 bne x31, x9, reg1_error_loop
\r
88 bne x31, x10, reg1_error_loop
\r
90 bne x31, x11, reg1_error_loop
\r
92 bne x31, x12, reg1_error_loop
\r
94 bne x31, x13, reg1_error_loop
\r
96 bne x31, x14, reg1_error_loop
\r
98 bne x31, x15, reg1_error_loop
\r
100 bne x31, x16, reg1_error_loop
\r
102 bne x31, x17, reg1_error_loop
\r
104 bne x31, x18, reg1_error_loop
\r
106 bne x31, x19, reg1_error_loop
\r
108 bne x31, x20, reg1_error_loop
\r
110 bne x31, x21, reg1_error_loop
\r
112 bne x31, x22, reg1_error_loop
\r
114 bne x31, x23, reg1_error_loop
\r
116 bne x31, x24, reg1_error_loop
\r
118 bne x31, x25, reg1_error_loop
\r
120 bne x31, x26, reg1_error_loop
\r
122 bne x31, x27, reg1_error_loop
\r
124 bne x31, x28, reg1_error_loop
\r
126 bne x31, x29, reg1_error_loop
\r
128 bne x31, x30, reg1_error_loop
\r
130 /* Everything passed, increment the loop counter. */
\r
131 lw x31, ulRegTest1LoopCounterConst
\r
136 /* Restore clobbered register reading for next loop. */
\r
139 /* Yield to increase code coverage. */
\r
146 /* Jump here if a register contains an uxpected value. This stops the loop
\r
147 counter being incremented so the check task knows an error was found. */
\r
149 jal reg1_error_loop
\r
152 ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter
\r
154 /*-----------------------------------------------------------*/
\r
157 vRegTest2Implementation:
\r
159 /* Fill the core registers with known values. */
\r
189 /* Check each register still contains the expected known value.
\r
190 vRegTest2Implementation uses x5 as the temporary, vRegTest1Implementation
\r
191 uses x31 as the temporary. */
\r
193 bne x5, x6, reg2_error_loop
\r
195 bne x5, x7, reg2_error_loop
\r
197 bne x5, x8, reg2_error_loop
\r
199 bne x5, x9, reg2_error_loop
\r
201 bne x5, x10, reg2_error_loop
\r
203 bne x5, x11, reg2_error_loop
\r
205 bne x5, x12, reg2_error_loop
\r
207 bne x5, x13, reg2_error_loop
\r
209 bne x5, x14, reg2_error_loop
\r
211 bne x5, x15, reg2_error_loop
\r
213 bne x5, x16, reg2_error_loop
\r
215 bne x5, x17, reg2_error_loop
\r
217 bne x5, x18, reg2_error_loop
\r
219 bne x5, x19, reg2_error_loop
\r
221 bne x5, x20, reg2_error_loop
\r
223 bne x5, x21, reg2_error_loop
\r
225 bne x5, x22, reg2_error_loop
\r
227 bne x5, x23, reg2_error_loop
\r
229 bne x5, x24, reg2_error_loop
\r
231 bne x5, x25, reg2_error_loop
\r
233 bne x5, x26, reg2_error_loop
\r
235 bne x5, x27, reg2_error_loop
\r
237 bne x5, x28, reg2_error_loop
\r
239 bne x5, x29, reg2_error_loop
\r
241 bne x5, x30, reg2_error_loop
\r
243 bne x5, x31, reg2_error_loop
\r
245 /* Everything passed, increment the loop counter. */
\r
246 lw x5, ulRegTest2LoopCounterConst
\r
251 /* Restore clobbered register reading for next loop. */
\r
258 /* Jump here if a register contains an uxpected value. This stops the loop
\r
259 counter being incremented so the check task knows an error was found. */
\r
261 jal reg2_error_loop
\r
264 ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter
\r