2 FreeRTOS.org V5.3.0 - Copyright (C) 2003-2009 Richard Barry.
\r
4 This file is part of the FreeRTOS.org distribution.
\r
6 FreeRTOS.org is free software; you can redistribute it and/or modify it
\r
7 under the terms of the GNU General Public License (version 2) as published
\r
8 by the Free Software Foundation and modified by the FreeRTOS exception.
\r
9 **NOTE** The exception to the GPL is included to allow you to distribute a
\r
10 combined work that includes FreeRTOS.org without being obliged to provide
\r
11 the source code for any proprietary components. Alternative commercial
\r
12 license and support terms are also available upon request. See the
\r
13 licensing section of http://www.FreeRTOS.org for full details.
\r
15 FreeRTOS.org is distributed in the hope that it will be useful, but WITHOUT
\r
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
\r
17 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
\r
20 You should have received a copy of the GNU General Public License along
\r
21 with FreeRTOS.org; if not, write to the Free Software Foundation, Inc., 59
\r
22 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
\r
25 ***************************************************************************
\r
27 * Get the FreeRTOS eBook! See http://www.FreeRTOS.org/Documentation *
\r
29 * This is a concise, step by step, 'hands on' guide that describes both *
\r
30 * general multitasking concepts and FreeRTOS specifics. It presents and *
\r
31 * explains numerous examples that are written using the FreeRTOS API. *
\r
32 * Full source code for all the examples is provided in an accompanying *
\r
35 ***************************************************************************
\r
39 Please ensure to read the configuration and relevant port sections of the
\r
40 online documentation.
\r
42 http://www.FreeRTOS.org - Documentation, latest information, license and
\r
45 http://www.SafeRTOS.com - A version that is certified for use in safety
\r
48 http://www.OpenRTOS.com - Commercial support, development, porting,
\r
49 licensing and training services.
\r
53 * Creates all the demo application tasks, then starts the scheduler. The WEB
\r
54 * documentation provides more details of the demo application tasks.
\r
56 * In addition to the standard demo tasks, the follow demo specific tasks are
\r
59 * The "Check" task. This only executes every three seconds but has the highest
\r
60 * priority so is guaranteed to get processor time. Its main function is to
\r
61 * check that all the other tasks are still operational. Most tasks maintain
\r
62 * a unique count that is incremented each time the task successfully completes
\r
63 * its function. Should any error occur within such a task the count is
\r
64 * permanently halted. The check task inspects the count of each task to ensure
\r
65 * it has changed since the last time the check task executed. If all the count
\r
66 * variables have changed all the tasks are still executing error free, and the
\r
67 * check task toggles the onboard LED. Should any task contain an error at any time
\r
68 * the LED toggle rate will change from 3 seconds to 500ms.
\r
70 * The "Register Check" tasks. These tasks fill the CPU registers with known
\r
71 * values, then check that each register still contains the expected value, the
\r
72 * discovery of an unexpected value being indicative of an error in the RTOS
\r
73 * context switch mechanism. The register check tasks operate at low priority
\r
74 * so are switched in and out frequently.
\r
78 /* Scheduler includes. */
\r
79 #include "FreeRTOS.h"
\r
82 /* Xilinx library includes. */
\r
83 #include "xcache_l.h"
\r
86 /* Demo application includes. */
\r
88 #include "integer.h"
\r
89 #include "comtest2.h"
\r
90 #include "semtest.h"
\r
92 #include "dynamic.h"
\r
93 #include "GenQTest.h"
\r
95 #include "blocktim.h"
\r
97 #include "partest.h"
\r
98 #include "countsem.h"
\r
99 #include "recmutex.h"
\r
101 #include "flop-reg-test.h"
\r
103 /* Priorities assigned to the demo tasks. */
\r
104 #define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
\r
105 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
106 #define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
107 #define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
108 #define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
109 #define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
110 #define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY )
\r
111 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
112 #define mainFLOP_PRIORITY ( tskIDLE_PRIORITY )
\r
114 /* The first LED used by the COM test and check tasks respectively. */
\r
115 #define mainCOM_TEST_LED ( 4 )
\r
116 #define mainCHECK_TEST_LED ( 3 )
\r
118 /* The baud rate used by the comtest tasks is set by the hardware, so the
\r
119 baud rate parameters passed into the comtest initialisation has no effect. */
\r
120 #define mainBAUD_SET_IN_HARDWARE ( 0 )
\r
122 /* Delay periods used by the check task. If no errors have been found then
\r
123 the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an
\r
124 error has been found at any time then the toggle rate will increase to
\r
125 mainERROR_CHECK_DELAY milliseconds. */
\r
126 #define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS )
\r
127 #define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )
\r
131 * The tasks defined within this file - described within the comments at the
\r
132 * head of this page.
\r
134 static void prvRegTestTask1( void *pvParameters );
\r
135 static void prvRegTestTask2( void *pvParameters );
\r
136 static void prvErrorChecks( void *pvParameters );
\r
139 * Called by the 'check' task to inspect all the standard demo tasks within
\r
140 * the system, as described within the comments at the head of this page.
\r
142 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void );
\r
145 * Perform any hardware initialisation required by the demo application.
\r
147 static void prvSetupHardware( void );
\r
149 /*-----------------------------------------------------------*/
\r
151 /* xRegTestStatus will get set to pdFAIL by the regtest tasks if they
\r
152 discover an unexpected value. */
\r
153 static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS;
\r
155 /* Counters used to ensure the regtest tasks are still running. */
\r
156 static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
\r
158 /*-----------------------------------------------------------*/
\r
163 /* Must be called prior to installing any interrupt handlers! */
\r
164 vPortSetupInterruptController();
\r
166 /* In this case prvSetupHardware() just enables the caches and and
\r
167 configures the IO ports for the LED outputs. */
\r
168 prvSetupHardware();
\r
170 /* Start the standard demo application tasks. Note that the baud rate used
\r
171 by the comtest tasks is set by the hardware, so the baud rate parameter
\r
172 passed has no effect. */
\r
173 vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
\r
174 vStartIntegerMathTasks( tskIDLE_PRIORITY );
\r
175 vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED );
\r
176 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
177 vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY );
\r
178 vStartDynamicPriorityTasks();
\r
179 vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
\r
180 vStartQueuePeekTasks();
\r
181 vCreateBlockTimeTasks();
\r
182 vStartCountingSemaphoreTasks();
\r
183 vStartRecursiveMutexTasks();
\r
185 #if ( configUSE_FPU == 1 )
\r
187 /* A different project is provided that has configUSE_FPU set to 1
\r
188 in order to demonstrate all the settings required to use the floating
\r
189 point unit. If you wish to use the floating point unit do not start
\r
190 with this project. */
\r
191 vStartMathTasks( mainFLOP_PRIORITY );
\r
192 vStartFlopRegTests();
\r
196 /* Create the tasks defined within this file. */
\r
197 xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
\r
198 xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
\r
199 xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
\r
201 /* The suicide tasks must be started last as they record the number of other
\r
202 tasks that exist within the system. The value is then used to ensure at run
\r
203 time the number of tasks that exists is within expected bounds. */
\r
204 vCreateSuicidalTasks( mainDEATH_PRIORITY );
\r
206 /* Now start the scheduler. Following this call the created tasks should
\r
208 vTaskStartScheduler();
\r
210 /* vTaskStartScheduler() will only return if an error occurs while the
\r
211 idle task is being created. */
\r
216 /*-----------------------------------------------------------*/
\r
218 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void )
\r
220 portBASE_TYPE lReturn = pdPASS;
\r
221 static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL;
\r
223 /* The demo tasks maintain a count that increments every cycle of the task
\r
224 provided that the task has never encountered an error. This function
\r
225 checks the counts maintained by the tasks to ensure they are still being
\r
226 incremented. A count remaining at the same value between calls therefore
\r
227 indicates that an error has been detected. */
\r
229 if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
234 if( xAreComTestTasksStillRunning() != pdTRUE )
\r
239 if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
244 if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
249 if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
\r
254 if( xIsCreateTaskStillRunning() != pdTRUE )
\r
259 if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
264 if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
269 if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
274 if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
\r
279 if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
284 #if ( configUSE_FPU == 1 )
\r
285 if( xAreMathsTaskStillRunning() != pdTRUE )
\r
290 if( xAreFlopRegisterTestsStillRunning() != pdTRUE )
\r
296 /* Have the register test tasks found any errors? */
\r
297 if( xRegTestStatus != pdPASS )
\r
302 /* Are the register test tasks still looping? */
\r
303 if( ulLastRegTest1Counter == ulRegTest1Counter )
\r
309 ulLastRegTest1Counter = ulRegTest1Counter;
\r
312 if( ulLastRegTest2Counter == ulRegTest2Counter )
\r
318 ulLastRegTest2Counter = ulRegTest2Counter;
\r
323 /*-----------------------------------------------------------*/
\r
325 static void prvErrorChecks( void *pvParameters )
\r
327 portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime;
\r
328 volatile unsigned portBASE_TYPE uxFreeStack;
\r
330 /* Just to remove compiler warning. */
\r
331 ( void ) pvParameters;
\r
333 /* This call is just to demonstrate the use of the function - nothing is
\r
334 done with the value. You would expect the stack high water mark to be
\r
335 lower (the function to return a larger value) here at function entry than
\r
336 later following calls to other functions. */
\r
337 uxFreeStack = uxTaskGetStackHighWaterMark( NULL );
\r
339 /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
\r
340 works correctly. */
\r
341 xLastExecutionTime = xTaskGetTickCount();
\r
343 /* Cycle for ever, delaying then checking all the other tasks are still
\r
344 operating without error. */
\r
347 /* Again just for demo purposes - uxFreeStack should have a lower value
\r
348 here than following the call to uxTaskGetStackHighWaterMark() on the
\r
350 uxFreeStack = uxTaskGetStackHighWaterMark( NULL );
\r
352 /* Wait until it is time to check again. The time we wait here depends
\r
353 on whether an error has been detected or not. When an error is
\r
354 detected the time is shortened resulting in a faster LED flash rate. */
\r
355 vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );
\r
357 /* See if the other tasks are all ok. */
\r
358 if( prvCheckOtherTasksAreStillRunning() != pdPASS )
\r
360 /* An error occurred in one of the tasks so shorten the delay
\r
361 period - which has the effect of increasing the frequency of the
\r
363 xDelayPeriod = mainERROR_CHECK_DELAY;
\r
367 vParTestToggleLED( mainCHECK_TEST_LED );
\r
370 /*-----------------------------------------------------------*/
\r
372 static void prvSetupHardware( void )
\r
374 XCache_EnableICache( 0x80000000 );
\r
375 XCache_EnableDCache( 0x80000000 );
\r
377 /* Setup the IO port for use with the LED outputs. */
\r
378 vParTestInitialise();
\r
380 /*-----------------------------------------------------------*/
\r
382 void prvRegTest1Pass( void )
\r
384 /* Called from the inline assembler - this cannot be static
\r
385 otherwise it can get optimised away. */
\r
386 ulRegTest1Counter++;
\r
388 /*-----------------------------------------------------------*/
\r
390 void prvRegTest2Pass( void )
\r
392 /* Called from the inline assembler - this cannot be static
\r
393 otherwise it can get optimised away. */
\r
394 ulRegTest2Counter++;
\r
396 /*-----------------------------------------------------------*/
\r
398 void prvRegTestFail( void )
\r
400 /* Called from the inline assembler - this cannot be static
\r
401 otherwise it can get optimised away. */
\r
402 xRegTestStatus = pdFAIL;
\r
404 /*-----------------------------------------------------------*/
\r
406 static void prvRegTestTask1( void *pvParameters )
\r
408 /* Just to remove compiler warning. */
\r
409 ( void ) pvParameters;
\r
411 /* The first register test task as described at the top of this file. The
\r
412 values used in the registers are different to those use in the second
\r
413 register test task. Also, unlike the second register test task, this task
\r
414 yields between setting the register values and subsequently checking the
\r
415 register values. */
\r
418 "RegTest1Start: \n\t" \
\r
420 " li 0, 301 \n\t" \
\r
421 " mtspr 256, 0 #USPRG0 \n\t" \
\r
422 " li 0, 501 \n\t" \
\r
423 " mtspr 8, 0 #LR \n\t" \
\r
425 " mtspr 1, 0 #XER \n\t" \
\r
436 " li 10, 10 \n\t" \
\r
437 " li 11, 11 \n\t" \
\r
438 " li 12, 12 \n\t" \
\r
439 " li 13, 13 \n\t" \
\r
440 " li 14, 14 \n\t" \
\r
441 " li 15, 15 \n\t" \
\r
442 " li 16, 16 \n\t" \
\r
443 " li 17, 17 \n\t" \
\r
444 " li 18, 18 \n\t" \
\r
445 " li 19, 19 \n\t" \
\r
446 " li 20, 20 \n\t" \
\r
447 " li 21, 21 \n\t" \
\r
448 " li 22, 22 \n\t" \
\r
449 " li 23, 23 \n\t" \
\r
450 " li 24, 24 \n\t" \
\r
451 " li 25, 25 \n\t" \
\r
452 " li 26, 26 \n\t" \
\r
453 " li 27, 27 \n\t" \
\r
454 " li 28, 28 \n\t" \
\r
455 " li 29, 29 \n\t" \
\r
456 " li 30, 30 \n\t" \
\r
457 " li 31, 31 \n\t" \
\r
462 " cmpwi 0, 1 \n\t" \
\r
463 " bne RegTest1Fail \n\t" \
\r
464 " cmpwi 2, 2 \n\t" \
\r
465 " bne RegTest1Fail \n\t" \
\r
466 " cmpwi 3, 3 \n\t" \
\r
467 " bne RegTest1Fail \n\t" \
\r
468 " cmpwi 4, 4 \n\t" \
\r
469 " bne RegTest1Fail \n\t" \
\r
470 " cmpwi 5, 5 \n\t" \
\r
471 " bne RegTest1Fail \n\t" \
\r
472 " cmpwi 6, 6 \n\t" \
\r
473 " bne RegTest1Fail \n\t" \
\r
474 " cmpwi 7, 7 \n\t" \
\r
475 " bne RegTest1Fail \n\t" \
\r
476 " cmpwi 8, 8 \n\t" \
\r
477 " bne RegTest1Fail \n\t" \
\r
478 " cmpwi 9, 9 \n\t" \
\r
479 " bne RegTest1Fail \n\t" \
\r
480 " cmpwi 10, 10 \n\t" \
\r
481 " bne RegTest1Fail \n\t" \
\r
482 " cmpwi 11, 11 \n\t" \
\r
483 " bne RegTest1Fail \n\t" \
\r
484 " cmpwi 12, 12 \n\t" \
\r
485 " bne RegTest1Fail \n\t" \
\r
486 " cmpwi 13, 13 \n\t" \
\r
487 " bne RegTest1Fail \n\t" \
\r
488 " cmpwi 14, 14 \n\t" \
\r
489 " bne RegTest1Fail \n\t" \
\r
490 " cmpwi 15, 15 \n\t" \
\r
491 " bne RegTest1Fail \n\t" \
\r
492 " cmpwi 16, 16 \n\t" \
\r
493 " bne RegTest1Fail \n\t" \
\r
494 " cmpwi 17, 17 \n\t" \
\r
495 " bne RegTest1Fail \n\t" \
\r
496 " cmpwi 18, 18 \n\t" \
\r
497 " bne RegTest1Fail \n\t" \
\r
498 " cmpwi 19, 19 \n\t" \
\r
499 " bne RegTest1Fail \n\t" \
\r
500 " cmpwi 20, 20 \n\t" \
\r
501 " bne RegTest1Fail \n\t" \
\r
502 " cmpwi 21, 21 \n\t" \
\r
503 " bne RegTest1Fail \n\t" \
\r
504 " cmpwi 22, 22 \n\t" \
\r
505 " bne RegTest1Fail \n\t" \
\r
506 " cmpwi 23, 23 \n\t" \
\r
507 " bne RegTest1Fail \n\t" \
\r
508 " cmpwi 24, 24 \n\t" \
\r
509 " bne RegTest1Fail \n\t" \
\r
510 " cmpwi 25, 25 \n\t" \
\r
511 " bne RegTest1Fail \n\t" \
\r
512 " cmpwi 26, 26 \n\t" \
\r
513 " bne RegTest1Fail \n\t" \
\r
514 " cmpwi 27, 27 \n\t" \
\r
515 " bne RegTest1Fail \n\t" \
\r
516 " cmpwi 28, 28 \n\t" \
\r
517 " bne RegTest1Fail \n\t" \
\r
518 " cmpwi 29, 29 \n\t" \
\r
519 " bne RegTest1Fail \n\t" \
\r
520 " cmpwi 30, 30 \n\t" \
\r
521 " bne RegTest1Fail \n\t" \
\r
522 " cmpwi 31, 31 \n\t" \
\r
523 " bne RegTest1Fail \n\t" \
\r
525 " mfspr 0, 256 #USPRG0 \n\t" \
\r
526 " cmpwi 0, 301 \n\t" \
\r
527 " bne RegTest1Fail \n\t" \
\r
528 " mfspr 0, 8 #LR \n\t" \
\r
529 " cmpwi 0, 501 \n\t" \
\r
530 " bne RegTest1Fail \n\t" \
\r
531 " mfspr 0, 1 #XER \n\t" \
\r
532 " cmpwi 0, 4 \n\t" \
\r
533 " bne RegTest1Fail \n\t" \
\r
535 " bl prvRegTest1Pass \n\t" \
\r
536 " b RegTest1Start \n\t" \
\r
538 "RegTest1Fail: \n\t" \
\r
541 " bl prvRegTestFail \n\t" \
\r
542 " b RegTest1Start \n\t" \
\r
545 /*-----------------------------------------------------------*/
\r
547 static void prvRegTestTask2( void *pvParameters )
\r
549 /* Just to remove compiler warning. */
\r
550 ( void ) pvParameters;
\r
552 /* The second register test task as described at the top of this file.
\r
553 Note that this task fills the registers with different values to the
\r
554 first register test task. */
\r
557 "RegTest2Start: \n\t" \
\r
559 " li 0, 300 \n\t" \
\r
560 " mtspr 256, 0 #USPRG0 \n\t" \
\r
561 " li 0, 500 \n\t" \
\r
562 " mtspr 8, 0 #LR \n\t" \
\r
564 " mtspr 1, 0 #XER \n\t" \
\r
575 " li 10, 110 \n\t" \
\r
576 " li 11, 111 \n\t" \
\r
577 " li 12, 112 \n\t" \
\r
578 " li 13, 113 \n\t" \
\r
579 " li 14, 114 \n\t" \
\r
580 " li 15, 115 \n\t" \
\r
581 " li 16, 116 \n\t" \
\r
582 " li 17, 117 \n\t" \
\r
583 " li 18, 118 \n\t" \
\r
584 " li 19, 119 \n\t" \
\r
585 " li 20, 120 \n\t" \
\r
586 " li 21, 121 \n\t" \
\r
587 " li 22, 122 \n\t" \
\r
588 " li 23, 123 \n\t" \
\r
589 " li 24, 124 \n\t" \
\r
590 " li 25, 125 \n\t" \
\r
591 " li 26, 126 \n\t" \
\r
592 " li 27, 127 \n\t" \
\r
593 " li 28, 128 \n\t" \
\r
594 " li 29, 129 \n\t" \
\r
595 " li 30, 130 \n\t" \
\r
596 " li 31, 131 \n\t" \
\r
598 " cmpwi 0, 11 \n\t" \
\r
599 " bne RegTest2Fail \n\t" \
\r
600 " cmpwi 2, 12 \n\t" \
\r
601 " bne RegTest2Fail \n\t" \
\r
602 " cmpwi 3, 13 \n\t" \
\r
603 " bne RegTest2Fail \n\t" \
\r
604 " cmpwi 4, 14 \n\t" \
\r
605 " bne RegTest2Fail \n\t" \
\r
606 " cmpwi 5, 15 \n\t" \
\r
607 " bne RegTest2Fail \n\t" \
\r
608 " cmpwi 6, 16 \n\t" \
\r
609 " bne RegTest2Fail \n\t" \
\r
610 " cmpwi 7, 17 \n\t" \
\r
611 " bne RegTest2Fail \n\t" \
\r
612 " cmpwi 8, 18 \n\t" \
\r
613 " bne RegTest2Fail \n\t" \
\r
614 " cmpwi 9, 19 \n\t" \
\r
615 " bne RegTest2Fail \n\t" \
\r
616 " cmpwi 10, 110 \n\t" \
\r
617 " bne RegTest2Fail \n\t" \
\r
618 " cmpwi 11, 111 \n\t" \
\r
619 " bne RegTest2Fail \n\t" \
\r
620 " cmpwi 12, 112 \n\t" \
\r
621 " bne RegTest2Fail \n\t" \
\r
622 " cmpwi 13, 113 \n\t" \
\r
623 " bne RegTest2Fail \n\t" \
\r
624 " cmpwi 14, 114 \n\t" \
\r
625 " bne RegTest2Fail \n\t" \
\r
626 " cmpwi 15, 115 \n\t" \
\r
627 " bne RegTest2Fail \n\t" \
\r
628 " cmpwi 16, 116 \n\t" \
\r
629 " bne RegTest2Fail \n\t" \
\r
630 " cmpwi 17, 117 \n\t" \
\r
631 " bne RegTest2Fail \n\t" \
\r
632 " cmpwi 18, 118 \n\t" \
\r
633 " bne RegTest2Fail \n\t" \
\r
634 " cmpwi 19, 119 \n\t" \
\r
635 " bne RegTest2Fail \n\t" \
\r
636 " cmpwi 20, 120 \n\t" \
\r
637 " bne RegTest2Fail \n\t" \
\r
638 " cmpwi 21, 121 \n\t" \
\r
639 " bne RegTest2Fail \n\t" \
\r
640 " cmpwi 22, 122 \n\t" \
\r
641 " bne RegTest2Fail \n\t" \
\r
642 " cmpwi 23, 123 \n\t" \
\r
643 " bne RegTest2Fail \n\t" \
\r
644 " cmpwi 24, 124 \n\t" \
\r
645 " bne RegTest2Fail \n\t" \
\r
646 " cmpwi 25, 125 \n\t" \
\r
647 " bne RegTest2Fail \n\t" \
\r
648 " cmpwi 26, 126 \n\t" \
\r
649 " bne RegTest2Fail \n\t" \
\r
650 " cmpwi 27, 127 \n\t" \
\r
651 " bne RegTest2Fail \n\t" \
\r
652 " cmpwi 28, 128 \n\t" \
\r
653 " bne RegTest2Fail \n\t" \
\r
654 " cmpwi 29, 129 \n\t" \
\r
655 " bne RegTest2Fail \n\t" \
\r
656 " cmpwi 30, 130 \n\t" \
\r
657 " bne RegTest2Fail \n\t" \
\r
658 " cmpwi 31, 131 \n\t" \
\r
659 " bne RegTest2Fail \n\t" \
\r
661 " mfspr 0, 256 #USPRG0 \n\t" \
\r
662 " cmpwi 0, 300 \n\t" \
\r
663 " bne RegTest2Fail \n\t" \
\r
664 " mfspr 0, 8 #LR \n\t" \
\r
665 " cmpwi 0, 500 \n\t" \
\r
666 " bne RegTest2Fail \n\t" \
\r
667 " mfspr 0, 1 #XER \n\t" \
\r
668 " cmpwi 0, 4 \n\t" \
\r
669 " bne RegTest2Fail \n\t" \
\r
671 " bl prvRegTest2Pass \n\t" \
\r
672 " b RegTest2Start \n\t" \
\r
674 "RegTest2Fail: \n\t" \
\r
677 " bl prvRegTestFail \n\t" \
\r
678 " b RegTest2Start \n\t" \
\r
681 /*-----------------------------------------------------------*/
\r
683 /* This hook function will get called if there is a suspected stack overflow.
\r
684 An overflow can cause the task name to be corrupted, in which case the task
\r
685 handle needs to be used to determine the offending task. */
\r
686 void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName );
\r
687 void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName )
\r
689 /* To prevent the optimiser removing the variables. */
\r
690 volatile xTaskHandle xTaskIn = xTask;
\r
691 volatile signed portCHAR *pcTaskNameIn = pcTaskName;
\r
693 /* Remove compiler warnings. */
\r
695 ( void ) pcTaskNameIn;
\r
697 /* The following three calls are simply to stop compiler warnings about the
\r
698 functions not being used - they are called from the inline assembly. */
\r