2 * FreeRTOS Kernel V10.1.1
\r
3 * Copyright (C) 2018 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
41 vRegTest1Implementation:
\r
43 /* Fill the core registers with known values. */
\r
73 /* Check each register still contains the expected known value.
\r
74 vRegTest1Implementation uses x31 as the temporary, vRegTest2Implementation
\r
75 uses x5 as the temporary. */
\r
77 bne x31, x5, reg1_error_loop
\r
79 bne x31, x6, reg1_error_loop
\r
81 bne x31, x7, reg1_error_loop
\r
83 bne x31, x8, reg1_error_loop
\r
85 bne x31, x9, reg1_error_loop
\r
87 bne x31, x10, reg1_error_loop
\r
89 bne x31, x11, reg1_error_loop
\r
91 bne x31, x12, reg1_error_loop
\r
93 bne x31, x13, reg1_error_loop
\r
95 bne x31, x14, reg1_error_loop
\r
97 bne x31, x15, reg1_error_loop
\r
99 bne x31, x16, reg1_error_loop
\r
101 bne x31, x17, reg1_error_loop
\r
103 bne x31, x18, reg1_error_loop
\r
105 bne x31, x19, reg1_error_loop
\r
107 bne x31, x20, reg1_error_loop
\r
109 bne x31, x21, reg1_error_loop
\r
111 bne x31, x22, reg1_error_loop
\r
113 bne x31, x23, reg1_error_loop
\r
115 bne x31, x24, reg1_error_loop
\r
117 bne x31, x25, reg1_error_loop
\r
119 bne x31, x26, reg1_error_loop
\r
121 bne x31, x27, reg1_error_loop
\r
123 bne x31, x28, reg1_error_loop
\r
125 bne x31, x29, reg1_error_loop
\r
127 bne x31, x30, reg1_error_loop
\r
129 /* Everything passed, increment the loop counter. */
\r
130 lw x31, ulRegTest1LoopCounterConst
\r
135 /* Restore clobbered register reading for next loop. */
\r
138 /* Yield to increase code coverage. */
\r
145 /* Jump here if a register contains an uxpected value. This stops the loop
\r
146 counter being incremented so the check task knows an error was found. */
\r
147 jal reg1_error_loop
\r
149 ulRegTest1LoopCounterConst: .word ulRegTest1LoopCounter
\r
151 /*-----------------------------------------------------------*/
\r
153 vRegTest2Implementation:
\r
155 /* Fill the core registers with known values. */
\r
185 /* Check each register still contains the expected known value.
\r
186 vRegTest2Implementation uses x5 as the temporary, vRegTest1Implementation
\r
187 uses x31 as the temporary. */
\r
189 bne x5, x6, reg2_error_loop
\r
191 bne x5, x7, reg2_error_loop
\r
193 bne x5, x8, reg2_error_loop
\r
195 bne x5, x9, reg2_error_loop
\r
197 bne x5, x10, reg2_error_loop
\r
199 bne x5, x11, reg2_error_loop
\r
201 bne x5, x12, reg2_error_loop
\r
203 bne x5, x13, reg2_error_loop
\r
205 bne x5, x14, reg2_error_loop
\r
207 bne x5, x15, reg2_error_loop
\r
209 bne x5, x16, reg2_error_loop
\r
211 bne x5, x17, reg2_error_loop
\r
213 bne x5, x18, reg2_error_loop
\r
215 bne x5, x19, reg2_error_loop
\r
217 bne x5, x20, reg2_error_loop
\r
219 bne x5, x21, reg2_error_loop
\r
221 bne x5, x22, reg2_error_loop
\r
223 bne x5, x23, reg2_error_loop
\r
225 bne x5, x24, reg2_error_loop
\r
227 bne x5, x25, reg2_error_loop
\r
229 bne x5, x26, reg2_error_loop
\r
231 bne x5, x27, reg2_error_loop
\r
233 bne x5, x28, reg2_error_loop
\r
235 bne x5, x29, reg2_error_loop
\r
237 bne x5, x30, reg2_error_loop
\r
239 bne x5, x31, reg2_error_loop
\r
241 /* Everything passed, increment the loop counter. */
\r
242 lw x5, ulRegTest2LoopCounterConst
\r
247 /* Restore clobbered register reading for next loop. */
\r
254 /* Jump here if a register contains an uxpected value. This stops the loop
\r
255 counter being incremented so the check task knows an error was found. */
\r
256 jal reg2_error_loop
\r
258 ulRegTest2LoopCounterConst: .word ulRegTest2LoopCounter
\r