2 * FreeRTOS Kernel V10.0.0
\r
3 * Copyright (C) 2017 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. If you wish to use our Amazon
\r
14 * FreeRTOS name, please do so in a fair use way that does not cause confusion.
\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 * http://www.FreeRTOS.org
\r
24 * http://aws.amazon.com/freertos
\r
26 * 1 tab == 4 spaces!
\r
29 .global vRegTest1Implementation
\r
30 .global vRegTest2Implementation
\r
31 .extern ulRegTest1LoopCounter
\r
32 .extern ulRegTest2LoopCounter
\r
37 /* This function is explained in the comments at the top of main-full.c. */
\r
38 .type vRegTest1Implementation, %function
\r
39 vRegTest1Implementation:
\r
41 /* Fill each general purpose register with a known value. */
\r
57 /* Fill each FPU register with a known value. */
\r
92 /* Loop, checking each iteration that each register still contains the
\r
95 /* Yield to increase test coverage */
\r
98 /* Check all the VFP registers still contain the values set above.
\r
99 First save registers that are clobbered by the test. */
\r
104 bne reg1_error_loopf
\r
106 bne reg1_error_loopf
\r
109 bne reg1_error_loopf
\r
111 bne reg1_error_loopf
\r
114 bne reg1_error_loopf
\r
116 bne reg1_error_loopf
\r
119 bne reg1_error_loopf
\r
121 bne reg1_error_loopf
\r
124 bne reg1_error_loopf
\r
126 bne reg1_error_loopf
\r
129 bne reg1_error_loopf
\r
131 bne reg1_error_loopf
\r
134 bne reg1_error_loopf
\r
136 bne reg1_error_loopf
\r
139 bne reg1_error_loopf
\r
141 bne reg1_error_loopf
\r
144 bne reg1_error_loopf
\r
146 bne reg1_error_loopf
\r
149 bne reg1_error_loopf
\r
151 bne reg1_error_loopf
\r
154 bne reg1_error_loopf
\r
156 bne reg1_error_loopf
\r
159 bne reg1_error_loopf
\r
161 bne reg1_error_loopf
\r
164 bne reg1_error_loopf
\r
166 bne reg1_error_loopf
\r
169 bne reg1_error_loopf
\r
171 bne reg1_error_loopf
\r
174 bne reg1_error_loopf
\r
176 bne reg1_error_loopf
\r
179 bne reg1_error_loopf
\r
181 bne reg1_error_loopf
\r
185 bne reg1_error_loopf
\r
187 bne reg1_error_loopf
\r
190 bne reg1_error_loopf
\r
192 bne reg1_error_loopf
\r
195 bne reg1_error_loopf
\r
197 bne reg1_error_loopf
\r
200 bne reg1_error_loopf
\r
202 bne reg1_error_loopf
\r
205 bne reg1_error_loopf
\r
207 bne reg1_error_loopf
\r
210 bne reg1_error_loopf
\r
212 bne reg1_error_loopf
\r
215 bne reg1_error_loopf
\r
217 bne reg1_error_loopf
\r
220 bne reg1_error_loopf
\r
222 bne reg1_error_loopf
\r
225 bne reg1_error_loopf
\r
227 bne reg1_error_loopf
\r
230 bne reg1_error_loopf
\r
232 bne reg1_error_loopf
\r
235 bne reg1_error_loopf
\r
237 bne reg1_error_loopf
\r
240 bne reg1_error_loopf
\r
242 bne reg1_error_loopf
\r
245 bne reg1_error_loopf
\r
247 bne reg1_error_loopf
\r
250 bne reg1_error_loopf
\r
252 bne reg1_error_loopf
\r
255 bne reg1_error_loopf
\r
257 bne reg1_error_loopf
\r
260 bne reg1_error_loopf
\r
262 bne reg1_error_loopf
\r
264 /* Restore the registers that were clobbered by the test. */
\r
267 /* VFP register test passed. Jump to the core register test. */
\r
271 /* If this line is hit then a VFP register value was found to be
\r
277 /* Test each general purpose register to check that it still contains the
\r
278 expected known value, jumping to reg1_error_loop if any register contains
\r
279 an unexpected value. */
\r
281 bne reg1_error_loop
\r
283 bne reg1_error_loop
\r
285 bne reg1_error_loop
\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 /* Everything passed, increment the loop counter. */
\r
311 ldr r0, =ulRegTest1LoopCounter
\r
321 /* If this line is hit then there was an error in a core register value.
\r
322 The loop ensures the loop counter stops incrementing. */
\r
326 /*-----------------------------------------------------------*/
\r
328 .type vRegTest2Implementation, %function
\r
329 vRegTest2Implementation:
\r
331 /* Put a known value in each register. */
\r
332 mov r0, #0xFF000000
\r
333 mov r1, #0x11000000
\r
334 mov r2, #0x22000000
\r
335 mov r3, #0x33000000
\r
336 mov r4, #0x44000000
\r
337 mov r5, #0x55000000
\r
338 mov r6, #0x66000000
\r
339 mov r7, #0x77000000
\r
340 mov r8, #0x88000000
\r
341 mov r9, #0x99000000
\r
342 mov r10, #0xAA000000
\r
343 mov r11, #0xBB000000
\r
344 mov r12, #0xCC000000
\r
345 mov r14, #0xEE000000
\r
347 /* Likewise the floating point registers */
\r
382 /* Loop, checking each iteration that each register still contains the
\r
385 /* Check all the VFP registers still contain the values set above.
\r
386 First save registers that are clobbered by the test. */
\r
390 cmp r0, #0xFF000000
\r
391 bne reg2_error_loopf
\r
392 cmp r1, #0x11000000
\r
393 bne reg2_error_loopf
\r
395 cmp r0, #0x22000000
\r
396 bne reg2_error_loopf
\r
397 cmp r1, #0x33000000
\r
398 bne reg2_error_loopf
\r
400 cmp r0, #0x44000000
\r
401 bne reg2_error_loopf
\r
402 cmp r1, #0x55000000
\r
403 bne reg2_error_loopf
\r
405 cmp r0, #0x66000000
\r
406 bne reg2_error_loopf
\r
407 cmp r1, #0x77000000
\r
408 bne reg2_error_loopf
\r
410 cmp r0, #0x88000000
\r
411 bne reg2_error_loopf
\r
412 cmp r1, #0x99000000
\r
413 bne reg2_error_loopf
\r
415 cmp r0, #0xAA000000
\r
416 bne reg2_error_loopf
\r
417 cmp r1, #0xBB000000
\r
418 bne reg2_error_loopf
\r
420 cmp r0, #0xFF000000
\r
421 bne reg2_error_loopf
\r
422 cmp r1, #0x11000000
\r
423 bne reg2_error_loopf
\r
425 cmp r0, #0x22000000
\r
426 bne reg2_error_loopf
\r
427 cmp r1, #0x33000000
\r
428 bne reg2_error_loopf
\r
430 cmp r0, #0x44000000
\r
431 bne reg2_error_loopf
\r
432 cmp r1, #0x55000000
\r
433 bne reg2_error_loopf
\r
435 cmp r0, #0x66000000
\r
436 bne reg2_error_loopf
\r
437 cmp r1, #0x77000000
\r
438 bne reg2_error_loopf
\r
440 cmp r0, #0x88000000
\r
441 bne reg2_error_loopf
\r
442 cmp r1, #0x99000000
\r
443 bne reg2_error_loopf
\r
445 cmp r0, #0xAA000000
\r
446 bne reg2_error_loopf
\r
447 cmp r1, #0xBB000000
\r
448 bne reg2_error_loopf
\r
450 cmp r0, #0xFF000000
\r
451 bne reg2_error_loopf
\r
452 cmp r1, #0x11000000
\r
453 bne reg2_error_loopf
\r
455 cmp r0, #0x22000000
\r
456 bne reg2_error_loopf
\r
457 cmp r1, #0x33000000
\r
458 bne reg2_error_loopf
\r
460 cmp r0, #0x44000000
\r
461 bne reg2_error_loopf
\r
462 cmp r1, #0x55000000
\r
463 bne reg2_error_loopf
\r
465 cmp r0, #0x66000000
\r
466 bne reg2_error_loopf
\r
467 cmp r1, #0x77000000
\r
468 bne reg2_error_loopf
\r
471 cmp r0, #0xFF000000
\r
472 bne reg2_error_loopf
\r
473 cmp r1, #0x11000000
\r
474 bne reg2_error_loopf
\r
476 cmp r0, #0x22000000
\r
477 bne reg2_error_loopf
\r
478 cmp r1, #0x33000000
\r
479 bne reg2_error_loopf
\r
481 cmp r0, #0x44000000
\r
482 bne reg2_error_loopf
\r
483 cmp r1, #0x55000000
\r
484 bne reg2_error_loopf
\r
486 cmp r0, #0x66000000
\r
487 bne reg2_error_loopf
\r
488 cmp r1, #0x77000000
\r
489 bne reg2_error_loopf
\r
491 cmp r0, #0x88000000
\r
492 bne reg2_error_loopf
\r
493 cmp r1, #0x99000000
\r
494 bne reg2_error_loopf
\r
496 cmp r0, #0xAA000000
\r
497 bne reg2_error_loopf
\r
498 cmp r1, #0xBB000000
\r
499 bne reg2_error_loopf
\r
501 cmp r0, #0xFF000000
\r
502 bne reg2_error_loopf
\r
503 cmp r1, #0x11000000
\r
504 bne reg2_error_loopf
\r
506 cmp r0, #0x22000000
\r
507 bne reg2_error_loopf
\r
508 cmp r1, #0x33000000
\r
509 bne reg2_error_loopf
\r
511 cmp r0, #0x44000000
\r
512 bne reg2_error_loopf
\r
513 cmp r1, #0x55000000
\r
514 bne reg2_error_loopf
\r
516 cmp r0, #0x66000000
\r
517 bne reg2_error_loopf
\r
518 cmp r1, #0x77000000
\r
519 bne reg2_error_loopf
\r
521 cmp r0, #0x88000000
\r
522 bne reg2_error_loopf
\r
523 cmp r1, #0x99000000
\r
524 bne reg2_error_loopf
\r
526 cmp r0, #0xAA000000
\r
527 bne reg2_error_loopf
\r
528 cmp r1, #0xBB000000
\r
529 bne reg2_error_loopf
\r
531 cmp r0, #0xFF000000
\r
532 bne reg2_error_loopf
\r
533 cmp r1, #0x11000000
\r
534 bne reg2_error_loopf
\r
536 cmp r0, #0x22000000
\r
537 bne reg2_error_loopf
\r
538 cmp r1, #0x33000000
\r
539 bne reg2_error_loopf
\r
541 cmp r0, #0x44000000
\r
542 bne reg2_error_loopf
\r
543 cmp r1, #0x55000000
\r
544 bne reg2_error_loopf
\r
546 cmp r0, #0x66000000
\r
547 bne reg2_error_loopf
\r
548 cmp r1, #0x77000000
\r
549 bne reg2_error_loopf
\r
551 /* Restore the registers that were clobbered by the test. */
\r
554 /* VFP register test passed. Jump to the core register test. */
\r
558 /* If this line is hit then a VFP register value was found to be
\r
564 cmp r0, #0xFF000000
\r
565 bne reg2_error_loop
\r
566 cmp r1, #0x11000000
\r
567 bne reg2_error_loop
\r
568 cmp r2, #0x22000000
\r
569 bne reg2_error_loop
\r
570 cmp r3, #0x33000000
\r
571 bne reg2_error_loop
\r
572 cmp r4, #0x44000000
\r
573 bne reg2_error_loop
\r
574 cmp r5, #0x55000000
\r
575 bne reg2_error_loop
\r
576 cmp r6, #0x66000000
\r
577 bne reg2_error_loop
\r
578 cmp r7, #0x77000000
\r
579 bne reg2_error_loop
\r
580 cmp r8, #0x88000000
\r
581 bne reg2_error_loop
\r
582 cmp r9, #0x99000000
\r
583 bne reg2_error_loop
\r
584 cmp r10, #0xAA000000
\r
585 bne reg2_error_loop
\r
586 cmp r11, #0xBB000000
\r
587 bne reg2_error_loop
\r
588 cmp r12, #0xCC000000
\r
589 bne reg2_error_loop
\r
590 cmp r14, #0xEE000000
\r
591 bne reg2_error_loop
\r
593 /* Everything passed, increment the loop counter. */
\r
595 ldr r0, =ulRegTest2LoopCounter
\r
605 /* If this line is hit then there was an error in a core register value.
\r
606 The loop ensures the loop counter stops incrementing. */
\r