3 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
6 * this software and associated documentation files (the "Software"), to deal in
7 * the Software without restriction, including without limitation the rights to
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9 * the Software, and to permit persons to whom the Software is furnished to do so,
10 * subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in all
13 * copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * http://www.FreeRTOS.org
23 * http://aws.amazon.com/freertos
28 .extern ulRegTest1LoopCounter
29 .extern ulRegTest2LoopCounter
31 .global vRegTest1Implementation
32 .global vRegTest2Implementation
34 /*-----------------------------------------------------------*/
37 * The register check tasks are described in the comments at the top of
42 vRegTest1Implementation:
44 /* Fill the core registers with known values. */
74 /* Check each register still contains the expected known value.
75 vRegTest1Implementation uses x31 as the temporary, vRegTest2Implementation
76 uses x5 as the temporary. */
78 bne x31, x5, reg1_error_loop
80 bne x31, x6, reg1_error_loop
82 bne x31, x7, reg1_error_loop
84 bne x31, x8, reg1_error_loop
86 bne x31, x9, reg1_error_loop
88 bne x31, x10, reg1_error_loop
90 bne x31, x11, reg1_error_loop
92 bne x31, x12, reg1_error_loop
94 bne x31, x13, reg1_error_loop
96 bne x31, x14, reg1_error_loop
98 bne x31, x15, reg1_error_loop
100 bne x31, x16, reg1_error_loop
102 bne x31, x17, reg1_error_loop
104 bne x31, x18, reg1_error_loop
106 bne x31, x19, reg1_error_loop
108 bne x31, x20, reg1_error_loop
110 bne x31, x21, reg1_error_loop
112 bne x31, x22, reg1_error_loop
114 bne x31, x23, reg1_error_loop
116 bne x31, x24, reg1_error_loop
118 bne x31, x25, reg1_error_loop
120 bne x31, x26, reg1_error_loop
122 bne x31, x27, reg1_error_loop
124 bne x31, x28, reg1_error_loop
126 bne x31, x29, reg1_error_loop
128 bne x31, x30, reg1_error_loop
130 /* Everything passed, increment the loop counter. */
131 lw x31, ulRegTest1LoopCounterConst
136 /* Restore clobbered register reading for next loop. */
139 /* Yield to increase code coverage. */
146 /* Jump here if a register contains an uxpected value. This stops the loop
147 counter being incremented so the check task knows an error was found. */
152 ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter
154 /*-----------------------------------------------------------*/
157 vRegTest2Implementation:
159 /* Fill the core registers with known values. */
189 /* Check each register still contains the expected known value.
190 vRegTest2Implementation uses x5 as the temporary, vRegTest1Implementation
191 uses x31 as the temporary. */
193 bne x5, x6, reg2_error_loop
195 bne x5, x7, reg2_error_loop
197 bne x5, x8, reg2_error_loop
199 bne x5, x9, reg2_error_loop
201 bne x5, x10, reg2_error_loop
203 bne x5, x11, reg2_error_loop
205 bne x5, x12, reg2_error_loop
207 bne x5, x13, reg2_error_loop
209 bne x5, x14, reg2_error_loop
211 bne x5, x15, reg2_error_loop
213 bne x5, x16, reg2_error_loop
215 bne x5, x17, reg2_error_loop
217 bne x5, x18, reg2_error_loop
219 bne x5, x19, reg2_error_loop
221 bne x5, x20, reg2_error_loop
223 bne x5, x21, reg2_error_loop
225 bne x5, x22, reg2_error_loop
227 bne x5, x23, reg2_error_loop
229 bne x5, x24, reg2_error_loop
231 bne x5, x25, reg2_error_loop
233 bne x5, x26, reg2_error_loop
235 bne x5, x27, reg2_error_loop
237 bne x5, x28, reg2_error_loop
239 bne x5, x29, reg2_error_loop
241 bne x5, x30, reg2_error_loop
243 bne x5, x31, reg2_error_loop
245 /* Everything passed, increment the loop counter. */
246 lw x5, ulRegTest2LoopCounterConst
251 /* Restore clobbered register reading for next loop. */
258 /* Jump here if a register contains an uxpected value. This stops the loop
259 counter being incremented so the check task knows an error was found. */
264 ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter