]> git.sur5r.net Git - freertos/blob - Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/main.c
PPC405 work in progress.
[freertos] / Demo / PPC405_Xilinx_Virtex4_GCC / RTOSDemo / main.c
1 /*\r
2         FreeRTOS.org V4.7.1 - Copyright (C) 2003-2008 Richard Barry.\r
3 \r
4         This file is part of the FreeRTOS.org distribution.\r
5 \r
6         FreeRTOS.org is free software; you can redistribute it and/or modify\r
7         it under the terms of the GNU General Public License as published by\r
8         the Free Software Foundation; either version 2 of the License, or\r
9         (at your option) any later version.\r
10 \r
11         FreeRTOS.org is distributed in the hope that it will be useful,\r
12         but WITHOUT ANY WARRANTY; without even the implied warranty of\r
13         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
14         GNU General Public License for more details.\r
15 \r
16         You should have received a copy of the GNU General Public License\r
17         along with FreeRTOS.org; if not, write to the Free Software\r
18         Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
19 \r
20         A special exception to the GPL can be applied should you wish to distribute\r
21         a combined work that includes FreeRTOS.org, without being obliged to provide\r
22         the source code for any proprietary components.  See the licensing section\r
23         of http://www.FreeRTOS.org for full details of how and when the exception\r
24         can be applied.\r
25 \r
26         ***************************************************************************\r
27 \r
28         Please ensure to read the configuration and relevant port sections of the \r
29         online documentation.\r
30 \r
31         +++ http://www.FreeRTOS.org +++\r
32         Documentation, latest information, license and contact details.  \r
33 \r
34         +++ http://www.SafeRTOS.com +++\r
35         A version that is certified for use in safety critical systems.\r
36 \r
37         +++ http://www.OpenRTOS.com +++\r
38         Commercial support, development, porting, licensing and training services.\r
39 \r
40         ***************************************************************************\r
41 */\r
42 \r
43 /*\r
44  * Creates all the demo application tasks, then starts the scheduler.  The WEB\r
45  * documentation provides more details of the demo application tasks.\r
46  * \r
47  * In addition to the standard demo tasks, the follow demo specific tasks are\r
48  * create:\r
49  *\r
50  * The "Check" task.  This only executes every three seconds but has the highest \r
51  * priority so is guaranteed to get processor time.  Its main function is to \r
52  * check that all the other tasks are still operational.  Most tasks maintain \r
53  * a unique count that is incremented each time the task successfully completes \r
54  * its function.  Should any error occur within such a task the count is \r
55  * permanently halted.  The check task inspects the count of each task to ensure \r
56  * it has changed since the last time the check task executed.  If all the count \r
57  * variables have changed all the tasks are still executing error free, and the \r
58  * check task toggles the onboard LED.  Should any task contain an error at any time \r
59  * the LED toggle rate will change from 3 seconds to 500ms.\r
60  *\r
61  * The "Register Check" tasks.  These tasks fill the CPU registers with known\r
62  * values, then check that each register still contains the expected value, the\r
63  * discovery of an unexpected value being indicative of an error in the RTOS\r
64  * context switch mechanism.  The register check tasks operate at low priority\r
65  * so are switched in and out frequently.\r
66  *\r
67  */\r
68 \r
69 \r
70 /* Scheduler includes. */\r
71 #include "FreeRTOS.h"\r
72 #include "task.h"\r
73 \r
74 /* Xilinx library includes. */\r
75 #include "xcache_l.h"\r
76 #include "xintc.h"\r
77 \r
78 /* Demo application includes. */\r
79 #include "flash.h"\r
80 #include "integer.h"\r
81 #include "comtest2.h"\r
82 #include "semtest.h"\r
83 #include "BlockQ.h"\r
84 #include "dynamic.h"\r
85 #include "flop.h"\r
86 #include "GenQTest.h"\r
87 #include "QPeek.h"\r
88 #include "blocktim.h"\r
89 #include "death.h"\r
90 #include "partest.h"\r
91 \r
92 /* Priorities assigned to the demo tasks. */\r
93 #define mainCHECK_TASK_PRIORITY                 ( tskIDLE_PRIORITY + 4 )\r
94 #define mainSEM_TEST_PRIORITY                   ( tskIDLE_PRIORITY + 3 )\r
95 #define mainCOM_TEST_PRIORITY                   ( tskIDLE_PRIORITY + 2 )\r
96 #define mainQUEUE_BLOCK_PRIORITY                ( tskIDLE_PRIORITY + 2 )\r
97 #define mainDEATH_PRIORITY                              ( tskIDLE_PRIORITY + 1 )\r
98 #define mainLED_TASK_PRIORITY                   ( tskIDLE_PRIORITY + 1 )\r
99 #define mainGENERIC_QUEUE_PRIORITY              ( tskIDLE_PRIORITY )\r
100 \r
101 /* The first LED used by the COM test and check tasks respectively. */\r
102 #define mainCOM_TEST_LED                                ( 4 )\r
103 #define mainCHECK_TEST_LED                              ( 3 )\r
104 \r
105 /* The baud rate used by the comtest tasks is set by the hardware, so the\r
106 baud rate parameters passed into the comtest initialisation has no effect. */\r
107 #define mainBAUD_SET_IN_HARDWARE                ( 0 )\r
108 \r
109 /* Delay periods used by the check task.  If no errors have been found then\r
110 the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds.  If an\r
111 error has been found at any time then the toggle rate will increase to \r
112 mainERROR_CHECK_DELAY milliseconds. */\r
113 #define mainNO_ERROR_CHECK_DELAY                ( ( portTickType ) 3000 / portTICK_RATE_MS  )\r
114 #define mainERROR_CHECK_DELAY                   ( ( portTickType ) 500 / portTICK_RATE_MS  )\r
115 \r
116 \r
117 /* \r
118  * The tasks defined within this file - described within the comments at the\r
119  * head of this page. \r
120  */\r
121 static void prvRegTestTask1( void *pvParameters );\r
122 static void prvRegTestTask2( void *pvParameters );\r
123 static void prvErrorChecks( void *pvParameters );\r
124 \r
125 /*\r
126  * Called by the 'check' task to inspect all the standard demo tasks within\r
127  * the system, as described within the comments at the head of this page.\r
128  */\r
129 static portSHORT prvCheckOtherTasksAreStillRunning( void );\r
130 \r
131 /*\r
132  * Perform any hardware initialisation required by the demo application.\r
133  */\r
134 static void prvSetupHardware( void );\r
135 \r
136 /*-----------------------------------------------------------*/\r
137 \r
138 /* xRegTestStatus will geet set to pdFAIL by the regtest tasks if they\r
139 discover an unexpected value. */\r
140 static unsigned portBASE_TYPE xRegTestStatus = pdPASS;\r
141 \r
142 /*-----------------------------------------------------------*/\r
143 \r
144 int main( void )\r
145 {\r
146         /* Must be called prior to installing any interrupt handlers! */\r
147         vPortSetupInterruptController();\r
148 \r
149         /* In this case prvSetupHardware() just enables the caches and and\r
150         configures the IO ports for the LED outputs. */\r
151         prvSetupHardware();\r
152 \r
153         /* Start the standard demo application tasks.  Note that the baud rate used\r
154         by the comtest tasks is set by the hardware, so the baud rate paramter\r
155         passed has no effect. */\r
156         vStartLEDFlashTasks( mainLED_TASK_PRIORITY );   \r
157         vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
158         vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED );\r
159         vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
160         vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY );  \r
161         vStartDynamicPriorityTasks();   \r
162         vStartMathTasks( tskIDLE_PRIORITY );    \r
163         vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );\r
164         vStartQueuePeekTasks();\r
165         vCreateBlockTimeTasks();\r
166 \r
167         /* Create the tasks defined within this file. */\r
168         xTaskCreate( prvRegTestTask1, "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
169         xTaskCreate( prvRegTestTask2, "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
170         xTaskCreate( prvErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
171 \r
172         /* The suicide tasks must be started last as they record the number of other\r
173         tasks that exist within the system.  The value is then used to ensure at run\r
174         time the number of tasks that exists is within expected bounds. */\r
175         vCreateSuicidalTasks( mainDEATH_PRIORITY );\r
176 \r
177         /* Now start the scheduler.  Following this call the created tasks should\r
178         be executing. */        \r
179         vTaskStartScheduler( );\r
180 \r
181         /* vTaskStartScheduler() will only return if an error occurs while the \r
182         idle task is being created. */\r
183         for( ;; );\r
184 \r
185         return 0;\r
186 }\r
187 /*-----------------------------------------------------------*/\r
188 \r
189 static portSHORT prvCheckOtherTasksAreStillRunning( void )\r
190 {\r
191 portBASE_TYPE lReturn = pdPASS;\r
192 \r
193         /* The demo tasks maintain a count that increments every cycle of the task\r
194         provided that the task has never encountered an error.  This function \r
195         checks the counts maintained by the tasks to ensure they are still being\r
196         incremented.  A count remaining at the same value between calls therefore\r
197         indicates that an error has been detected. */\r
198 \r
199         if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
200         {\r
201                 lReturn = pdFAIL;\r
202         }\r
203 \r
204         if( xAreComTestTasksStillRunning() != pdTRUE )\r
205         {\r
206                 lReturn = pdFAIL;\r
207         }\r
208         \r
209         if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
210         {\r
211                 lReturn = pdFAIL;\r
212         }\r
213         \r
214         if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
215         {\r
216                 lReturn = pdFAIL;\r
217         }\r
218         \r
219         if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
220         {\r
221                 lReturn = pdFAIL;\r
222         }\r
223         \r
224         if( xAreMathsTaskStillRunning() != pdTRUE )\r
225         {\r
226                 lReturn = pdFAIL;\r
227         }\r
228         \r
229         if( xIsCreateTaskStillRunning() != pdTRUE )\r
230         {\r
231                 lReturn = pdFAIL;\r
232         }\r
233         \r
234         if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
235         {\r
236                 lReturn = pdFAIL;\r
237         }\r
238         \r
239         if ( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
240         {\r
241                 lReturn = pdFAIL;\r
242         }\r
243         \r
244         if ( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
245         {\r
246                 lReturn = pdFAIL;\r
247         }\r
248 \r
249         /* Have the register test tasks found any errors? */\r
250         if( xRegTestStatus != pdPASS )\r
251         {\r
252                 lReturn = pdFAIL;\r
253         }\r
254 \r
255         return lReturn;\r
256 }\r
257 /*-----------------------------------------------------------*/\r
258 \r
259 static void prvErrorChecks( void *pvParameters )\r
260 {\r
261 portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime;\r
262 volatile unsigned portBASE_TYPE uxFreeStack;\r
263 \r
264         uxFreeStack = uxTaskGetStackHighWaterMark( NULL );\r
265 \r
266         /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()\r
267         works correctly. */\r
268         xLastExecutionTime = xTaskGetTickCount();\r
269 \r
270         /* Cycle for ever, delaying then checking all the other tasks are still\r
271         operating without error. */\r
272         for( ;; )\r
273         {\r
274                 uxFreeStack = uxTaskGetStackHighWaterMark( NULL );\r
275 \r
276                 /* Wait until it is time to check again.  The time we wait here depends\r
277                 on whether an error has been detected or not.  When an error is \r
278                 detected the time is shortened resulting in a faster LED flash rate. */\r
279                 /* Perform this check every mainCHECK_DELAY milliseconds. */\r
280                 vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );\r
281 \r
282                 /* See if the other tasks are all ok. */\r
283                 if( prvCheckOtherTasksAreStillRunning() != pdPASS )\r
284                 {\r
285                         /* An error occurred in one of the tasks so shorten the delay \r
286                         period - which has the effect of increasing the frequency of the\r
287                         LED toggle. */\r
288                         xDelayPeriod = mainERROR_CHECK_DELAY;\r
289                 }\r
290 \r
291                 /* Flash! */\r
292                 vParTestToggleLED( mainCHECK_TEST_LED );\r
293         }\r
294 }\r
295 /*-----------------------------------------------------------*/\r
296 \r
297 static void prvSetupHardware( void )\r
298 {\r
299         XCache_EnableICache( 0x80000000 );\r
300         XCache_EnableDCache( 0x80000000 );\r
301 \r
302         vParTestInitialise();\r
303 }\r
304 \r
305 static void prvRegTestTask1( void *pvParameters )\r
306 {\r
307         asm volatile\r
308         (\r
309                 "RegTest1Start:                                 \n\t" \\r
310                 "                                                               \n\t" \\r
311                 "       li              0, 1                            \n\t" \\r
312                 "       li              2, 2                            \n\t" \\r
313                 "       li              3, 3                            \n\t" \\r
314                 "       li              4,      4                               \n\t" \\r
315                 "       li              5,      5                               \n\t" \\r
316                 "       li              6,      6                               \n\t" \\r
317                 "       li              7,      7                               \n\t" \\r
318                 "       li              8,      8                               \n\t" \\r
319                 "       li              9,      9                               \n\t" \\r
320                 "       li              10,     10                              \n\t" \\r
321                 "       li              11,     11                              \n\t" \\r
322                 "       li              12,     12                              \n\t" \\r
323                 "       li              13,     13                              \n\t" \\r
324                 "       li              14,     14                              \n\t" \\r
325                 "       li              15,     15                              \n\t" \\r
326                 "       li              16,     16                              \n\t" \\r
327                 "       li              17,     17                              \n\t" \\r
328                 "       li              18,     18                              \n\t" \\r
329                 "       li              19,     19                              \n\t" \\r
330                 "       li              20,     20                              \n\t" \\r
331                 "       li              21,     21                              \n\t" \\r
332                 "       li              22,     22                              \n\t" \\r
333                 "       li              23,     23                              \n\t" \\r
334                 "       li              24,     24                              \n\t" \\r
335                 "       li              25,     25                              \n\t" \\r
336                 "       li              26,     26                              \n\t" \\r
337                 "       li              27,     27                              \n\t" \\r
338                 "       li              28,     28                              \n\t" \\r
339                 "       li              29,     29                              \n\t" \\r
340                 "       li              30,     30                              \n\t" \\r
341                 "       li              31,     31                              \n\t" \\r
342                 "                                                               \n\t" \\r
343                 "       sc                                                      \n\t" \\r
344                 "       nop                                                     \n\t" \\r
345                 "                                                               \n\t" \\r
346                 "       cmpwi   0, 1                            \n\t" \\r
347                 "       bne             RegTest1Fail            \n\t" \\r
348                 "       cmpwi   2, 2                            \n\t" \\r
349                 "       bne             RegTest1Fail            \n\t" \\r
350                 "       cmpwi   3, 3                            \n\t" \\r
351                 "       bne             RegTest1Fail            \n\t" \\r
352                 "       cmpwi   4, 4                            \n\t" \\r
353                 "       bne             RegTest1Fail            \n\t" \\r
354                 "       cmpwi   5, 5                            \n\t" \\r
355                 "       bne             RegTest1Fail            \n\t" \\r
356                 "       cmpwi   6, 6                            \n\t" \\r
357                 "       bne             RegTest1Fail            \n\t" \\r
358                 "       cmpwi   7, 7                            \n\t" \\r
359                 "       bne             RegTest1Fail            \n\t" \\r
360                 "       cmpwi   8, 8                            \n\t" \\r
361                 "       bne             RegTest1Fail            \n\t" \\r
362                 "       cmpwi   9, 9                            \n\t" \\r
363                 "       bne             RegTest1Fail            \n\t" \\r
364                 "       cmpwi   10, 10                          \n\t" \\r
365                 "       bne             RegTest1Fail            \n\t" \\r
366                 "       cmpwi   11, 11                          \n\t" \\r
367                 "       bne             RegTest1Fail            \n\t" \\r
368                 "       cmpwi   12, 12                          \n\t" \\r
369                 "       bne             RegTest1Fail            \n\t" \\r
370                 "       cmpwi   13, 13                          \n\t" \\r
371                 "       bne             RegTest1Fail            \n\t" \\r
372                 "       cmpwi   14, 14                          \n\t" \\r
373                 "       bne             RegTest1Fail            \n\t" \\r
374                 "       cmpwi   15, 15                          \n\t" \\r
375                 "       bne             RegTest1Fail            \n\t" \\r
376                 "       cmpwi   16, 16                          \n\t" \\r
377                 "       bne             RegTest1Fail            \n\t" \\r
378                 "       cmpwi   17, 17                          \n\t" \\r
379                 "       bne             RegTest1Fail            \n\t" \\r
380                 "       cmpwi   18, 18                          \n\t" \\r
381                 "       bne             RegTest1Fail            \n\t" \\r
382                 "       cmpwi   19, 19                          \n\t" \\r
383                 "       bne             RegTest1Fail            \n\t" \\r
384                 "       cmpwi   20, 20                          \n\t" \\r
385                 "       bne             RegTest1Fail            \n\t" \\r
386                 "       cmpwi   21, 21                          \n\t" \\r
387                 "       bne             RegTest1Fail            \n\t" \\r
388                 "       cmpwi   22, 22                          \n\t" \\r
389                 "       bne             RegTest1Fail            \n\t" \\r
390                 "       cmpwi   23, 23                          \n\t" \\r
391                 "       bne             RegTest1Fail            \n\t" \\r
392                 "       cmpwi   24, 24                          \n\t" \\r
393                 "       bne             RegTest1Fail            \n\t" \\r
394                 "       cmpwi   25, 25                          \n\t" \\r
395                 "       bne             RegTest1Fail            \n\t" \\r
396                 "       cmpwi   26, 26                          \n\t" \\r
397                 "       bne             RegTest1Fail            \n\t" \\r
398                 "       cmpwi   27, 27                          \n\t" \\r
399                 "       bne             RegTest1Fail            \n\t" \\r
400                 "       cmpwi   28, 28                          \n\t" \\r
401                 "       bne             RegTest1Fail            \n\t" \\r
402                 "       cmpwi   29, 29                          \n\t" \\r
403                 "       bne             RegTest1Fail            \n\t" \\r
404                 "       cmpwi   30, 30                          \n\t" \\r
405                 "       bne             RegTest1Fail            \n\t" \\r
406                 "       cmpwi   31, 31                          \n\t" \\r
407                 "       bne             RegTest1Fail            \n\t" \\r
408                 "                                                               \n\t" \\r
409                 "       b RegTest1Start                         \n\t" \\r
410                 "                                                               \n\t" \\r
411                 "RegTest1Fail:                                  \n\t" \\r
412                 "                                                               \n\t" \\r
413                 "       xor             0, 0, 0                         \n\t" \\r
414                 "       stw             0, xRegTestStatus( 0 ) \n\t" \\r
415                 "                                                               \n\t" \\r
416                 "       b RegTest1Start                         \n\t" \\r
417         );\r
418 }\r
419 \r
420 static void prvRegTestTask2( void *pvParameters )\r
421 {\r
422         asm volatile\r
423         (\r
424                 "RegTest2Start:                                 \n\t" \\r
425                 "                                                               \n\t" \\r
426                 "       li              0, 11                           \n\t" \\r
427                 "       li              2, 12                           \n\t" \\r
428                 "       li              3, 13                           \n\t" \\r
429                 "       li              4,      14                              \n\t" \\r
430                 "       li              5,      15                              \n\t" \\r
431                 "       li              6,      16                              \n\t" \\r
432                 "       li              7,      17                              \n\t" \\r
433                 "       li              8,      18                              \n\t" \\r
434                 "       li              9,      19                              \n\t" \\r
435                 "       li              10,     110                             \n\t" \\r
436                 "       li              11,     111                             \n\t" \\r
437                 "       li              12,     112                             \n\t" \\r
438                 "       li              13,     113                             \n\t" \\r
439                 "       li              14,     114                             \n\t" \\r
440                 "       li              15,     115                             \n\t" \\r
441                 "       li              16,     116                             \n\t" \\r
442                 "       li              17,     117                             \n\t" \\r
443                 "       li              18,     118                             \n\t" \\r
444                 "       li              19,     119                             \n\t" \\r
445                 "       li              20,     120                             \n\t" \\r
446                 "       li              21,     121                             \n\t" \\r
447                 "       li              22,     122                             \n\t" \\r
448                 "       li              23,     123                             \n\t" \\r
449                 "       li              24,     124                             \n\t" \\r
450                 "       li              25,     125                             \n\t" \\r
451                 "       li              26,     126                             \n\t" \\r
452                 "       li              27,     127                             \n\t" \\r
453                 "       li              28,     128                             \n\t" \\r
454                 "       li              29,     129                             \n\t" \\r
455                 "       li              30,     130                             \n\t" \\r
456                 "       li              31,     131                             \n\t" \\r
457                 "                                                               \n\t" \\r
458                 "       sc                                                      \n\t" \\r
459                 "       nop                                                     \n\t" \\r
460                 "                                                               \n\t" \\r
461                 "       cmpwi   0, 11                           \n\t" \\r
462                 "       bne             RegTest2Fail            \n\t" \\r
463                 "       cmpwi   2, 12                           \n\t" \\r
464                 "       bne             RegTest2Fail            \n\t" \\r
465                 "       cmpwi   3, 13                           \n\t" \\r
466                 "       bne             RegTest2Fail            \n\t" \\r
467                 "       cmpwi   4, 14                           \n\t" \\r
468                 "       bne             RegTest2Fail            \n\t" \\r
469                 "       cmpwi   5, 15                           \n\t" \\r
470                 "       bne             RegTest2Fail            \n\t" \\r
471                 "       cmpwi   6, 16                           \n\t" \\r
472                 "       bne             RegTest2Fail            \n\t" \\r
473                 "       cmpwi   7, 17                           \n\t" \\r
474                 "       bne             RegTest2Fail            \n\t" \\r
475                 "       cmpwi   8, 18                           \n\t" \\r
476                 "       bne             RegTest2Fail            \n\t" \\r
477                 "       cmpwi   9, 19                           \n\t" \\r
478                 "       bne             RegTest2Fail            \n\t" \\r
479                 "       cmpwi   10, 110                         \n\t" \\r
480                 "       bne             RegTest2Fail            \n\t" \\r
481                 "       cmpwi   11, 111                         \n\t" \\r
482                 "       bne             RegTest2Fail            \n\t" \\r
483                 "       cmpwi   12, 112                         \n\t" \\r
484                 "       bne             RegTest2Fail            \n\t" \\r
485                 "       cmpwi   13, 113                         \n\t" \\r
486                 "       bne             RegTest2Fail            \n\t" \\r
487                 "       cmpwi   14, 114                         \n\t" \\r
488                 "       bne             RegTest2Fail            \n\t" \\r
489                 "       cmpwi   15, 115                         \n\t" \\r
490                 "       bne             RegTest2Fail            \n\t" \\r
491                 "       cmpwi   16, 116                         \n\t" \\r
492                 "       bne             RegTest2Fail            \n\t" \\r
493                 "       cmpwi   17, 117                         \n\t" \\r
494                 "       bne             RegTest2Fail            \n\t" \\r
495                 "       cmpwi   18, 118                         \n\t" \\r
496                 "       bne             RegTest2Fail            \n\t" \\r
497                 "       cmpwi   19, 119                         \n\t" \\r
498                 "       bne             RegTest2Fail            \n\t" \\r
499                 "       cmpwi   20, 120                         \n\t" \\r
500                 "       bne             RegTest2Fail            \n\t" \\r
501                 "       cmpwi   21, 121                         \n\t" \\r
502                 "       bne             RegTest2Fail            \n\t" \\r
503                 "       cmpwi   22, 122                         \n\t" \\r
504                 "       bne             RegTest2Fail            \n\t" \\r
505                 "       cmpwi   23, 123                         \n\t" \\r
506                 "       bne             RegTest2Fail            \n\t" \\r
507                 "       cmpwi   24, 124                         \n\t" \\r
508                 "       bne             RegTest2Fail            \n\t" \\r
509                 "       cmpwi   25, 125                         \n\t" \\r
510                 "       bne             RegTest2Fail            \n\t" \\r
511                 "       cmpwi   26, 126                         \n\t" \\r
512                 "       bne             RegTest2Fail            \n\t" \\r
513                 "       cmpwi   27, 127                         \n\t" \\r
514                 "       bne             RegTest2Fail            \n\t" \\r
515                 "       cmpwi   28, 128                         \n\t" \\r
516                 "       bne             RegTest2Fail            \n\t" \\r
517                 "       cmpwi   29, 129                         \n\t" \\r
518                 "       bne             RegTest2Fail            \n\t" \\r
519                 "       cmpwi   30, 130                         \n\t" \\r
520                 "       bne             RegTest2Fail            \n\t" \\r
521                 "       cmpwi   31, 131                         \n\t" \\r
522                 "       bne             RegTest2Fail            \n\t" \\r
523                 "                                                               \n\t" \\r
524                 "       b RegTest2Start                         \n\t" \\r
525                 "                                                               \n\t" \\r
526                 "RegTest2Fail:                                  \n\t" \\r
527                 "                                                               \n\t" \\r
528                 "       xor             0, 0, 0                         \n\t" \\r
529                 "       stw             0, xRegTestStatus( 0 ) \n\t" \\r
530                 "                                                               \n\t" \\r
531                 "       b RegTest2Start                         \n\t" \\r
532         );\r
533 }\r
534 \r
535 \r
536 #if 0\r
537 \r
538 static void prvRegTestTask2( void *pvParameters )\r
539 {\r
540 volatile unsigned int i= 0;\r
541 \r
542         for( ;; )\r
543         {\r
544                 i++;\r
545                 taskYIELD();\r
546         }\r
547 }\r
548 \r
549 static void prvRegTestTask1( void *pvParameters )\r
550 {\r
551 volatile unsigned int i= 0;\r
552 \r
553         for( ;; )\r
554         {\r
555                 i++;\r
556                 taskYIELD();\r
557         }\r
558 }\r
559 \r
560 #endif\r
561 \r
562 void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName );\r
563 void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName )\r
564 {\r
565         for( ;; );\r
566 }\r
567 \r