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 .global vRegTest1Implementation
\r
29 .global vRegTest2Implementation
\r
30 .extern ulRegTest1LoopCounter
\r
31 .extern ulRegTest2LoopCounter
\r
36 /* This function is explained in the comments at the top of main-full.c. */
\r
37 .type vRegTest1Implementation, %function
\r
38 vRegTest1Implementation:
\r
40 /* Fill each general purpose register with a known value. */
\r
56 /* Fill each FPU register with a known value. */
\r
74 /* Loop, checking each iteration that each register still contains the
\r
77 /* Yield to increase test coverage */
\r
80 /* Check all the VFP registers still contain the values set above.
\r
81 First save registers that are clobbered by the test. */
\r
86 bne reg1_error_loopf
\r
88 bne reg1_error_loopf
\r
91 bne reg1_error_loopf
\r
93 bne reg1_error_loopf
\r
96 bne reg1_error_loopf
\r
98 bne reg1_error_loopf
\r
101 bne reg1_error_loopf
\r
103 bne reg1_error_loopf
\r
106 bne reg1_error_loopf
\r
108 bne reg1_error_loopf
\r
111 bne reg1_error_loopf
\r
113 bne reg1_error_loopf
\r
116 bne reg1_error_loopf
\r
118 bne reg1_error_loopf
\r
121 bne reg1_error_loopf
\r
123 bne reg1_error_loopf
\r
126 bne reg1_error_loopf
\r
128 bne reg1_error_loopf
\r
131 bne reg1_error_loopf
\r
133 bne reg1_error_loopf
\r
136 bne reg1_error_loopf
\r
138 bne reg1_error_loopf
\r
141 bne reg1_error_loopf
\r
143 bne reg1_error_loopf
\r
146 bne reg1_error_loopf
\r
148 bne reg1_error_loopf
\r
151 bne reg1_error_loopf
\r
153 bne reg1_error_loopf
\r
156 bne reg1_error_loopf
\r
158 bne reg1_error_loopf
\r
161 bne reg1_error_loopf
\r
163 bne reg1_error_loopf
\r
165 /* Restore the registers that were clobbered by the test. */
\r
168 /* VFP register test passed. Jump to the core register test. */
\r
172 /* If this line is hit then a VFP register value was found to be
\r
178 /* Test each general purpose register to check that it still contains the
\r
179 expected known value, jumping to reg1_error_loop if any register contains
\r
180 an unexpected value. */
\r
182 bne reg1_error_loop
\r
184 bne reg1_error_loop
\r
186 bne reg1_error_loop
\r
188 bne reg1_error_loop
\r
190 bne reg1_error_loop
\r
192 bne reg1_error_loop
\r
194 bne reg1_error_loop
\r
196 bne reg1_error_loop
\r
198 bne reg1_error_loop
\r
200 bne reg1_error_loop
\r
202 bne reg1_error_loop
\r
204 bne reg1_error_loop
\r
206 bne reg1_error_loop
\r
208 bne reg1_error_loop
\r
210 /* Everything passed, increment the loop counter. */
\r
212 ldr r0, =ulRegTest1LoopCounter
\r
222 /* If this line is hit then there was an error in a core register value.
\r
223 The loop ensures the loop counter stops incrementing. */
\r
227 /*-----------------------------------------------------------*/
\r
229 .type vRegTest2Implementation, %function
\r
230 vRegTest2Implementation:
\r
232 /* Put a known value in each register. */
\r
233 mov r0, #0xFF000000
\r
234 mov r1, #0x11000000
\r
235 mov r2, #0x22000000
\r
236 mov r3, #0x33000000
\r
237 mov r4, #0x44000000
\r
238 mov r5, #0x55000000
\r
239 mov r6, #0x66000000
\r
240 mov r7, #0x77000000
\r
241 mov r8, #0x88000000
\r
242 mov r9, #0x99000000
\r
243 mov r10, #0xAA000000
\r
244 mov r11, #0xBB000000
\r
245 mov r12, #0xCC000000
\r
246 mov r14, #0xEE000000
\r
248 /* Likewise the floating point registers */
\r
266 /* Loop, checking each iteration that each register still contains the
\r
269 /* Check all the VFP registers still contain the values set above.
\r
270 First save registers that are clobbered by the test. */
\r
274 cmp r0, #0xFF000000
\r
275 bne reg2_error_loopf
\r
276 cmp r1, #0x11000000
\r
277 bne reg2_error_loopf
\r
279 cmp r0, #0x22000000
\r
280 bne reg2_error_loopf
\r
281 cmp r1, #0x33000000
\r
282 bne reg2_error_loopf
\r
284 cmp r0, #0x44000000
\r
285 bne reg2_error_loopf
\r
286 cmp r1, #0x55000000
\r
287 bne reg2_error_loopf
\r
289 cmp r0, #0x66000000
\r
290 bne reg2_error_loopf
\r
291 cmp r1, #0x77000000
\r
292 bne reg2_error_loopf
\r
294 cmp r0, #0x88000000
\r
295 bne reg2_error_loopf
\r
296 cmp r1, #0x99000000
\r
297 bne reg2_error_loopf
\r
299 cmp r0, #0xAA000000
\r
300 bne reg2_error_loopf
\r
301 cmp r1, #0xBB000000
\r
302 bne reg2_error_loopf
\r
304 cmp r0, #0xFF000000
\r
305 bne reg2_error_loopf
\r
306 cmp r1, #0x11000000
\r
307 bne reg2_error_loopf
\r
309 cmp r0, #0x22000000
\r
310 bne reg2_error_loopf
\r
311 cmp r1, #0x33000000
\r
312 bne reg2_error_loopf
\r
314 cmp r0, #0x44000000
\r
315 bne reg2_error_loopf
\r
316 cmp r1, #0x55000000
\r
317 bne reg2_error_loopf
\r
319 cmp r0, #0x66000000
\r
320 bne reg2_error_loopf
\r
321 cmp r1, #0x77000000
\r
322 bne reg2_error_loopf
\r
324 cmp r0, #0x88000000
\r
325 bne reg2_error_loopf
\r
326 cmp r1, #0x99000000
\r
327 bne reg2_error_loopf
\r
329 cmp r0, #0xAA000000
\r
330 bne reg2_error_loopf
\r
331 cmp r1, #0xBB000000
\r
332 bne reg2_error_loopf
\r
334 cmp r0, #0xFF000000
\r
335 bne reg2_error_loopf
\r
336 cmp r1, #0x11000000
\r
337 bne reg2_error_loopf
\r
339 cmp r0, #0x22000000
\r
340 bne reg2_error_loopf
\r
341 cmp r1, #0x33000000
\r
342 bne reg2_error_loopf
\r
344 cmp r0, #0x44000000
\r
345 bne reg2_error_loopf
\r
346 cmp r1, #0x55000000
\r
347 bne reg2_error_loopf
\r
349 cmp r0, #0x66000000
\r
350 bne reg2_error_loopf
\r
351 cmp r1, #0x77000000
\r
352 bne reg2_error_loopf
\r
354 /* Restore the registers that were clobbered by the test. */
\r
357 /* VFP register test passed. Jump to the core register test. */
\r
361 /* If this line is hit then a VFP register value was found to be
\r
367 cmp r0, #0xFF000000
\r
368 bne reg2_error_loop
\r
369 cmp r1, #0x11000000
\r
370 bne reg2_error_loop
\r
371 cmp r2, #0x22000000
\r
372 bne reg2_error_loop
\r
373 cmp r3, #0x33000000
\r
374 bne reg2_error_loop
\r
375 cmp r4, #0x44000000
\r
376 bne reg2_error_loop
\r
377 cmp r5, #0x55000000
\r
378 bne reg2_error_loop
\r
379 cmp r6, #0x66000000
\r
380 bne reg2_error_loop
\r
381 cmp r7, #0x77000000
\r
382 bne reg2_error_loop
\r
383 cmp r8, #0x88000000
\r
384 bne reg2_error_loop
\r
385 cmp r9, #0x99000000
\r
386 bne reg2_error_loop
\r
387 cmp r10, #0xAA000000
\r
388 bne reg2_error_loop
\r
389 cmp r11, #0xBB000000
\r
390 bne reg2_error_loop
\r
391 cmp r12, #0xCC000000
\r
392 bne reg2_error_loop
\r
393 cmp r14, #0xEE000000
\r
394 bne reg2_error_loop
\r
396 /* Everything passed, increment the loop counter. */
\r
398 ldr r0, =ulRegTest2LoopCounter
\r
408 /* If this line is hit then there was an error in a core register value.
\r
409 The loop ensures the loop counter stops incrementing. */
\r