2 ; * FreeRTOS Kernel V10.3.0
\r
3 ; * Copyright (C) 2020 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 #include "FreeRTOSConfig.h"
\r
30 EXPORT vRegTest1Implementation
\r
31 EXPORT vRegTest2Implementation
\r
33 ; This file is built with IAR and ARM compilers. When the ARM compiler
\r
34 ; is used the compiler options must define __IASMARM__ as 0 using the
\r
35 ; --predefine "__IASMARM__ SETA 0" command line option. When compiling
\r
36 ; with IAR __IASMARM__ is automatically set to 1 so no additional assembler
\r
37 ; options are required.
\r
38 SECTION .text:CODE:ROOT(2)
\r
41 ; This function is explained in the comments at the top of main-full.c.
\r
42 vRegTest1Implementation
\r
45 IMPORT ulRegTest1LoopCounter
\r
47 ; Fill each general purpose register with a known value.
\r
63 ; Fill each FPU register with a known value.
\r
98 ; Loop, checking each iteration that each register still contains the
\r
101 ; Yield to increase test coverage
\r
104 ; Check all the VFP registers still contain the values set above.
\r
105 ; First save registers that are clobbered by the test.
\r
110 bne reg1_error_loopf
\r
112 bne reg1_error_loopf
\r
115 bne reg1_error_loopf
\r
117 bne reg1_error_loopf
\r
120 bne reg1_error_loopf
\r
122 bne reg1_error_loopf
\r
125 bne reg1_error_loopf
\r
127 bne reg1_error_loopf
\r
130 bne reg1_error_loopf
\r
132 bne reg1_error_loopf
\r
135 bne reg1_error_loopf
\r
137 bne reg1_error_loopf
\r
140 bne reg1_error_loopf
\r
142 bne reg1_error_loopf
\r
145 bne reg1_error_loopf
\r
147 bne reg1_error_loopf
\r
150 bne reg1_error_loopf
\r
152 bne reg1_error_loopf
\r
155 bne reg1_error_loopf
\r
157 bne reg1_error_loopf
\r
160 bne reg1_error_loopf
\r
162 bne reg1_error_loopf
\r
165 bne reg1_error_loopf
\r
167 bne reg1_error_loopf
\r
170 bne reg1_error_loopf
\r
172 bne reg1_error_loopf
\r
175 bne reg1_error_loopf
\r
177 bne reg1_error_loopf
\r
180 bne reg1_error_loopf
\r
182 bne reg1_error_loopf
\r
185 bne reg1_error_loopf
\r
187 bne reg1_error_loopf
\r
191 bne reg1_error_loopf
\r
193 bne reg1_error_loopf
\r
196 bne reg1_error_loopf
\r
198 bne reg1_error_loopf
\r
201 bne reg1_error_loopf
\r
203 bne reg1_error_loopf
\r
206 bne reg1_error_loopf
\r
208 bne reg1_error_loopf
\r
211 bne reg1_error_loopf
\r
213 bne reg1_error_loopf
\r
216 bne reg1_error_loopf
\r
218 bne reg1_error_loopf
\r
221 bne reg1_error_loopf
\r
223 bne reg1_error_loopf
\r
226 bne reg1_error_loopf
\r
228 bne reg1_error_loopf
\r
231 bne reg1_error_loopf
\r
233 bne reg1_error_loopf
\r
236 bne reg1_error_loopf
\r
238 bne reg1_error_loopf
\r
241 bne reg1_error_loopf
\r
243 bne reg1_error_loopf
\r
246 bne reg1_error_loopf
\r
248 bne reg1_error_loopf
\r
251 bne reg1_error_loopf
\r
253 bne reg1_error_loopf
\r
256 bne reg1_error_loopf
\r
258 bne reg1_error_loopf
\r
261 bne reg1_error_loopf
\r
263 bne reg1_error_loopf
\r
266 bne reg1_error_loopf
\r
268 bne reg1_error_loopf
\r
270 ; Restore the registers that were clobbered by the test.
\r
273 ; VFP register test passed. Jump to the core register test.
\r
277 ; If this line is hit then a VFP register value was found to be
\r
283 ; Test each general purpose register to check that it still contains the
\r
284 ; expected known value, jumping to reg1_error_loop if any register contains
\r
285 ; an unexpected value.
\r
287 bne reg1_error_loop
\r
289 bne reg1_error_loop
\r
291 bne reg1_error_loop
\r
293 bne reg1_error_loop
\r
295 bne reg1_error_loop
\r
297 bne reg1_error_loop
\r
299 bne reg1_error_loop
\r
301 bne reg1_error_loop
\r
303 bne reg1_error_loop
\r
305 bne reg1_error_loop
\r
307 bne reg1_error_loop
\r
309 bne reg1_error_loop
\r
311 bne reg1_error_loop
\r
313 bne reg1_error_loop
\r
315 ; Everything passed, increment the loop counter.
\r
317 ldr r0, =ulRegTest1LoopCounter
\r
327 ; If this line is hit then there was an error in a core register value.
\r
328 ; The loop ensures the loop counter stops incrementing.
\r
332 ;/*-----------------------------------------------------------*/
\r
334 vRegTest2Implementation
\r
337 IMPORT ulRegTest2LoopCounter
\r
339 ; Put a known value in each register.
\r
340 mov r0, #0xFF000000
\r
341 mov r1, #0x11000000
\r
342 mov r2, #0x22000000
\r
343 mov r3, #0x33000000
\r
344 mov r4, #0x44000000
\r
345 mov r5, #0x55000000
\r
346 mov r6, #0x66000000
\r
347 mov r7, #0x77000000
\r
348 mov r8, #0x88000000
\r
349 mov r9, #0x99000000
\r
350 mov r10, #0xAA000000
\r
351 mov r11, #0xBB000000
\r
352 mov r12, #0xCC000000
\r
353 mov r14, #0xEE000000
\r
355 ; Likewise the floating point registers
\r
390 ; Loop, checking each iteration that each register still contains the
\r
393 ; Check all the VFP registers still contain the values set above.
\r
394 ; First save registers that are clobbered by the test.
\r
398 cmp r0, #0xFF000000
\r
399 bne reg2_error_loopf
\r
400 cmp r1, #0x11000000
\r
401 bne reg2_error_loopf
\r
403 cmp r0, #0x22000000
\r
404 bne reg2_error_loopf
\r
405 cmp r1, #0x33000000
\r
406 bne reg2_error_loopf
\r
408 cmp r0, #0x44000000
\r
409 bne reg2_error_loopf
\r
410 cmp r1, #0x55000000
\r
411 bne reg2_error_loopf
\r
413 cmp r0, #0x66000000
\r
414 bne reg2_error_loopf
\r
415 cmp r1, #0x77000000
\r
416 bne reg2_error_loopf
\r
418 cmp r0, #0x88000000
\r
419 bne reg2_error_loopf
\r
420 cmp r1, #0x99000000
\r
421 bne reg2_error_loopf
\r
423 cmp r0, #0xAA000000
\r
424 bne reg2_error_loopf
\r
425 cmp r1, #0xBB000000
\r
426 bne reg2_error_loopf
\r
428 cmp r0, #0xFF000000
\r
429 bne reg2_error_loopf
\r
430 cmp r1, #0x11000000
\r
431 bne reg2_error_loopf
\r
433 cmp r0, #0x22000000
\r
434 bne reg2_error_loopf
\r
435 cmp r1, #0x33000000
\r
436 bne reg2_error_loopf
\r
438 cmp r0, #0x44000000
\r
439 bne reg2_error_loopf
\r
440 cmp r1, #0x55000000
\r
441 bne reg2_error_loopf
\r
443 cmp r0, #0x66000000
\r
444 bne reg2_error_loopf
\r
445 cmp r1, #0x77000000
\r
446 bne reg2_error_loopf
\r
448 cmp r0, #0x88000000
\r
449 bne reg2_error_loopf
\r
450 cmp r1, #0x99000000
\r
451 bne reg2_error_loopf
\r
453 cmp r0, #0xAA000000
\r
454 bne reg2_error_loopf
\r
455 cmp r1, #0xBB000000
\r
456 bne reg2_error_loopf
\r
458 cmp r0, #0xFF000000
\r
459 bne reg2_error_loopf
\r
460 cmp r1, #0x11000000
\r
461 bne reg2_error_loopf
\r
463 cmp r0, #0x22000000
\r
464 bne reg2_error_loopf
\r
465 cmp r1, #0x33000000
\r
466 bne reg2_error_loopf
\r
468 cmp r0, #0x44000000
\r
469 bne reg2_error_loopf
\r
470 cmp r1, #0x55000000
\r
471 bne reg2_error_loopf
\r
473 cmp r0, #0x66000000
\r
474 bne reg2_error_loopf
\r
475 cmp r1, #0x77000000
\r
476 bne reg2_error_loopf
\r
479 cmp r0, #0xFF000000
\r
480 bne reg2_error_loopf
\r
481 cmp r1, #0x11000000
\r
482 bne reg2_error_loopf
\r
484 cmp r0, #0x22000000
\r
485 bne reg2_error_loopf
\r
486 cmp r1, #0x33000000
\r
487 bne reg2_error_loopf
\r
489 cmp r0, #0x44000000
\r
490 bne reg2_error_loopf
\r
491 cmp r1, #0x55000000
\r
492 bne reg2_error_loopf
\r
494 cmp r0, #0x66000000
\r
495 bne reg2_error_loopf
\r
496 cmp r1, #0x77000000
\r
497 bne reg2_error_loopf
\r
499 cmp r0, #0x88000000
\r
500 bne reg2_error_loopf
\r
501 cmp r1, #0x99000000
\r
502 bne reg2_error_loopf
\r
504 cmp r0, #0xAA000000
\r
505 bne reg2_error_loopf
\r
506 cmp r1, #0xBB000000
\r
507 bne reg2_error_loopf
\r
509 cmp r0, #0xFF000000
\r
510 bne reg2_error_loopf
\r
511 cmp r1, #0x11000000
\r
512 bne reg2_error_loopf
\r
514 cmp r0, #0x22000000
\r
515 bne reg2_error_loopf
\r
516 cmp r1, #0x33000000
\r
517 bne reg2_error_loopf
\r
519 cmp r0, #0x44000000
\r
520 bne reg2_error_loopf
\r
521 cmp r1, #0x55000000
\r
522 bne reg2_error_loopf
\r
524 cmp r0, #0x66000000
\r
525 bne reg2_error_loopf
\r
526 cmp r1, #0x77000000
\r
527 bne reg2_error_loopf
\r
529 cmp r0, #0x88000000
\r
530 bne reg2_error_loopf
\r
531 cmp r1, #0x99000000
\r
532 bne reg2_error_loopf
\r
534 cmp r0, #0xAA000000
\r
535 bne reg2_error_loopf
\r
536 cmp r1, #0xBB000000
\r
537 bne reg2_error_loopf
\r
539 cmp r0, #0xFF000000
\r
540 bne reg2_error_loopf
\r
541 cmp r1, #0x11000000
\r
542 bne reg2_error_loopf
\r
544 cmp r0, #0x22000000
\r
545 bne reg2_error_loopf
\r
546 cmp r1, #0x33000000
\r
547 bne reg2_error_loopf
\r
549 cmp r0, #0x44000000
\r
550 bne reg2_error_loopf
\r
551 cmp r1, #0x55000000
\r
552 bne reg2_error_loopf
\r
554 cmp r0, #0x66000000
\r
555 bne reg2_error_loopf
\r
556 cmp r1, #0x77000000
\r
557 bne reg2_error_loopf
\r
559 ; Restore the registers that were clobbered by the test.
\r
562 ; VFP register test passed. Jump to the core register test.
\r
566 ; If this line is hit then a VFP register value was found to be
\r
572 cmp r0, #0xFF000000
\r
573 bne reg2_error_loop
\r
574 cmp r1, #0x11000000
\r
575 bne reg2_error_loop
\r
576 cmp r2, #0x22000000
\r
577 bne reg2_error_loop
\r
578 cmp r3, #0x33000000
\r
579 bne reg2_error_loop
\r
580 cmp r4, #0x44000000
\r
581 bne reg2_error_loop
\r
582 cmp r5, #0x55000000
\r
583 bne reg2_error_loop
\r
584 cmp r6, #0x66000000
\r
585 bne reg2_error_loop
\r
586 cmp r7, #0x77000000
\r
587 bne reg2_error_loop
\r
588 cmp r8, #0x88000000
\r
589 bne reg2_error_loop
\r
590 cmp r9, #0x99000000
\r
591 bne reg2_error_loop
\r
592 cmp r10, #0xAA000000
\r
593 bne reg2_error_loop
\r
594 cmp r11, #0xBB000000
\r
595 bne reg2_error_loop
\r
596 cmp r12, #0xCC000000
\r
597 bne reg2_error_loop
\r
598 cmp r14, #0xEE000000
\r
599 bne reg2_error_loop
\r
601 ; Everything passed, increment the loop counter.
\r
603 ldr r0, =ulRegTest2LoopCounter
\r
613 ; If this line is hit then there was an error in a core register value.
\r
614 ; The loop ensures the loop counter stops incrementing.
\r