2 FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.
\r
5 ***************************************************************************
\r
7 * FreeRTOS tutorial books are available in pdf and paperback. *
\r
8 * Complete, revised, and edited pdf reference manuals are also *
\r
11 * Purchasing FreeRTOS documentation will not only help you, by *
\r
12 * ensuring you get running as quickly as possible and with an *
\r
13 * in-depth knowledge of how to use FreeRTOS, it will also help *
\r
14 * the FreeRTOS project to continue with its mission of providing *
\r
15 * professional grade, cross platform, de facto standard solutions *
\r
16 * for microcontrollers - completely free of charge! *
\r
18 * >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
\r
20 * Thank you for using FreeRTOS, and thank you for your support! *
\r
22 ***************************************************************************
\r
25 This file is part of the FreeRTOS distribution.
\r
27 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
28 the terms of the GNU General Public License (version 2) as published by the
\r
29 Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
\r
30 >>>NOTE<<< The modification to the GPL is included to allow you to
\r
31 distribute a combined work that includes FreeRTOS without being obliged to
\r
32 provide the source code for proprietary components outside of the FreeRTOS
\r
33 kernel. FreeRTOS is distributed in the hope that it will be useful, but
\r
34 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
\r
35 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
36 more details. You should have received a copy of the GNU General Public
\r
37 License and the FreeRTOS license exception along with FreeRTOS; if not it
\r
38 can be viewed here: http://www.freertos.org/a00114.html and also obtained
\r
39 by writing to Richard Barry, contact details for whom are available on the
\r
44 ***************************************************************************
\r
46 * Having a problem? Start by reading the FAQ "My application does *
\r
47 * not run, what could be wrong? *
\r
49 * http://www.FreeRTOS.org/FAQHelp.html *
\r
51 ***************************************************************************
\r
54 http://www.FreeRTOS.org - Documentation, training, latest information,
\r
55 license and contact details.
\r
57 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
\r
58 including FreeRTOS+Trace - an indispensable productivity tool.
\r
60 Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
\r
61 the code with commercial support, indemnification, and middleware, under
\r
62 the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
\r
63 provide a safety engineered and independently SIL3 certified version under
\r
64 the SafeRTOS brand: http://www.SafeRTOS.com.
\r
67 /******************************************************************************
\r
68 * NOTE 1: This project provides two demo applications. A simple blinky style
\r
69 * project, and a more comprehensive test and demo application. The
\r
70 * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY setting in main.c is used to select
\r
71 * between the two. See the notes on using mainCREATE_SIMPLE_BLINKY_DEMO_ONLY
\r
72 * in main.c. This file implements the comprehensive test and demo version.
\r
74 * NOTE 2: This file only contains the source code that is specific to the
\r
75 * full demo. Generic functions, such FreeRTOS hook functions, and functions
\r
76 * required to configure the hardware, are defined in main.c.
\r
77 ******************************************************************************
\r
79 * main_full() creates all the demo application tasks and a software timer, then
\r
80 * starts the scheduler. The web documentation provides more details of the
\r
81 * standard demo application tasks, which provide no particular functionality,
\r
82 * but do provide a good example of how to use the FreeRTOS API.
\r
84 * In addition to the standard demo tasks, the following tasks and tests are
\r
85 * defined and/or created within this file:
\r
87 * "Reg test" tasks - These fill both the core and floating point registers with
\r
88 * known values, then check that each register maintains its expected value for
\r
89 * the lifetime of the task. Each task uses a different set of values. The reg
\r
90 * test tasks execute with a very low priority, so get preempted very
\r
91 * frequently. A register containing an unexpected value is indicative of an
\r
92 * error in the context switching mechanism.
\r
94 * "Check" timer - The check software timer period is initially set to three
\r
95 * seconds. The callback function associated with the check software timer
\r
96 * checks that all the standard demo tasks, and the register check tasks, are
\r
97 * not only still executing, but are executing without reporting any errors. If
\r
98 * the check software timer discovers that a task has either stalled, or
\r
99 * reported an error, then it changes its own execution period from the initial
\r
100 * three seconds, to just 200ms. The check software timer callback function
\r
101 * also toggles the single LED each time it is called. This provides a visual
\r
102 * indication of the system status: If the LED toggles every three seconds,
\r
103 * then no issues have been discovered. If the LED toggles every 200ms, then
\r
104 * an issue has been discovered with at least one task.
\r
107 /* Standard includes. */
\r
110 /* Kernel includes. */
\r
111 #include "FreeRTOS.h"
\r
113 #include "timers.h"
\r
114 #include "semphr.h"
\r
116 /* Standard demo application includes. */
\r
118 #include "integer.h"
\r
120 #include "semtest.h"
\r
121 #include "dynamic.h"
\r
122 #include "BlockQ.h"
\r
123 #include "blocktim.h"
\r
124 #include "countsem.h"
\r
125 #include "GenQTest.h"
\r
126 #include "recmutex.h"
\r
129 /* Hardware includes. */
\r
130 #include "XMC4500.h"
\r
131 #include "System_XMC4500.h"
\r
133 /* Priorities for the demo application tasks. */
\r
134 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2UL )
\r
135 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1UL )
\r
136 #define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2UL )
\r
137 #define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3UL )
\r
138 #define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY )
\r
140 /* To toggle the single LED */
\r
141 #define mainTOGGLE_LED() ( PORT3->OMR = 0x02000200 )
\r
143 /* A block time of zero simply means "don't block". */
\r
144 #define mainDONT_BLOCK ( 0UL )
\r
146 /* The period after which the check timer will expire, in ms, provided no errors
\r
147 have been reported by any of the standard demo tasks. ms are converted to the
\r
148 equivalent in ticks using the portTICK_RATE_MS constant. */
\r
149 #define mainCHECK_TIMER_PERIOD_MS ( 3000UL / portTICK_RATE_MS )
\r
151 /* The period at which the check timer will expire, in ms, if an error has been
\r
152 reported in one of the standard demo tasks. ms are converted to the equivalent
\r
153 in ticks using the portTICK_RATE_MS constant. */
\r
154 #define mainERROR_CHECK_TIMER_PERIOD_MS ( 200UL / portTICK_RATE_MS )
\r
156 /*-----------------------------------------------------------*/
\r
159 * The check timer callback function, as described at the top of this file.
\r
161 static void prvCheckTimerCallback( xTimerHandle xTimer );
\r
164 * Register check tasks, and the tasks used to write over and check the contents
\r
165 * of the FPU registers, as described at the top of this file. The nature of
\r
166 * these files necessitates that they are written in an assembly file.
\r
168 static void vRegTest1Task( void *pvParameters ) __attribute__((naked));
\r
169 static void vRegTest2Task( void *pvParameters ) __attribute__((naked));
\r
171 /*-----------------------------------------------------------*/
\r
173 /* The following two variables are used to communicate the status of the
\r
174 register check tasks to the check software timer. If the variables keep
\r
175 incrementing, then the register check tasks has not discovered any errors. If
\r
176 a variable stops incrementing, then an error has been found. */
\r
177 volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL;
\r
179 /*-----------------------------------------------------------*/
\r
181 void main_full( void )
\r
183 xTimerHandle xCheckTimer = NULL;
\r
185 /* Start all the other standard demo/test tasks. The have not particular
\r
186 functionality, but do demonstrate how to use the FreeRTOS API and test the
\r
188 vStartIntegerMathTasks( tskIDLE_PRIORITY );
\r
189 vStartDynamicPriorityTasks();
\r
190 vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
\r
191 vCreateBlockTimeTasks();
\r
192 vStartCountingSemaphoreTasks();
\r
193 vStartGenericQueueTasks( tskIDLE_PRIORITY );
\r
194 vStartRecursiveMutexTasks();
\r
195 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
\r
196 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
197 vStartMathTasks( mainFLOP_TASK_PRIORITY );
\r
199 /* Create the register check tasks, as described at the top of this
\r
201 xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );
\r
202 xTaskCreate( vRegTest2Task, ( signed char * ) "Reg2", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );
\r
204 /* Create the software timer that performs the 'check' functionality,
\r
205 as described at the top of this file. */
\r
206 xCheckTimer = xTimerCreate( ( const signed char * ) "CheckTimer",/* A text name, purely to help debugging. */
\r
207 ( mainCHECK_TIMER_PERIOD_MS ), /* The timer period, in this case 3000ms (3s). */
\r
208 pdTRUE, /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */
\r
209 ( void * ) 0, /* The ID is not used, so can be set to anything. */
\r
210 prvCheckTimerCallback /* The callback function that inspects the status of all the other tasks. */
\r
213 if( xCheckTimer != NULL )
\r
215 xTimerStart( xCheckTimer, mainDONT_BLOCK );
\r
218 /* The set of tasks created by the following function call have to be
\r
219 created last as they keep account of the number of tasks they expect to see
\r
221 vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
\r
223 /* Start the scheduler. */
\r
224 vTaskStartScheduler();
\r
226 /* If all is well, the scheduler will now be running, and the following line
\r
227 will never be reached. If the following line does execute, then there was
\r
228 insufficient FreeRTOS heap memory available for the idle and/or timer tasks
\r
229 to be created. See the memory management section on the FreeRTOS web site
\r
230 for more details. */
\r
233 /*-----------------------------------------------------------*/
\r
235 static void prvCheckTimerCallback( xTimerHandle xTimer )
\r
237 static long lChangedTimerPeriodAlready = pdFALSE;
\r
238 static unsigned long ulLastRegTest1Value = 0, ulLastRegTest2Value = 0;
\r
239 unsigned long ulErrorFound = pdFALSE;
\r
241 /* Check all the demo tasks (other than the flash tasks) to ensure
\r
242 that they are all still running, and that none have detected an error. */
\r
244 if( xAreMathsTaskStillRunning() != pdTRUE )
\r
246 ulErrorFound = pdTRUE;
\r
249 if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
251 ulErrorFound = pdTRUE;
\r
254 if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
\r
256 ulErrorFound = pdTRUE;
\r
259 if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
261 ulErrorFound = pdTRUE;
\r
264 if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
266 ulErrorFound = pdTRUE;
\r
269 if ( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
271 ulErrorFound = pdTRUE;
\r
274 if ( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
276 ulErrorFound = pdTRUE;
\r
279 if( xIsCreateTaskStillRunning() != pdTRUE )
\r
281 ulErrorFound = pdTRUE;
\r
284 if( xArePollingQueuesStillRunning() != pdTRUE )
\r
286 ulErrorFound = pdTRUE;
\r
289 if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
291 ulErrorFound = pdTRUE;
\r
294 /* Check that the register test 1 task is still running. */
\r
295 if( ulLastRegTest1Value == ulRegTest1LoopCounter )
\r
297 ulErrorFound = pdTRUE;
\r
299 ulLastRegTest1Value = ulRegTest1LoopCounter;
\r
301 /* Check that the register test 2 task is still running. */
\r
302 if( ulLastRegTest2Value == ulRegTest2LoopCounter )
\r
304 ulErrorFound = pdTRUE;
\r
306 ulLastRegTest2Value = ulRegTest2LoopCounter;
\r
308 /* Toggle the check LED to give an indication of the system status. If
\r
309 the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then
\r
310 everything is ok. A faster toggle indicates an error. */
\r
313 /* Have any errors been latch in ulErrorFound? If so, shorten the
\r
314 period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.
\r
315 This will result in an increase in the rate at which mainCHECK_LED
\r
317 if( ulErrorFound != pdFALSE )
\r
319 if( lChangedTimerPeriodAlready == pdFALSE )
\r
321 lChangedTimerPeriodAlready = pdTRUE;
\r
323 /* This call to xTimerChangePeriod() uses a zero block time.
\r
324 Functions called from inside of a timer callback function must
\r
325 *never* attempt to block. */
\r
326 xTimerChangePeriod( xTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );
\r
330 /*-----------------------------------------------------------*/
\r
332 /* This is a naked function. */
\r
333 static void vRegTest1Task( void *pvParameters )
\r
337 " /* Fill the core registers with known values. */ \n"
\r
348 " mov r10, #110 \n"
\r
349 " mov r11, #111 \n"
\r
350 " mov r12, #112 \n"
\r
352 " /* Fill the VFP registers with known values. */ \n"
\r
353 " vmov d0, r0, r1 \n"
\r
354 " vmov d1, r2, r3 \n"
\r
355 " vmov d2, r4, r5 \n"
\r
356 " vmov d3, r6, r7 \n"
\r
357 " vmov d4, r8, r9 \n"
\r
358 " vmov d5, r10, r11 \n"
\r
359 " vmov d6, r0, r1 \n"
\r
360 " vmov d7, r2, r3 \n"
\r
361 " vmov d8, r4, r5 \n"
\r
362 " vmov d9, r6, r7 \n"
\r
363 " vmov d10, r8, r9 \n"
\r
364 " vmov d11, r10, r11 \n"
\r
365 " vmov d12, r0, r1 \n"
\r
366 " vmov d13, r2, r3 \n"
\r
367 " vmov d14, r4, r5 \n"
\r
368 " vmov d15, r6, r7 \n"
\r
371 " /* Check all the VFP registers still contain the values set above.\n"
\r
372 " First save registers that are clobbered by the test. */ \n"
\r
373 " push { r0-r1 } \n"
\r
375 " vmov r0, r1, d0 \n"
\r
377 " bne reg1_error_loopf \n"
\r
379 " bne reg1_error_loopf \n"
\r
380 " vmov r0, r1, d1 \n"
\r
382 " bne reg1_error_loopf \n"
\r
384 " bne reg1_error_loopf \n"
\r
385 " vmov r0, r1, d2 \n"
\r
387 " bne reg1_error_loopf \n"
\r
389 " bne reg1_error_loopf \n"
\r
390 " vmov r0, r1, d3 \n"
\r
392 " bne reg1_error_loopf \n"
\r
394 " bne reg1_error_loopf \n"
\r
395 " vmov r0, r1, d4 \n"
\r
397 " bne reg1_error_loopf \n"
\r
399 " bne reg1_error_loopf \n"
\r
400 " vmov r0, r1, d5 \n"
\r
402 " bne reg1_error_loopf \n"
\r
404 " bne reg1_error_loopf \n"
\r
405 " vmov r0, r1, d6 \n"
\r
407 " bne reg1_error_loopf \n"
\r
409 " bne reg1_error_loopf \n"
\r
410 " vmov r0, r1, d7 \n"
\r
412 " bne reg1_error_loopf \n"
\r
414 " bne reg1_error_loopf \n"
\r
415 " vmov r0, r1, d8 \n"
\r
417 " bne reg1_error_loopf \n"
\r
419 " bne reg1_error_loopf \n"
\r
420 " vmov r0, r1, d9 \n"
\r
422 " bne reg1_error_loopf \n"
\r
424 " bne reg1_error_loopf \n"
\r
425 " vmov r0, r1, d10 \n"
\r
427 " bne reg1_error_loopf \n"
\r
429 " bne reg1_error_loopf \n"
\r
430 " vmov r0, r1, d11 \n"
\r
432 " bne reg1_error_loopf \n"
\r
434 " bne reg1_error_loopf \n"
\r
435 " vmov r0, r1, d12 \n"
\r
437 " bne reg1_error_loopf \n"
\r
439 " bne reg1_error_loopf \n"
\r
440 " vmov r0, r1, d13 \n"
\r
442 " bne reg1_error_loopf \n"
\r
444 " bne reg1_error_loopf \n"
\r
445 " vmov r0, r1, d14 \n"
\r
447 " bne reg1_error_loopf \n"
\r
449 " bne reg1_error_loopf \n"
\r
450 " vmov r0, r1, d15 \n"
\r
452 " bne reg1_error_loopf \n"
\r
454 " bne reg1_error_loopf \n"
\r
456 " /* Restore the registers that were clobbered by the test. */\n"
\r
459 " /* VFP register test passed. Jump to the core register test. */\n"
\r
460 " b reg1_loopf_pass \n"
\r
462 "reg1_error_loopf: \n"
\r
463 " /* If this line is hit then a VFP register value was found to be\n"
\r
464 " incorrect. */ \n"
\r
465 " b reg1_error_loopf \n"
\r
467 "reg1_loopf_pass: \n"
\r
470 " bne reg1_error_loop \n"
\r
472 " bne reg1_error_loop \n"
\r
474 " bne reg1_error_loop \n"
\r
476 " bne reg1_error_loop \n"
\r
478 " bne reg1_error_loop \n"
\r
480 " bne reg1_error_loop \n"
\r
482 " bne reg1_error_loop \n"
\r
484 " bne reg1_error_loop \n"
\r
486 " bne reg1_error_loop \n"
\r
488 " bne reg1_error_loop \n"
\r
489 " cmp r10, #110 \n"
\r
490 " bne reg1_error_loop \n"
\r
491 " cmp r11, #111 \n"
\r
492 " bne reg1_error_loop \n"
\r
493 " cmp r12, #112 \n"
\r
494 " bne reg1_error_loop \n"
\r
496 " /* Everything passed, increment the loop counter. */ \n"
\r
497 " push { r0-r1 } \n"
\r
498 " ldr r0, =ulRegTest1LoopCounter \n"
\r
500 " adds r1, r1, #1 \n"
\r
502 " pop { r0-r1 } \n"
\r
504 " /* Start again. */ \n"
\r
507 "reg1_error_loop: \n"
\r
508 " /* If this line is hit then there was an error in a core register value.\n"
\r
509 " The loop ensures the loop counter stops incrementing. */\n"
\r
510 " b reg1_error_loop \n"
\r
514 /*-----------------------------------------------------------*/
\r
516 /* This is a naked function. */
\r
517 static void vRegTest2Task( void *pvParameters )
\r
521 " /* Set all the core registers to known values. */ \n"
\r
536 " /* Set all the VFP to known values. */ \n"
\r
537 " vmov d0, r0, r1 \n"
\r
538 " vmov d1, r2, r3 \n"
\r
539 " vmov d2, r4, r5 \n"
\r
540 " vmov d3, r6, r7 \n"
\r
541 " vmov d4, r8, r9 \n"
\r
542 " vmov d5, r10, r11 \n"
\r
543 " vmov d6, r0, r1 \n"
\r
544 " vmov d7, r2, r3 \n"
\r
545 " vmov d8, r4, r5 \n"
\r
546 " vmov d9, r6, r7 \n"
\r
547 " vmov d10, r8, r9 \n"
\r
548 " vmov d11, r10, r11 \n"
\r
549 " vmov d12, r0, r1 \n"
\r
550 " vmov d13, r2, r3 \n"
\r
551 " vmov d14, r4, r5 \n"
\r
552 " vmov d15, r6, r7 \n"
\r
556 " /* Check all the VFP registers still contain the values set above.\n"
\r
557 " First save registers that are clobbered by the test. */ \n"
\r
558 " push { r0-r1 } \n"
\r
560 " vmov r0, r1, d0 \n"
\r
562 " bne reg2_error_loopf \n"
\r
564 " bne reg2_error_loopf \n"
\r
565 " vmov r0, r1, d1 \n"
\r
567 " bne reg2_error_loopf \n"
\r
569 " bne reg2_error_loopf \n"
\r
570 " vmov r0, r1, d2 \n"
\r
572 " bne reg2_error_loopf \n"
\r
574 " bne reg2_error_loopf \n"
\r
575 " vmov r0, r1, d3 \n"
\r
577 " bne reg2_error_loopf \n"
\r
579 " bne reg2_error_loopf \n"
\r
580 " vmov r0, r1, d4 \n"
\r
582 " bne reg2_error_loopf \n"
\r
584 " bne reg2_error_loopf \n"
\r
585 " vmov r0, r1, d5 \n"
\r
587 " bne reg2_error_loopf \n"
\r
589 " bne reg2_error_loopf \n"
\r
590 " vmov r0, r1, d6 \n"
\r
592 " bne reg2_error_loopf \n"
\r
594 " bne reg2_error_loopf \n"
\r
595 " vmov r0, r1, d7 \n"
\r
597 " bne reg2_error_loopf \n"
\r
599 " bne reg2_error_loopf \n"
\r
600 " vmov r0, r1, d8 \n"
\r
602 " bne reg2_error_loopf \n"
\r
604 " bne reg2_error_loopf \n"
\r
605 " vmov r0, r1, d9 \n"
\r
607 " bne reg2_error_loopf \n"
\r
609 " bne reg2_error_loopf \n"
\r
610 " vmov r0, r1, d10 \n"
\r
612 " bne reg2_error_loopf \n"
\r
614 " bne reg2_error_loopf \n"
\r
615 " vmov r0, r1, d11 \n"
\r
617 " bne reg2_error_loopf \n"
\r
619 " bne reg2_error_loopf \n"
\r
620 " vmov r0, r1, d12 \n"
\r
622 " bne reg2_error_loopf \n"
\r
624 " bne reg2_error_loopf \n"
\r
625 " vmov r0, r1, d13 \n"
\r
627 " bne reg2_error_loopf \n"
\r
629 " bne reg2_error_loopf \n"
\r
630 " vmov r0, r1, d14 \n"
\r
632 " bne reg2_error_loopf \n"
\r
634 " bne reg2_error_loopf \n"
\r
635 " vmov r0, r1, d15 \n"
\r
637 " bne reg2_error_loopf \n"
\r
639 " bne reg2_error_loopf \n"
\r
641 " /* Restore the registers that were clobbered by the test. */\n"
\r
644 " /* VFP register test passed. Jump to the core register test. */\n"
\r
645 " b reg2_loopf_pass \n"
\r
647 "reg2_error_loopf: \n"
\r
648 " /* If this line is hit then a VFP register value was found to be\n"
\r
649 " incorrect. */ \n"
\r
650 " b reg2_error_loopf \n"
\r
652 "reg2_loopf_pass: \n"
\r
655 " bne reg2_error_loop \n"
\r
657 " bne reg2_error_loop \n"
\r
659 " bne reg2_error_loop \n"
\r
661 " bne reg2_error_loop \n"
\r
663 " bne reg2_error_loop \n"
\r
665 " bne reg2_error_loop \n"
\r
667 " bne reg2_error_loop \n"
\r
669 " bne reg2_error_loop \n"
\r
671 " bne reg2_error_loop \n"
\r
673 " bne reg2_error_loop \n"
\r
675 " bne reg2_error_loop \n"
\r
677 " bne reg2_error_loop \n"
\r
679 " bne reg2_error_loop \n"
\r
681 " /* Increment the loop counter to indicate this test is still functioning\n"
\r
682 " correctly. */ \n"
\r
683 " push { r0-r1 } \n"
\r
684 " ldr r0, =ulRegTest2LoopCounter \n"
\r
686 " adds r1, r1, #1 \n"
\r
688 " pop { r0-r1 } \n"
\r
690 " /* Start again. */ \n"
\r
693 "reg2_error_loop: \n"
\r
694 " /* If this line is hit then there was an error in a core register value.\n"
\r
695 " This loop ensures the loop counter variable stops incrementing. */\n"
\r
696 " b reg2_error_loop \n"
\r