]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/RX100-RSK_GCC_e2studio/RTOSDemo/main_full.c
dc05898012817c7b1fd2b7b6c68da1a92468ee40
[freertos] / FreeRTOS / Demo / RX100-RSK_GCC_e2studio / RTOSDemo / main_full.c
1 /*\r
2     FreeRTOS V8.0.1 - Copyright (C) 2014 Real Time Engineers Ltd. \r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     ***************************************************************************\r
8      *                                                                       *\r
9      *    FreeRTOS provides completely free yet professionally developed,    *\r
10      *    robust, strictly quality controlled, supported, and cross          *\r
11      *    platform software that has become a de facto standard.             *\r
12      *                                                                       *\r
13      *    Help yourself get started quickly and support the FreeRTOS         *\r
14      *    project by purchasing a FreeRTOS tutorial book, reference          *\r
15      *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
16      *                                                                       *\r
17      *    Thank you!                                                         *\r
18      *                                                                       *\r
19     ***************************************************************************\r
20 \r
21     This file is part of the FreeRTOS distribution.\r
22 \r
23     FreeRTOS is free software; you can redistribute it and/or modify it under\r
24     the terms of the GNU General Public License (version 2) as published by the\r
25     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
26 \r
27     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
28     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
29     >>!   obliged to provide the source code for proprietary components     !<<\r
30     >>!   outside of the FreeRTOS kernel.                                   !<<\r
31 \r
32     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
33     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
34     FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
35     link: http://www.freertos.org/a00114.html\r
36 \r
37     1 tab == 4 spaces!\r
38 \r
39     ***************************************************************************\r
40      *                                                                       *\r
41      *    Having a problem?  Start by reading the FAQ "My application does   *\r
42      *    not run, what could be wrong?"                                     *\r
43      *                                                                       *\r
44      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
45      *                                                                       *\r
46     ***************************************************************************\r
47 \r
48     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
49     license and Real Time Engineers Ltd. contact details.\r
50 \r
51     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
52     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
53     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
54 \r
55     http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
56     Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
57     licenses offer ticketed support, indemnification and middleware.\r
58 \r
59     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
60     engineered and independently SIL3 certified version for use in safety and\r
61     mission critical applications that require provable dependability.\r
62 \r
63     1 tab == 4 spaces!\r
64 */\r
65 \r
66 /* ****************************************************************************\r
67  * This project includes a lot of tasks and tests and is therefore complex.\r
68  * If you would prefer a much simpler project to get started with then select\r
69  * the 'low power' demo by setting configCREATE_LOW_POWER_DEMO to 1 in\r
70  * FreeRTOSConfig.h.  When configCREATE_LOW_POWER_DEMO is set to 1 main() will\r
71  * call main_low_power() instead of main_full().\r
72  * ****************************************************************************\r
73  *\r
74  * Creates all the demo application tasks, then starts the scheduler.  The web\r
75  * documentation provides more details of the standard demo application tasks,\r
76  * which provide no particular functionality but do provide a good example of\r
77  * how to use the FreeRTOS API.\r
78  *\r
79  * In addition to the standard demo tasks, the following tasks and tests are\r
80  * defined and/or created within this file:\r
81  *\r
82  * "Reg test" tasks - These fill the registers with known values, then\r
83  * repeatedly check that each register still contains its expected value for\r
84  * the lifetime of the tasks.  Each task uses different values.  The tasks run\r
85  * with very low priority so get preempted very frequently.  A check variable\r
86  * is incremented on each iteration of the test loop.  A register containing an\r
87  * unexpected value is indicative of an error in the context switching\r
88  * mechanism and will result in a branch to a null loop - which in turn will\r
89  * prevent the check variable from incrementing any further and allow the check\r
90  * timer (described below) to determine that an error has occurred.  The nature\r
91  * of the reg test tasks necessitates that they are written in assembly code.\r
92  *\r
93  * "Check Timer" and Callback Function - The check timer period is initially\r
94  * set to three seconds.  The check timer callback function checks that all the\r
95  * standard demo tasks are not only still executing, but are executing without\r
96  * reporting any errors.  If the check timer discovers that a task has either\r
97  * stalled, or reported an error, then it changes its own period from the\r
98  * initial three seconds, to just 200ms.  The check timer callback function\r
99  * also toggles LED 0 each time it is called.  This provides a visual\r
100  * indication of the system status:  If the LED toggles every three seconds,\r
101  * then no issues have been discovered.  If the LED toggles every 200ms, then\r
102  * an issue has been discovered with at least one task.\r
103  *\r
104  * *NOTE 1* The CPU must be in Supervisor mode when the scheduler is started.\r
105  * The PowerON_Reset_PC() supplied in resetprg.c with this demo has\r
106  * Change_PSW_PM_to_UserMode() commented out to ensure this is the case.\r
107 */\r
108 \r
109 /* Standard includes. */\r
110 #include <string.h>\r
111 \r
112 /* Hardware specific includes. */\r
113 #include "iodefine.h"\r
114 \r
115 /* Kernel includes. */\r
116 #include "FreeRTOS.h"\r
117 #include "task.h"\r
118 #include "timers.h"\r
119 #include "semphr.h"\r
120 \r
121 /* Standard demo includes. */\r
122 #include "partest.h"\r
123 #include "death.h"\r
124 #include "blocktim.h"\r
125 #include "GenQTest.h"\r
126 #include "recmutex.h"\r
127 \r
128 /* The code in this file is only built when configCREATE_LOW_POWER_DEMO is set\r
129 to 0, otherwise the code in main_low_power.c is used. */\r
130 #if configCREATE_LOW_POWER_DEMO == 0\r
131 \r
132 \r
133 /* Values that are passed into the reg test tasks using the task parameter.\r
134 The tasks check that the values are passed in correctly. */\r
135 #define mainREG_TEST_1_PARAMETER        ( 0x12121212UL )\r
136 #define mainREG_TEST_2_PARAMETER        ( 0x12345678UL )\r
137 \r
138 /* Priorities at which the standard demo tasks are created. */\r
139 #define mainGEN_QUEUE_TASK_PRIORITY     ( tskIDLE_PRIORITY )\r
140 #define mainCREATOR_TASK_PRIORITY   ( tskIDLE_PRIORITY + 3 )\r
141 \r
142 /* The LED toggled by the check timer. */\r
143 #define mainCHECK_LED                           ( 0 )\r
144 \r
145 /* The period at which the check timer will expire, in ms, provided no errors\r
146 have been reported by any of the standard demo tasks.  ms are converted to the\r
147 equivalent in ticks using the portTICK_PERIOD_MS constant. */\r
148 #define mainCHECK_TIMER_PERIOD_MS                       ( 3000UL / portTICK_PERIOD_MS )\r
149 \r
150 /* The period at which the check timer will expire, in ms, if an error has been\r
151 reported in one of the standard demo tasks.  ms are converted to the equivalent\r
152 in ticks using the portTICK_PERIOD_MS constant. */\r
153 #define mainERROR_CHECK_TIMER_PERIOD_MS         ( 200UL / portTICK_PERIOD_MS )\r
154 \r
155 /* A block time of zero simple means "Don't Block". */\r
156 #define mainDONT_BLOCK                          ( 0UL )\r
157 \r
158 /*\r
159  * The reg test tasks as described at the top of this file.\r
160  */\r
161 static void prvRegTest1Task( void *pvParameters );\r
162 static void prvRegTest2Task( void *pvParameters );\r
163 \r
164 /*\r
165  * The actual implementation of the reg test functionality, which, because of\r
166  * the direct register access, have to be in assembly.\r
167  */\r
168 static void prvRegTest1Implementation( void ) __attribute__(( naked ));\r
169 static void prvRegTest2Implementation( void ) __attribute__(( naked ));\r
170 \r
171 /*\r
172  * The check timer callback function, as described at the top of this file.\r
173  */\r
174 static void prvCheckTimerCallback( TimerHandle_t xTimer );\r
175 \r
176 \r
177 /*-----------------------------------------------------------*/\r
178 \r
179 /* Variables that are incremented on each iteration of the reg test tasks -\r
180 provided the tasks have not reported any errors.  The check timer inspects these\r
181 variables to ensure they are still incrementing as expected.  If a variable\r
182 stops incrementing then it is likely that its associated task has stalled. */\r
183 unsigned long ulRegTest1CycleCount = 0UL, ulRegTest2CycleCount = 0UL;\r
184 \r
185 /* The check timer.  This uses prvCheckTimerCallback() as its callback\r
186 function. */\r
187 static TimerHandle_t xCheckTimer = NULL;\r
188 \r
189 /*-----------------------------------------------------------*/\r
190 \r
191 void main_full( void )\r
192 {\r
193         /* Start the reg test tasks which test the context switching mechanism. */\r
194         xTaskCreate( prvRegTest1Task, "RegTst1", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_1_PARAMETER, tskIDLE_PRIORITY, NULL );\r
195         xTaskCreate( prvRegTest2Task, "RegTst2", configMINIMAL_STACK_SIZE, ( void * ) mainREG_TEST_2_PARAMETER, tskIDLE_PRIORITY, NULL );\r
196 \r
197         /* Create the standard demo tasks. */\r
198         vCreateBlockTimeTasks();\r
199         vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
200         vStartRecursiveMutexTasks();\r
201 \r
202         /* The suicide tasks must be created last as they need to know how many\r
203         tasks were running prior to their creation in order to ascertain whether\r
204         or not the correct/expected number of tasks are running at any given time. */\r
205         vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
206 \r
207         /* Create the software timer that performs the 'check' functionality,\r
208         as described at the top of this file. */\r
209         xCheckTimer = xTimerCreate( "CheckTimer",/* A text name, purely to help debugging. */\r
210                                                                 ( mainCHECK_TIMER_PERIOD_MS ),          /* The timer period, in this case 5000ms (5s). */\r
211                                                                 pdTRUE,                                                         /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
212                                                                 ( void * ) 0,                                           /* The ID is not used, so can be set to anything. */\r
213                                                                 prvCheckTimerCallback                           /* The callback function that inspects the status of all the other tasks. */\r
214                                                           );\r
215 \r
216         configASSERT( xCheckTimer );\r
217 \r
218         /* Start the check timer.  It will actually start when the scheduler is\r
219         started. */\r
220         xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
221 \r
222         /* Start the tasks running. */\r
223         vTaskStartScheduler();\r
224 \r
225         /* If all is well execution will never reach here as the scheduler will be\r
226         running.  If this null loop is reached then it is likely there was\r
227         insufficient FreeRTOS heap available for the idle task and/or timer task to\r
228         be created.  See http://www.freertos.org/a00111.html. */\r
229         for( ;; );\r
230 }\r
231 /*-----------------------------------------------------------*/\r
232 \r
233 static void prvCheckTimerCallback( TimerHandle_t xTimer )\r
234 {\r
235 static long lChangedTimerPeriodAlready = pdFALSE, lErrorStatus = pdPASS;\r
236 static volatile unsigned long ulLastRegTest1CycleCount = 0UL, ulLastRegTest2CycleCount = 0UL;\r
237 \r
238         /* Remove compiler warnings about unused parameters. */\r
239         ( void ) xTimer;\r
240 \r
241         /* Check the standard demo tasks are running without error. */\r
242         if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
243         {\r
244                 lErrorStatus = pdFAIL;\r
245         }\r
246         else if( xIsCreateTaskStillRunning() != pdTRUE )\r
247         {\r
248                 lErrorStatus = pdFAIL;\r
249         }\r
250         else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
251         {\r
252                 lErrorStatus = pdFAIL;\r
253         }\r
254         else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
255         {\r
256                 lErrorStatus = pdFAIL;\r
257         }\r
258 \r
259         /* Check the reg test tasks are still cycling.  They will stop incrementing\r
260         their loop counters if they encounter an error. */\r
261         if( ulRegTest1CycleCount == ulLastRegTest1CycleCount )\r
262         {\r
263                 lErrorStatus = pdFAIL;\r
264         }\r
265 \r
266         if( ulRegTest2CycleCount == ulLastRegTest2CycleCount )\r
267         {\r
268                 lErrorStatus = pdFAIL;\r
269         }\r
270 \r
271         /* Remember the loop counter values this time around so they can be checked\r
272         again the next time this callback function executes. */\r
273         ulLastRegTest1CycleCount = ulRegTest1CycleCount;\r
274         ulLastRegTest2CycleCount = ulRegTest2CycleCount;\r
275 \r
276         /* Toggle the check LED to give an indication of the system status.  If\r
277         the LED toggles every three seconds then everything is ok.  A faster toggle\r
278         indicates an error. */\r
279         vParTestToggleLED( mainCHECK_LED );\r
280 \r
281         /* Was an error detected this time through the callback execution? */\r
282         if( lErrorStatus != pdPASS )\r
283         {\r
284                 if( lChangedTimerPeriodAlready == pdFALSE )\r
285                 {\r
286                         lChangedTimerPeriodAlready = pdTRUE;\r
287 \r
288                         /* This call to xTimerChangePeriod() uses a zero block time.\r
289                         Functions called from inside of a timer callback function must\r
290                         *never* attempt to block. */\r
291                         xTimerChangePeriod( xCheckTimer, ( mainERROR_CHECK_TIMER_PERIOD_MS ), mainDONT_BLOCK );\r
292                 }\r
293         }\r
294 }\r
295 /*-----------------------------------------------------------*/\r
296 \r
297 /* This function is explained in the comments at the top of this file. */\r
298 static void prvRegTest1Task( void *pvParameters )\r
299 {\r
300         if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_1_PARAMETER )\r
301         {\r
302                 /* The parameter did not contain the expected value. */\r
303                 for( ;; )\r
304                 {\r
305                         /* Stop the tick interrupt so its obvious something has gone wrong. */\r
306                         taskDISABLE_INTERRUPTS();\r
307                 }\r
308         }\r
309 \r
310         /* This is an inline asm function that never returns. */\r
311         prvRegTest1Implementation();\r
312 }\r
313 /*-----------------------------------------------------------*/\r
314 \r
315 /* This function is explained in the comments at the top of this file. */\r
316 static void prvRegTest2Task( void *pvParameters )\r
317 {\r
318         if( ( ( unsigned long ) pvParameters ) != mainREG_TEST_2_PARAMETER )\r
319         {\r
320                 /* The parameter did not contain the expected value. */\r
321                 for( ;; )\r
322                 {\r
323                         /* Stop the tick interrupt so its obvious something has gone wrong. */\r
324                         taskDISABLE_INTERRUPTS();\r
325                 }\r
326         }\r
327 \r
328         /* This is an inline asm function that never returns. */\r
329         prvRegTest2Implementation();\r
330 }\r
331 /*-----------------------------------------------------------*/\r
332 \r
333 /* This function is explained in the comments at the top of this file. */\r
334 static void prvRegTest1Implementation( void )\r
335 {\r
336         __asm volatile\r
337         (\r
338                 /* Set each register to a known value. */\r
339                 "       MOV.L   #0x33333333, R15                        \n\t"\r
340                 "       MVTACHI R15                                                     \n\t"\r
341                 "       MOV.L   #0x44444444, R15                        \n\t"\r
342                 "       MVTACLO R15                                                     \n\t"\r
343                 "       MOV.L   #1, R1                                          \n\t"\r
344                 "       MOV.L   #2, R2                                          \n\t"\r
345                 "       MOV.L   #3, R3                                          \n\t"\r
346                 "       MOV.L   #4, R4                                          \n\t"\r
347                 "       MOV.L   #5, R5                                          \n\t"\r
348                 "       MOV.L   #6, R6                                          \n\t"\r
349                 "       MOV.L   #7, R7                                          \n\t"\r
350                 "       MOV.L   #8, R8                                          \n\t"\r
351                 "       MOV.L   #9, R9                                          \n\t"\r
352                 "       MOV.L   #10, R10                                        \n\t"\r
353                 "       MOV.L   #11, R11                                        \n\t"\r
354                 "       MOV.L   #12, R12                                        \n\t"\r
355                 "       MOV.L   #13, R13                                        \n\t"\r
356                 "       MOV.L   #14, R14                                        \n\t"\r
357                 "       MOV.L   #15, R15                                        \n\t"\r
358                 "                                                                               \n\t"\r
359                 /* Loop, checking each iteration that each register still contains the\r
360                 expected value. */\r
361                 "TestLoop1:                                                             \n\t"\r
362                 "                                                                               \n\t"\r
363                 /* Push the registers that are going to get clobbered. */\r
364                 "       PUSHM   R14-R15                                         \n\t"\r
365                 "                                                                               \n\t"\r
366                 /* Increment the loop counter to show this task is still getting CPU\r
367                 time. */\r
368                 "       MOV.L   #_ulRegTest1CycleCount, R14     \n\t"\r
369                 "       MOV.L   [ R14 ], R15                            \n\t"\r
370                 "       ADD             #1, R15                                         \n\t"\r
371                 "       MOV.L   R15, [ R14 ]                            \n\t"\r
372                 "                                                                               \n\t"\r
373                 /* Yield to extend the text coverage.  Set the bit in the ITU SWINTR\r
374                 register. */\r
375                 "       MOV.L   #1, R14                                         \n\t"\r
376                 "       MOV.L   #0872E0H, R15                           \n\t"\r
377                 "       MOV.B   R14, [R15]                                      \n\t"\r
378                 "       NOP                                                                     \n\t"\r
379                 "       NOP                                                                     \n\t"\r
380                 "                                                                               \n\t"\r
381                 /* Check the accumulator value. */\r
382                 "       MVFACHI R15                                                     \n\t"\r
383                 "       CMP             #0x33333333, R15                        \n\t"\r
384                 "       BNE             RegTest2Error                           \n\t"\r
385                 "       MVFACMI R15                                                     \n\t"\r
386                 "       CMP             #0x33334444, R15                        \n\t"\r
387                 "       BNE             RegTest2Error                           \n\t"\r
388                 "                                                                               \n\t"\r
389                 /* Restore the clobbered registers. */\r
390                 "       POPM    R14-R15                                         \n\t"\r
391                 "                                                                               \n\t"\r
392                 /* Now compare each register to ensure it still contains the value that\r
393                 was set before this loop was entered. */\r
394                 "       CMP             #1, R1                                          \n\t"\r
395                 "       BNE             RegTest1Error                           \n\t"\r
396                 "       CMP             #2, R2                                          \n\t"\r
397                 "       BNE             RegTest1Error                           \n\t"\r
398                 "       CMP             #3, R3                                          \n\t"\r
399                 "       BNE             RegTest1Error                           \n\t"\r
400                 "       CMP             #4, R4                                          \n\t"\r
401                 "       BNE             RegTest1Error                           \n\t"\r
402                 "       CMP             #5, R5                                          \n\t"\r
403                 "       BNE             RegTest1Error                           \n\t"\r
404                 "       CMP             #6, R6                                          \n\t"\r
405                 "       BNE             RegTest1Error                           \n\t"\r
406                 "       CMP             #7, R7                                          \n\t"\r
407                 "       BNE             RegTest1Error                           \n\t"\r
408                 "       CMP             #8, R8                                          \n\t"\r
409                 "       BNE             RegTest1Error                           \n\t"\r
410                 "       CMP             #9, R9                                          \n\t"\r
411                 "       BNE             RegTest1Error                           \n\t"\r
412                 "       CMP             #10, R10                                        \n\t"\r
413                 "       BNE             RegTest1Error                           \n\t"\r
414                 "       CMP             #11, R11                                        \n\t"\r
415                 "       BNE             RegTest1Error                           \n\t"\r
416                 "       CMP             #12, R12                                        \n\t"\r
417                 "       BNE             RegTest1Error                           \n\t"\r
418                 "       CMP             #13, R13                                        \n\t"\r
419                 "       BNE             RegTest1Error                           \n\t"\r
420                 "       CMP             #14, R14                                        \n\t"\r
421                 "       BNE             RegTest1Error                           \n\t"\r
422                 "       CMP             #15, R15                                        \n\t"\r
423                 "       BNE             RegTest1Error                           \n\t"\r
424                 "                                                                               \n\t"\r
425                 /* All comparisons passed, start a new iteration of this loop. */\r
426                 "       BRA             TestLoop1                                       \n\t"\r
427                 "                                                                               \n\t"\r
428                 /* A compare failed, just loop here so the loop counter stops\r
429                 incrementing causing the check timer to indicate the error. */\r
430                 "RegTest1Error:                                                 \n\t"\r
431                 "       BRA RegTest1Error                                       "\r
432         );\r
433 }\r
434 /*-----------------------------------------------------------*/\r
435 \r
436 /* This function is explained in the comments at the top of this file. */\r
437 static void prvRegTest2Implementation( void )\r
438 {\r
439         __asm volatile\r
440         (\r
441                 /* Set each register to a known value. */\r
442                 "       MOV.L   #0x11111111, R15                        \n\t"\r
443                 "       MVTACHI R15                                                     \n\t"\r
444                 "       MOV.L   #0x22222222, R15                        \n\t"\r
445                 "       MVTACLO R15                                                     \n\t"\r
446                 "       MOV.L   #100, R1                                        \n\t"\r
447                 "       MOV.L   #200, R2                                        \n\t"\r
448                 "       MOV.L   #300, R3                                        \n\t"\r
449                 "       MOV.L   #400, R4                                        \n\t"\r
450                 "       MOV.L   #500, R5                                        \n\t"\r
451                 "       MOV.L   #600, R6                                        \n\t"\r
452                 "       MOV.L   #700, R7                                        \n\t"\r
453                 "       MOV.L   #800, R8                                        \n\t"\r
454                 "       MOV.L   #900, R9                                        \n\t"\r
455                 "       MOV.L   #1000, R10                                      \n\t"\r
456                 "       MOV.L   #1001, R11                                      \n\t"\r
457                 "       MOV.L   #1002, R12                                      \n\t"\r
458                 "       MOV.L   #1003, R13                                      \n\t"\r
459                 "       MOV.L   #1004, R14                                      \n\t"\r
460                 "       MOV.L   #1005, R15                                      \n\t"\r
461                 "                                                                               \n\t"\r
462                 /* Loop, checking each iteration that each register still contains the\r
463                 expected value. */\r
464                 "TestLoop2:                                                             \n\t"\r
465                 "                                                                               \n\t"\r
466                 /* Push the registers that are going to get clobbered. */\r
467                 "       PUSHM   R14-R15                                         \n\t"\r
468                 "                                                                               \n\t"\r
469                 /* Increment the loop counter to show this task is still getting CPU\r
470                 time. */\r
471                 "       MOV.L   #_ulRegTest2CycleCount, R14     \n\t"\r
472                 "       MOV.L   [ R14 ], R15                            \n\t"\r
473                 "       ADD             #1, R15                                         \n\t"\r
474                 "       MOV.L   R15, [ R14 ]                            \n\t"\r
475                 "                                                                               \n\t"\r
476                 /* Check the accumulator value. */\r
477                 "       MVFACHI R15                                                     \n\t"\r
478                 "       CMP             #0x11111111, R15                        \n\t"\r
479                 "       BNE             RegTest2Error                           \n\t"\r
480                 "       MVFACMI R15                                                     \n\t"\r
481                 "       CMP             #0x11112222, R15                        \n\t"\r
482                 "       BNE             RegTest2Error                           \n\t"\r
483                 "                                                                               \n\t"\r
484                 /* Restore the clobbered registers. */\r
485                 "       POPM    R14-R15                                         \n\t"\r
486                 "                                                                               \n\t"\r
487                 /* Now compare each register to ensure it still contains the value that\r
488                 was set before this loop was entered. */\r
489                 "       CMP             #100, R1                                        \n\t"\r
490                 "       BNE             RegTest2Error                           \n\t"\r
491                 "       CMP             #200, R2                                        \n\t"\r
492                 "       BNE             RegTest2Error                           \n\t"\r
493                 "       CMP             #300, R3                                        \n\t"\r
494                 "       BNE             RegTest2Error                           \n\t"\r
495                 "       CMP             #400, R4                                        \n\t"\r
496                 "       BNE             RegTest2Error                           \n\t"\r
497                 "       CMP             #500, R5                                        \n\t"\r
498                 "       BNE             RegTest2Error                           \n\t"\r
499                 "       CMP             #600, R6                                        \n\t"\r
500                 "       BNE             RegTest2Error                           \n\t"\r
501                 "       CMP             #700, R7                                        \n\t"\r
502                 "       BNE             RegTest2Error                           \n\t"\r
503                 "       CMP             #800, R8                                        \n\t"\r
504                 "       BNE             RegTest2Error                           \n\t"\r
505                 "       CMP             #900, R9                                        \n\t"\r
506                 "       BNE             RegTest2Error                           \n\t"\r
507                 "       CMP             #1000, R10                                      \n\t"\r
508                 "       BNE             RegTest2Error                           \n\t"\r
509                 "       CMP             #1001, R11                                      \n\t"\r
510                 "       BNE             RegTest2Error                           \n\t"\r
511                 "       CMP             #1002, R12                                      \n\t"\r
512                 "       BNE             RegTest2Error                           \n\t"\r
513                 "       CMP             #1003, R13                                      \n\t"\r
514                 "       BNE             RegTest2Error                           \n\t"\r
515                 "       CMP             #1004, R14                                      \n\t"\r
516                 "       BNE             RegTest2Error                           \n\t"\r
517                 "       CMP             #1005, R15                                      \n\t"\r
518                 "       BNE             RegTest2Error                           \n\t"\r
519                 "                                                                               \n\t"\r
520                 /* All comparisons passed, start a new iteration of this loop. */\r
521                 "       BRA             TestLoop2                                       \n\t"\r
522                 "                                                                               \n\t"\r
523                 /* A compare failed, just loop here so the loop counter stops\r
524                 incrementing causing the check timer to indicate the error. */\r
525                 "RegTest2Error:                                                 \n\t"\r
526                 "       BRA RegTest2Error                                       "\r
527         );\r
528 }\r
529 /*-----------------------------------------------------------*/\r
530 \r
531 #endif /* configCREATE_LOW_POWER_DEMO */\r