2 FreeRTOS V7.2.0 - 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
68 * Creates all the demo application tasks, then starts the scheduler. The WEB
\r
69 * documentation provides more details of the demo application tasks.
\r
71 * In addition to the standard demo tasks, the follow demo specific tasks are
\r
74 * The "Check" task. This only executes every three seconds but has the highest
\r
75 * priority so is guaranteed to get processor time. Its main function is to
\r
76 * check that all the other tasks are still operational. Most tasks maintain
\r
77 * a unique count that is incremented each time the task successfully completes
\r
78 * its function. Should any error occur within such a task the count is
\r
79 * permanently halted. The check task inspects the count of each task to ensure
\r
80 * it has changed since the last time the check task executed. If all the count
\r
81 * variables have changed all the tasks are still executing error free, and the
\r
82 * check task toggles the onboard LED. Should any task contain an error at any time
\r
83 * the LED toggle rate will change from 3 seconds to 500ms.
\r
85 * The "Register Check" tasks. These tasks fill the CPU registers with known
\r
86 * values, then check that each register still contains the expected value, the
\r
87 * discovery of an unexpected value being indicative of an error in the RTOS
\r
88 * context switch mechanism. The register check tasks operate at low priority
\r
89 * so are switched in and out frequently.
\r
93 /* Scheduler includes. */
\r
94 #include "FreeRTOS.h"
\r
97 /* Xilinx library includes. */
\r
98 #include "xcache_l.h"
\r
101 /* Demo application includes. */
\r
103 #include "integer.h"
\r
104 #include "comtest2.h"
\r
105 #include "semtest.h"
\r
106 #include "BlockQ.h"
\r
107 #include "dynamic.h"
\r
108 #include "GenQTest.h"
\r
110 #include "blocktim.h"
\r
112 #include "partest.h"
\r
113 #include "countsem.h"
\r
114 #include "recmutex.h"
\r
116 #include "flop-reg-test.h"
\r
118 /* Priorities assigned to the demo tasks. */
\r
119 #define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
\r
120 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
121 #define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
122 #define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
123 #define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
124 #define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
125 #define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY )
\r
126 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
127 #define mainFLOP_PRIORITY ( tskIDLE_PRIORITY )
\r
129 /* The first LED used by the COM test and check tasks respectively. */
\r
130 #define mainCOM_TEST_LED ( 4 )
\r
131 #define mainCHECK_TEST_LED ( 3 )
\r
133 /* The baud rate used by the comtest tasks is set by the hardware, so the
\r
134 baud rate parameters passed into the comtest initialisation has no effect. */
\r
135 #define mainBAUD_SET_IN_HARDWARE ( 0 )
\r
137 /* Delay periods used by the check task. If no errors have been found then
\r
138 the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an
\r
139 error has been found at any time then the toggle rate will increase to
\r
140 mainERROR_CHECK_DELAY milliseconds. */
\r
141 #define mainNO_ERROR_CHECK_DELAY ( ( portTickType ) 3000 / portTICK_RATE_MS )
\r
142 #define mainERROR_CHECK_DELAY ( ( portTickType ) 500 / portTICK_RATE_MS )
\r
146 * The tasks defined within this file - described within the comments at the
\r
147 * head of this page.
\r
149 static void prvRegTestTask1( void *pvParameters );
\r
150 static void prvRegTestTask2( void *pvParameters );
\r
151 static void prvErrorChecks( void *pvParameters );
\r
154 * Called by the 'check' task to inspect all the standard demo tasks within
\r
155 * the system, as described within the comments at the head of this page.
\r
157 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void );
\r
160 * Perform any hardware initialisation required by the demo application.
\r
162 static void prvSetupHardware( void );
\r
164 /*-----------------------------------------------------------*/
\r
166 /* xRegTestStatus will get set to pdFAIL by the regtest tasks if they
\r
167 discover an unexpected value. */
\r
168 static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS;
\r
170 /* Counters used to ensure the regtest tasks are still running. */
\r
171 static volatile unsigned portLONG ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
\r
173 /*-----------------------------------------------------------*/
\r
178 /* Must be called prior to installing any interrupt handlers! */
\r
179 vPortSetupInterruptController();
\r
181 /* In this case prvSetupHardware() just enables the caches and and
\r
182 configures the IO ports for the LED outputs. */
\r
183 prvSetupHardware();
\r
185 /* Start the standard demo application tasks. Note that the baud rate used
\r
186 by the comtest tasks is set by the hardware, so the baud rate parameter
\r
187 passed has no effect. */
\r
188 vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
\r
189 vStartIntegerMathTasks( tskIDLE_PRIORITY );
\r
190 vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED );
\r
191 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
192 vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY );
\r
193 vStartDynamicPriorityTasks();
\r
194 vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
\r
195 vStartQueuePeekTasks();
\r
196 vCreateBlockTimeTasks();
\r
197 vStartCountingSemaphoreTasks();
\r
198 vStartRecursiveMutexTasks();
\r
200 #if ( configUSE_FPU == 1 )
\r
201 vStartMathTasks( mainFLOP_PRIORITY );
\r
202 vStartFlopRegTests();
\r
205 /* Create the tasks defined within this file. */
\r
206 xTaskCreate( prvRegTestTask1, ( signed portCHAR * ) "Regtest1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
\r
207 xTaskCreate( prvRegTestTask2, ( signed portCHAR * ) "Regtest2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
\r
208 xTaskCreate( prvErrorChecks, ( signed portCHAR * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
\r
210 /* The suicide tasks must be started last as they record the number of other
\r
211 tasks that exist within the system. The value is then used to ensure at run
\r
212 time the number of tasks that exists is within expected bounds. */
\r
213 vCreateSuicidalTasks( mainDEATH_PRIORITY );
\r
215 /* Now start the scheduler. Following this call the created tasks should
\r
217 vTaskStartScheduler();
\r
219 /* vTaskStartScheduler() will only return if an error occurs while the
\r
220 idle task is being created. */
\r
225 /*-----------------------------------------------------------*/
\r
227 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void )
\r
229 portBASE_TYPE lReturn = pdPASS;
\r
230 static unsigned portLONG ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL;
\r
232 /* The demo tasks maintain a count that increments every cycle of the task
\r
233 provided that the task has never encountered an error. This function
\r
234 checks the counts maintained by the tasks to ensure they are still being
\r
235 incremented. A count remaining at the same value between calls therefore
\r
236 indicates that an error has been detected. */
\r
238 if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
243 if( xAreComTestTasksStillRunning() != pdTRUE )
\r
248 if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
253 if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
258 if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
\r
263 if( xIsCreateTaskStillRunning() != pdTRUE )
\r
268 if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
273 if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
278 if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
283 if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
\r
288 if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
293 #if ( configUSE_FPU == 1 )
\r
294 if( xAreMathsTaskStillRunning() != pdTRUE )
\r
299 if( xAreFlopRegisterTestsStillRunning() != pdTRUE )
\r
305 /* Have the register test tasks found any errors? */
\r
306 if( xRegTestStatus != pdPASS )
\r
311 /* Are the register test tasks still looping? */
\r
312 if( ulLastRegTest1Counter == ulRegTest1Counter )
\r
318 ulLastRegTest1Counter = ulRegTest1Counter;
\r
321 if( ulLastRegTest2Counter == ulRegTest2Counter )
\r
327 ulLastRegTest2Counter = ulRegTest2Counter;
\r
332 /*-----------------------------------------------------------*/
\r
334 static void prvErrorChecks( void *pvParameters )
\r
336 portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime;
\r
337 volatile unsigned portBASE_TYPE uxFreeStack;
\r
339 /* Just to remove compiler warning. */
\r
340 ( void ) pvParameters;
\r
342 /* This call is just to demonstrate the use of the function - nothing is
\r
343 done with the value. You would expect the stack high water mark to be
\r
344 lower (the function to return a larger value) here at function entry than
\r
345 later following calls to other functions. */
\r
346 uxFreeStack = uxTaskGetStackHighWaterMark( NULL );
\r
348 /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
\r
349 works correctly. */
\r
350 xLastExecutionTime = xTaskGetTickCount();
\r
352 /* Cycle for ever, delaying then checking all the other tasks are still
\r
353 operating without error. */
\r
356 /* Again just for demo purposes - uxFreeStack should have a lower value
\r
357 here than following the call to uxTaskGetStackHighWaterMark() on the
\r
359 uxFreeStack = uxTaskGetStackHighWaterMark( NULL );
\r
361 /* Wait until it is time to check again. The time we wait here depends
\r
362 on whether an error has been detected or not. When an error is
\r
363 detected the time is shortened resulting in a faster LED flash rate. */
\r
364 vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );
\r
366 /* See if the other tasks are all ok. */
\r
367 if( prvCheckOtherTasksAreStillRunning() != pdPASS )
\r
369 /* An error occurred in one of the tasks so shorten the delay
\r
370 period - which has the effect of increasing the frequency of the
\r
372 xDelayPeriod = mainERROR_CHECK_DELAY;
\r
376 vParTestToggleLED( mainCHECK_TEST_LED );
\r
379 /*-----------------------------------------------------------*/
\r
381 static void prvSetupHardware( void )
\r
383 XCache_EnableICache( 0x80000000 );
\r
384 XCache_EnableDCache( 0x80000000 );
\r
386 /* Setup the IO port for use with the LED outputs. */
\r
387 vParTestInitialise();
\r
389 /*-----------------------------------------------------------*/
\r
391 void prvRegTest1Pass( void )
\r
393 /* Called from the inline assembler - this cannot be static
\r
394 otherwise it can get optimised away. */
\r
395 ulRegTest1Counter++;
\r
397 /*-----------------------------------------------------------*/
\r
399 void prvRegTest2Pass( void )
\r
401 /* Called from the inline assembler - this cannot be static
\r
402 otherwise it can get optimised away. */
\r
403 ulRegTest2Counter++;
\r
405 /*-----------------------------------------------------------*/
\r
407 void prvRegTestFail( void )
\r
409 /* Called from the inline assembler - this cannot be static
\r
410 otherwise it can get optimised away. */
\r
411 xRegTestStatus = pdFAIL;
\r
413 /*-----------------------------------------------------------*/
\r
415 static void prvRegTestTask1( void *pvParameters )
\r
417 /* Just to remove compiler warning. */
\r
418 ( void ) pvParameters;
\r
420 /* The first register test task as described at the top of this file. The
\r
421 values used in the registers are different to those use in the second
\r
422 register test task. Also, unlike the second register test task, this task
\r
423 yields between setting the register values and subsequently checking the
\r
424 register values. */
\r
427 "RegTest1Start: \n\t" \
\r
429 " li 0, 301 \n\t" \
\r
430 " mtspr 256, 0 #USPRG0 \n\t" \
\r
431 " li 0, 501 \n\t" \
\r
432 " mtspr 8, 0 #LR \n\t" \
\r
434 " mtspr 1, 0 #XER \n\t" \
\r
445 " li 10, 10 \n\t" \
\r
446 " li 11, 11 \n\t" \
\r
447 " li 12, 12 \n\t" \
\r
448 " li 13, 13 \n\t" \
\r
449 " li 14, 14 \n\t" \
\r
450 " li 15, 15 \n\t" \
\r
451 " li 16, 16 \n\t" \
\r
452 " li 17, 17 \n\t" \
\r
453 " li 18, 18 \n\t" \
\r
454 " li 19, 19 \n\t" \
\r
455 " li 20, 20 \n\t" \
\r
456 " li 21, 21 \n\t" \
\r
457 " li 22, 22 \n\t" \
\r
458 " li 23, 23 \n\t" \
\r
459 " li 24, 24 \n\t" \
\r
460 " li 25, 25 \n\t" \
\r
461 " li 26, 26 \n\t" \
\r
462 " li 27, 27 \n\t" \
\r
463 " li 28, 28 \n\t" \
\r
464 " li 29, 29 \n\t" \
\r
465 " li 30, 30 \n\t" \
\r
466 " li 31, 31 \n\t" \
\r
471 " cmpwi 0, 1 \n\t" \
\r
472 " bne RegTest1Fail \n\t" \
\r
473 " cmpwi 2, 2 \n\t" \
\r
474 " bne RegTest1Fail \n\t" \
\r
475 " cmpwi 3, 3 \n\t" \
\r
476 " bne RegTest1Fail \n\t" \
\r
477 " cmpwi 4, 4 \n\t" \
\r
478 " bne RegTest1Fail \n\t" \
\r
479 " cmpwi 5, 5 \n\t" \
\r
480 " bne RegTest1Fail \n\t" \
\r
481 " cmpwi 6, 6 \n\t" \
\r
482 " bne RegTest1Fail \n\t" \
\r
483 " cmpwi 7, 7 \n\t" \
\r
484 " bne RegTest1Fail \n\t" \
\r
485 " cmpwi 8, 8 \n\t" \
\r
486 " bne RegTest1Fail \n\t" \
\r
487 " cmpwi 9, 9 \n\t" \
\r
488 " bne RegTest1Fail \n\t" \
\r
489 " cmpwi 10, 10 \n\t" \
\r
490 " bne RegTest1Fail \n\t" \
\r
491 " cmpwi 11, 11 \n\t" \
\r
492 " bne RegTest1Fail \n\t" \
\r
493 " cmpwi 12, 12 \n\t" \
\r
494 " bne RegTest1Fail \n\t" \
\r
495 " cmpwi 13, 13 \n\t" \
\r
496 " bne RegTest1Fail \n\t" \
\r
497 " cmpwi 14, 14 \n\t" \
\r
498 " bne RegTest1Fail \n\t" \
\r
499 " cmpwi 15, 15 \n\t" \
\r
500 " bne RegTest1Fail \n\t" \
\r
501 " cmpwi 16, 16 \n\t" \
\r
502 " bne RegTest1Fail \n\t" \
\r
503 " cmpwi 17, 17 \n\t" \
\r
504 " bne RegTest1Fail \n\t" \
\r
505 " cmpwi 18, 18 \n\t" \
\r
506 " bne RegTest1Fail \n\t" \
\r
507 " cmpwi 19, 19 \n\t" \
\r
508 " bne RegTest1Fail \n\t" \
\r
509 " cmpwi 20, 20 \n\t" \
\r
510 " bne RegTest1Fail \n\t" \
\r
511 " cmpwi 21, 21 \n\t" \
\r
512 " bne RegTest1Fail \n\t" \
\r
513 " cmpwi 22, 22 \n\t" \
\r
514 " bne RegTest1Fail \n\t" \
\r
515 " cmpwi 23, 23 \n\t" \
\r
516 " bne RegTest1Fail \n\t" \
\r
517 " cmpwi 24, 24 \n\t" \
\r
518 " bne RegTest1Fail \n\t" \
\r
519 " cmpwi 25, 25 \n\t" \
\r
520 " bne RegTest1Fail \n\t" \
\r
521 " cmpwi 26, 26 \n\t" \
\r
522 " bne RegTest1Fail \n\t" \
\r
523 " cmpwi 27, 27 \n\t" \
\r
524 " bne RegTest1Fail \n\t" \
\r
525 " cmpwi 28, 28 \n\t" \
\r
526 " bne RegTest1Fail \n\t" \
\r
527 " cmpwi 29, 29 \n\t" \
\r
528 " bne RegTest1Fail \n\t" \
\r
529 " cmpwi 30, 30 \n\t" \
\r
530 " bne RegTest1Fail \n\t" \
\r
531 " cmpwi 31, 31 \n\t" \
\r
532 " bne RegTest1Fail \n\t" \
\r
534 " mfspr 0, 256 #USPRG0 \n\t" \
\r
535 " cmpwi 0, 301 \n\t" \
\r
536 " bne RegTest1Fail \n\t" \
\r
537 " mfspr 0, 8 #LR \n\t" \
\r
538 " cmpwi 0, 501 \n\t" \
\r
539 " bne RegTest1Fail \n\t" \
\r
540 " mfspr 0, 1 #XER \n\t" \
\r
541 " cmpwi 0, 4 \n\t" \
\r
542 " bne RegTest1Fail \n\t" \
\r
544 " bl prvRegTest1Pass \n\t" \
\r
545 " b RegTest1Start \n\t" \
\r
547 "RegTest1Fail: \n\t" \
\r
550 " bl prvRegTestFail \n\t" \
\r
551 " b RegTest1Start \n\t" \
\r
554 /*-----------------------------------------------------------*/
\r
556 static void prvRegTestTask2( void *pvParameters )
\r
558 /* Just to remove compiler warning. */
\r
559 ( void ) pvParameters;
\r
561 /* The second register test task as described at the top of this file.
\r
562 Note that this task fills the registers with different values to the
\r
563 first register test task. */
\r
566 "RegTest2Start: \n\t" \
\r
568 " li 0, 300 \n\t" \
\r
569 " mtspr 256, 0 #USPRG0 \n\t" \
\r
570 " li 0, 500 \n\t" \
\r
571 " mtspr 8, 0 #LR \n\t" \
\r
573 " mtspr 1, 0 #XER \n\t" \
\r
584 " li 10, 110 \n\t" \
\r
585 " li 11, 111 \n\t" \
\r
586 " li 12, 112 \n\t" \
\r
587 " li 13, 113 \n\t" \
\r
588 " li 14, 114 \n\t" \
\r
589 " li 15, 115 \n\t" \
\r
590 " li 16, 116 \n\t" \
\r
591 " li 17, 117 \n\t" \
\r
592 " li 18, 118 \n\t" \
\r
593 " li 19, 119 \n\t" \
\r
594 " li 20, 120 \n\t" \
\r
595 " li 21, 121 \n\t" \
\r
596 " li 22, 122 \n\t" \
\r
597 " li 23, 123 \n\t" \
\r
598 " li 24, 124 \n\t" \
\r
599 " li 25, 125 \n\t" \
\r
600 " li 26, 126 \n\t" \
\r
601 " li 27, 127 \n\t" \
\r
602 " li 28, 128 \n\t" \
\r
603 " li 29, 129 \n\t" \
\r
604 " li 30, 130 \n\t" \
\r
605 " li 31, 131 \n\t" \
\r
607 " cmpwi 0, 11 \n\t" \
\r
608 " bne RegTest2Fail \n\t" \
\r
609 " cmpwi 2, 12 \n\t" \
\r
610 " bne RegTest2Fail \n\t" \
\r
611 " cmpwi 3, 13 \n\t" \
\r
612 " bne RegTest2Fail \n\t" \
\r
613 " cmpwi 4, 14 \n\t" \
\r
614 " bne RegTest2Fail \n\t" \
\r
615 " cmpwi 5, 15 \n\t" \
\r
616 " bne RegTest2Fail \n\t" \
\r
617 " cmpwi 6, 16 \n\t" \
\r
618 " bne RegTest2Fail \n\t" \
\r
619 " cmpwi 7, 17 \n\t" \
\r
620 " bne RegTest2Fail \n\t" \
\r
621 " cmpwi 8, 18 \n\t" \
\r
622 " bne RegTest2Fail \n\t" \
\r
623 " cmpwi 9, 19 \n\t" \
\r
624 " bne RegTest2Fail \n\t" \
\r
625 " cmpwi 10, 110 \n\t" \
\r
626 " bne RegTest2Fail \n\t" \
\r
627 " cmpwi 11, 111 \n\t" \
\r
628 " bne RegTest2Fail \n\t" \
\r
629 " cmpwi 12, 112 \n\t" \
\r
630 " bne RegTest2Fail \n\t" \
\r
631 " cmpwi 13, 113 \n\t" \
\r
632 " bne RegTest2Fail \n\t" \
\r
633 " cmpwi 14, 114 \n\t" \
\r
634 " bne RegTest2Fail \n\t" \
\r
635 " cmpwi 15, 115 \n\t" \
\r
636 " bne RegTest2Fail \n\t" \
\r
637 " cmpwi 16, 116 \n\t" \
\r
638 " bne RegTest2Fail \n\t" \
\r
639 " cmpwi 17, 117 \n\t" \
\r
640 " bne RegTest2Fail \n\t" \
\r
641 " cmpwi 18, 118 \n\t" \
\r
642 " bne RegTest2Fail \n\t" \
\r
643 " cmpwi 19, 119 \n\t" \
\r
644 " bne RegTest2Fail \n\t" \
\r
645 " cmpwi 20, 120 \n\t" \
\r
646 " bne RegTest2Fail \n\t" \
\r
647 " cmpwi 21, 121 \n\t" \
\r
648 " bne RegTest2Fail \n\t" \
\r
649 " cmpwi 22, 122 \n\t" \
\r
650 " bne RegTest2Fail \n\t" \
\r
651 " cmpwi 23, 123 \n\t" \
\r
652 " bne RegTest2Fail \n\t" \
\r
653 " cmpwi 24, 124 \n\t" \
\r
654 " bne RegTest2Fail \n\t" \
\r
655 " cmpwi 25, 125 \n\t" \
\r
656 " bne RegTest2Fail \n\t" \
\r
657 " cmpwi 26, 126 \n\t" \
\r
658 " bne RegTest2Fail \n\t" \
\r
659 " cmpwi 27, 127 \n\t" \
\r
660 " bne RegTest2Fail \n\t" \
\r
661 " cmpwi 28, 128 \n\t" \
\r
662 " bne RegTest2Fail \n\t" \
\r
663 " cmpwi 29, 129 \n\t" \
\r
664 " bne RegTest2Fail \n\t" \
\r
665 " cmpwi 30, 130 \n\t" \
\r
666 " bne RegTest2Fail \n\t" \
\r
667 " cmpwi 31, 131 \n\t" \
\r
668 " bne RegTest2Fail \n\t" \
\r
670 " mfspr 0, 256 #USPRG0 \n\t" \
\r
671 " cmpwi 0, 300 \n\t" \
\r
672 " bne RegTest2Fail \n\t" \
\r
673 " mfspr 0, 8 #LR \n\t" \
\r
674 " cmpwi 0, 500 \n\t" \
\r
675 " bne RegTest2Fail \n\t" \
\r
676 " mfspr 0, 1 #XER \n\t" \
\r
677 " cmpwi 0, 4 \n\t" \
\r
678 " bne RegTest2Fail \n\t" \
\r
680 " bl prvRegTest2Pass \n\t" \
\r
681 " b RegTest2Start \n\t" \
\r
683 "RegTest2Fail: \n\t" \
\r
686 " bl prvRegTestFail \n\t" \
\r
687 " b RegTest2Start \n\t" \
\r
690 /*-----------------------------------------------------------*/
\r
692 /* This hook function will get called if there is a suspected stack overflow.
\r
693 An overflow can cause the task name to be corrupted, in which case the task
\r
694 handle needs to be used to determine the offending task. */
\r
695 void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName );
\r
696 void vApplicationStackOverflowHook( xTaskHandle xTask, signed portCHAR *pcTaskName )
\r
698 /* To prevent the optimiser removing the variables. */
\r
699 volatile xTaskHandle xTaskIn = xTask;
\r
700 volatile signed portCHAR *pcTaskNameIn = pcTaskName;
\r
702 /* Remove compiler warnings. */
\r
704 ( void ) pcTaskNameIn;
\r
706 /* The following three calls are simply to stop compiler warnings about the
\r
707 functions not being used - they are called from the inline assembly. */
\r