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 PUBLIC vRegTest1Implementation
\r
32 PUBLIC vRegTest2Implementation
\r
34 /*-----------------------------------------------------------*/
\r
36 SECTION `.text`:CODE:NOROOT(2)
\r
40 * The register check tasks are described in the comments at the top of
\r
44 vRegTest1Implementation:
\r
46 /* Fill the core registers with known values. */
\r
76 /* Check each register still contains the expected known value.
\r
77 vRegTest1Implementation uses x31 as the temporary, vRegTest2Implementation
\r
78 uses x5 as the temporary. */
\r
80 bne x31, x5, reg1_error_loop
\r
82 bne x31, x6, reg1_error_loop
\r
84 bne x31, x7, reg1_error_loop
\r
86 bne x31, x8, reg1_error_loop
\r
88 bne x31, x9, reg1_error_loop
\r
90 bne x31, x10, reg1_error_loop
\r
92 bne x31, x11, reg1_error_loop
\r
94 bne x31, x12, reg1_error_loop
\r
96 bne x31, x13, reg1_error_loop
\r
98 bne x31, x14, reg1_error_loop
\r
100 bne x31, x15, reg1_error_loop
\r
102 bne x31, x16, reg1_error_loop
\r
104 bne x31, x17, reg1_error_loop
\r
106 bne x31, x18, reg1_error_loop
\r
108 bne x31, x19, reg1_error_loop
\r
110 bne x31, x20, reg1_error_loop
\r
112 bne x31, x21, reg1_error_loop
\r
114 bne x31, x22, reg1_error_loop
\r
116 bne x31, x23, reg1_error_loop
\r
118 bne x31, x24, reg1_error_loop
\r
120 bne x31, x25, reg1_error_loop
\r
122 bne x31, x26, reg1_error_loop
\r
124 bne x31, x27, reg1_error_loop
\r
126 bne x31, x28, reg1_error_loop
\r
128 bne x31, x29, reg1_error_loop
\r
130 bne x31, x30, reg1_error_loop
\r
132 /* Everything passed, increment the loop counter. */
\r
133 lw x31, ulRegTest1LoopCounter
\r
134 //_RB_ lw x30, 0(x31)
\r
138 /* Restore clobbered register reading for next loop. */
\r
141 /* Yield to increase code coverage. */
\r
148 /* Jump here if a register contains an uxpected value. This stops the loop
\r
149 counter being incremented so the check task knows an error was found. */
\r
150 jal reg1_error_loop
\r
152 /*-----------------------------------------------------------*/
\r
154 vRegTest2Implementation:
\r
156 /* Fill the core registers with known values. */
\r
186 /* Check each register still contains the expected known value.
\r
187 vRegTest2Implementation uses x5 as the temporary, vRegTest1Implementation
\r
188 uses x31 as the temporary. */
\r
190 bne x5, x6, reg2_error_loop
\r
192 bne x5, x7, reg2_error_loop
\r
194 bne x5, x8, reg2_error_loop
\r
196 bne x5, x9, reg2_error_loop
\r
198 bne x5, x10, reg2_error_loop
\r
200 bne x5, x11, reg2_error_loop
\r
202 bne x5, x12, reg2_error_loop
\r
204 bne x5, x13, reg2_error_loop
\r
206 bne x5, x14, reg2_error_loop
\r
208 bne x5, x15, reg2_error_loop
\r
210 bne x5, x16, reg2_error_loop
\r
212 bne x5, x17, reg2_error_loop
\r
214 bne x5, x18, reg2_error_loop
\r
216 bne x5, x19, reg2_error_loop
\r
218 bne x5, x20, reg2_error_loop
\r
220 bne x5, x21, reg2_error_loop
\r
222 bne x5, x22, reg2_error_loop
\r
224 bne x5, x23, reg2_error_loop
\r
226 bne x5, x24, reg2_error_loop
\r
228 bne x5, x25, reg2_error_loop
\r
230 bne x5, x26, reg2_error_loop
\r
232 bne x5, x27, reg2_error_loop
\r
234 bne x5, x28, reg2_error_loop
\r
236 bne x5, x29, reg2_error_loop
\r
238 bne x5, x30, reg2_error_loop
\r
240 bne x5, x31, reg2_error_loop
\r
242 /* Everything passed, increment the loop counter. */
\r
243 lw x5, ulRegTest2LoopCounter
\r
244 //_RB_ lw x6, 0(x5)
\r
248 /* Restore clobbered register reading for next loop. */
\r
255 /* Jump here if a register contains an uxpected value. This stops the loop
\r
256 counter being incremented so the check task knows an error was found. */
\r
257 jal reg2_error_loop
\r
259 /*-----------------------------------------------------------*/
\r