2 * FreeRTOS Kernel V10.0.0
\r
3 * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 * this software and associated documentation files (the "Software"), to deal in
\r
7 * the Software without restriction, including without limitation the rights to
\r
8 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 * subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in all
\r
13 * copies or substantial portions of the Software. If you wish to use our Amazon
\r
14 * FreeRTOS name, please do so in a fair use way that does not cause confusion.
\r
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
18 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
19 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
23 * http://www.FreeRTOS.org
\r
24 * http://aws.amazon.com/freertos
\r
26 * 1 tab == 4 spaces!
\r
30 * Creates all the demo application tasks, then starts the scheduler. The WEB
\r
31 * documentation provides more details of the demo application tasks.
\r
33 * In addition to the standard demo tasks, the follow demo specific tasks are
\r
36 * The "Check" task. This only executes every three seconds but has the highest
\r
37 * priority so is guaranteed to get processor time. Its main function is to
\r
38 * check that all the other tasks are still operational. Most tasks maintain
\r
39 * a unique count that is incremented each time the task successfully completes
\r
40 * its function. Should any error occur within such a task the count is
\r
41 * permanently halted. The check task inspects the count of each task to ensure
\r
42 * it has changed since the last time the check task executed. If all the count
\r
43 * variables have changed all the tasks are still executing error free, and the
\r
44 * check task toggles the onboard LED. Should any task contain an error at any time
\r
45 * the LED toggle rate will change from 3 seconds to 500ms.
\r
47 * The "Register Check" tasks. These tasks fill the CPU registers with known
\r
48 * values, then check that each register still contains the expected value, the
\r
49 * discovery of an unexpected value being indicative of an error in the RTOS
\r
50 * context switch mechanism. The register check tasks operate at low priority
\r
51 * so are switched in and out frequently.
\r
55 /* Scheduler includes. */
\r
56 #include "FreeRTOS.h"
\r
59 /* Xilinx library includes. */
\r
60 #include "xcache_l.h"
\r
63 /* Demo application includes. */
\r
65 #include "integer.h"
\r
66 #include "comtest2.h"
\r
67 #include "semtest.h"
\r
69 #include "dynamic.h"
\r
70 #include "GenQTest.h"
\r
72 #include "blocktim.h"
\r
74 #include "partest.h"
\r
75 #include "countsem.h"
\r
76 #include "recmutex.h"
\r
78 #include "flop-reg-test.h"
\r
80 /* Priorities assigned to the demo tasks. */
\r
81 #define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
\r
82 #define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
83 #define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
84 #define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
85 #define mainDEATH_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
86 #define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
87 #define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY )
\r
88 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
89 #define mainFLOP_PRIORITY ( tskIDLE_PRIORITY )
\r
91 /* The first LED used by the COM test and check tasks respectively. */
\r
92 #define mainCOM_TEST_LED ( 4 )
\r
93 #define mainCHECK_TEST_LED ( 3 )
\r
95 /* The baud rate used by the comtest tasks is set by the hardware, so the
\r
96 baud rate parameters passed into the comtest initialisation has no effect. */
\r
97 #define mainBAUD_SET_IN_HARDWARE ( 0 )
\r
99 /* Delay periods used by the check task. If no errors have been found then
\r
100 the check LED will toggle every mainNO_ERROR_CHECK_DELAY milliseconds. If an
\r
101 error has been found at any time then the toggle rate will increase to
\r
102 mainERROR_CHECK_DELAY milliseconds. */
\r
103 #define mainNO_ERROR_CHECK_DELAY ( ( TickType_t ) 3000 / portTICK_PERIOD_MS )
\r
104 #define mainERROR_CHECK_DELAY ( ( TickType_t ) 500 / portTICK_PERIOD_MS )
\r
108 * The tasks defined within this file - described within the comments at the
\r
109 * head of this page.
\r
111 static void prvRegTestTask1( void *pvParameters );
\r
112 static void prvRegTestTask2( void *pvParameters );
\r
113 static void prvErrorChecks( void *pvParameters );
\r
116 * Called by the 'check' task to inspect all the standard demo tasks within
\r
117 * the system, as described within the comments at the head of this page.
\r
119 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void );
\r
122 * Perform any hardware initialisation required by the demo application.
\r
124 static void prvSetupHardware( void );
\r
126 /*-----------------------------------------------------------*/
\r
128 /* xRegTestStatus will get set to pdFAIL by the regtest tasks if they
\r
129 discover an unexpected value. */
\r
130 static volatile unsigned portBASE_TYPE xRegTestStatus = pdPASS;
\r
132 /* Counters used to ensure the regtest tasks are still running. */
\r
133 static volatile unsigned long ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
\r
135 /*-----------------------------------------------------------*/
\r
140 /* Must be called prior to installing any interrupt handlers! */
\r
141 vPortSetupInterruptController();
\r
143 /* In this case prvSetupHardware() just enables the caches and and
\r
144 configures the IO ports for the LED outputs. */
\r
145 prvSetupHardware();
\r
147 /* Start the standard demo application tasks. Note that the baud rate used
\r
148 by the comtest tasks is set by the hardware, so the baud rate parameter
\r
149 passed has no effect. */
\r
150 vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
\r
151 vStartIntegerMathTasks( tskIDLE_PRIORITY );
\r
152 vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_SET_IN_HARDWARE, mainCOM_TEST_LED );
\r
153 vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
\r
154 vStartBlockingQueueTasks ( mainQUEUE_BLOCK_PRIORITY );
\r
155 vStartDynamicPriorityTasks();
\r
156 vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
\r
157 vStartQueuePeekTasks();
\r
158 vCreateBlockTimeTasks();
\r
159 vStartCountingSemaphoreTasks();
\r
160 vStartRecursiveMutexTasks();
\r
162 #if ( configUSE_FPU == 1 )
\r
163 vStartMathTasks( mainFLOP_PRIORITY );
\r
164 vStartFlopRegTests();
\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
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
177 /* Now start the scheduler. Following this call the created tasks should
\r
179 vTaskStartScheduler();
\r
181 /* vTaskStartScheduler() will only return if an error occurs while the
\r
182 idle task is being created. */
\r
187 /*-----------------------------------------------------------*/
\r
189 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void )
\r
191 portBASE_TYPE lReturn = pdPASS;
\r
192 static unsigned long ulLastRegTest1Counter= 0UL, ulLastRegTest2Counter = 0UL;
\r
194 /* The demo tasks maintain a count that increments every cycle of the task
\r
195 provided that the task has never encountered an error. This function
\r
196 checks the counts maintained by the tasks to ensure they are still being
\r
197 incremented. A count remaining at the same value between calls therefore
\r
198 indicates that an error has been detected. */
\r
200 if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
205 if( xAreComTestTasksStillRunning() != pdTRUE )
\r
210 if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
215 if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
220 if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
\r
225 if( xIsCreateTaskStillRunning() != pdTRUE )
\r
230 if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
235 if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
240 if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
245 if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
\r
250 if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
255 #if ( configUSE_FPU == 1 )
\r
256 if( xAreMathsTaskStillRunning() != pdTRUE )
\r
261 if( xAreFlopRegisterTestsStillRunning() != pdTRUE )
\r
267 /* Have the register test tasks found any errors? */
\r
268 if( xRegTestStatus != pdPASS )
\r
273 /* Are the register test tasks still looping? */
\r
274 if( ulLastRegTest1Counter == ulRegTest1Counter )
\r
280 ulLastRegTest1Counter = ulRegTest1Counter;
\r
283 if( ulLastRegTest2Counter == ulRegTest2Counter )
\r
289 ulLastRegTest2Counter = ulRegTest2Counter;
\r
294 /*-----------------------------------------------------------*/
\r
296 static void prvErrorChecks( void *pvParameters )
\r
298 TickType_t xDelayPeriod = mainNO_ERROR_CHECK_DELAY, xLastExecutionTime;
\r
299 volatile unsigned portBASE_TYPE uxFreeStack;
\r
301 /* Just to remove compiler warning. */
\r
302 ( void ) pvParameters;
\r
304 /* This call is just to demonstrate the use of the function - nothing is
\r
305 done with the value. You would expect the stack high water mark to be
\r
306 lower (the function to return a larger value) here at function entry than
\r
307 later following calls to other functions. */
\r
308 uxFreeStack = uxTaskGetStackHighWaterMark( NULL );
\r
310 /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil()
\r
311 works correctly. */
\r
312 xLastExecutionTime = xTaskGetTickCount();
\r
314 /* Cycle for ever, delaying then checking all the other tasks are still
\r
315 operating without error. */
\r
318 /* Again just for demo purposes - uxFreeStack should have a lower value
\r
319 here than following the call to uxTaskGetStackHighWaterMark() on the
\r
321 uxFreeStack = uxTaskGetStackHighWaterMark( NULL );
\r
323 /* Wait until it is time to check again. The time we wait here depends
\r
324 on whether an error has been detected or not. When an error is
\r
325 detected the time is shortened resulting in a faster LED flash rate. */
\r
326 vTaskDelayUntil( &xLastExecutionTime, xDelayPeriod );
\r
328 /* See if the other tasks are all ok. */
\r
329 if( prvCheckOtherTasksAreStillRunning() != pdPASS )
\r
331 /* An error occurred in one of the tasks so shorten the delay
\r
332 period - which has the effect of increasing the frequency of the
\r
334 xDelayPeriod = mainERROR_CHECK_DELAY;
\r
338 vParTestToggleLED( mainCHECK_TEST_LED );
\r
341 /*-----------------------------------------------------------*/
\r
343 static void prvSetupHardware( void )
\r
345 XCache_EnableICache( 0x80000000 );
\r
346 XCache_EnableDCache( 0x80000000 );
\r
348 /* Setup the IO port for use with the LED outputs. */
\r
349 vParTestInitialise();
\r
351 /*-----------------------------------------------------------*/
\r
353 void prvRegTest1Pass( void )
\r
355 /* Called from the inline assembler - this cannot be static
\r
356 otherwise it can get optimised away. */
\r
357 ulRegTest1Counter++;
\r
359 /*-----------------------------------------------------------*/
\r
361 void prvRegTest2Pass( void )
\r
363 /* Called from the inline assembler - this cannot be static
\r
364 otherwise it can get optimised away. */
\r
365 ulRegTest2Counter++;
\r
367 /*-----------------------------------------------------------*/
\r
369 void prvRegTestFail( void )
\r
371 /* Called from the inline assembler - this cannot be static
\r
372 otherwise it can get optimised away. */
\r
373 xRegTestStatus = pdFAIL;
\r
375 /*-----------------------------------------------------------*/
\r
377 static void prvRegTestTask1( void *pvParameters )
\r
379 /* Just to remove compiler warning. */
\r
380 ( void ) pvParameters;
\r
382 /* The first register test task as described at the top of this file. The
\r
383 values used in the registers are different to those use in the second
\r
384 register test task. Also, unlike the second register test task, this task
\r
385 yields between setting the register values and subsequently checking the
\r
386 register values. */
\r
389 "RegTest1Start: \n\t" \
\r
391 " li 0, 301 \n\t" \
\r
392 " mtspr 256, 0 #USPRG0 \n\t" \
\r
393 " li 0, 501 \n\t" \
\r
394 " mtspr 8, 0 #LR \n\t" \
\r
396 " mtspr 1, 0 #XER \n\t" \
\r
407 " li 10, 10 \n\t" \
\r
408 " li 11, 11 \n\t" \
\r
409 " li 12, 12 \n\t" \
\r
410 " li 13, 13 \n\t" \
\r
411 " li 14, 14 \n\t" \
\r
412 " li 15, 15 \n\t" \
\r
413 " li 16, 16 \n\t" \
\r
414 " li 17, 17 \n\t" \
\r
415 " li 18, 18 \n\t" \
\r
416 " li 19, 19 \n\t" \
\r
417 " li 20, 20 \n\t" \
\r
418 " li 21, 21 \n\t" \
\r
419 " li 22, 22 \n\t" \
\r
420 " li 23, 23 \n\t" \
\r
421 " li 24, 24 \n\t" \
\r
422 " li 25, 25 \n\t" \
\r
423 " li 26, 26 \n\t" \
\r
424 " li 27, 27 \n\t" \
\r
425 " li 28, 28 \n\t" \
\r
426 " li 29, 29 \n\t" \
\r
427 " li 30, 30 \n\t" \
\r
428 " li 31, 31 \n\t" \
\r
433 " cmpwi 0, 1 \n\t" \
\r
434 " bne RegTest1Fail \n\t" \
\r
435 " cmpwi 2, 2 \n\t" \
\r
436 " bne RegTest1Fail \n\t" \
\r
437 " cmpwi 3, 3 \n\t" \
\r
438 " bne RegTest1Fail \n\t" \
\r
439 " cmpwi 4, 4 \n\t" \
\r
440 " bne RegTest1Fail \n\t" \
\r
441 " cmpwi 5, 5 \n\t" \
\r
442 " bne RegTest1Fail \n\t" \
\r
443 " cmpwi 6, 6 \n\t" \
\r
444 " bne RegTest1Fail \n\t" \
\r
445 " cmpwi 7, 7 \n\t" \
\r
446 " bne RegTest1Fail \n\t" \
\r
447 " cmpwi 8, 8 \n\t" \
\r
448 " bne RegTest1Fail \n\t" \
\r
449 " cmpwi 9, 9 \n\t" \
\r
450 " bne RegTest1Fail \n\t" \
\r
451 " cmpwi 10, 10 \n\t" \
\r
452 " bne RegTest1Fail \n\t" \
\r
453 " cmpwi 11, 11 \n\t" \
\r
454 " bne RegTest1Fail \n\t" \
\r
455 " cmpwi 12, 12 \n\t" \
\r
456 " bne RegTest1Fail \n\t" \
\r
457 " cmpwi 13, 13 \n\t" \
\r
458 " bne RegTest1Fail \n\t" \
\r
459 " cmpwi 14, 14 \n\t" \
\r
460 " bne RegTest1Fail \n\t" \
\r
461 " cmpwi 15, 15 \n\t" \
\r
462 " bne RegTest1Fail \n\t" \
\r
463 " cmpwi 16, 16 \n\t" \
\r
464 " bne RegTest1Fail \n\t" \
\r
465 " cmpwi 17, 17 \n\t" \
\r
466 " bne RegTest1Fail \n\t" \
\r
467 " cmpwi 18, 18 \n\t" \
\r
468 " bne RegTest1Fail \n\t" \
\r
469 " cmpwi 19, 19 \n\t" \
\r
470 " bne RegTest1Fail \n\t" \
\r
471 " cmpwi 20, 20 \n\t" \
\r
472 " bne RegTest1Fail \n\t" \
\r
473 " cmpwi 21, 21 \n\t" \
\r
474 " bne RegTest1Fail \n\t" \
\r
475 " cmpwi 22, 22 \n\t" \
\r
476 " bne RegTest1Fail \n\t" \
\r
477 " cmpwi 23, 23 \n\t" \
\r
478 " bne RegTest1Fail \n\t" \
\r
479 " cmpwi 24, 24 \n\t" \
\r
480 " bne RegTest1Fail \n\t" \
\r
481 " cmpwi 25, 25 \n\t" \
\r
482 " bne RegTest1Fail \n\t" \
\r
483 " cmpwi 26, 26 \n\t" \
\r
484 " bne RegTest1Fail \n\t" \
\r
485 " cmpwi 27, 27 \n\t" \
\r
486 " bne RegTest1Fail \n\t" \
\r
487 " cmpwi 28, 28 \n\t" \
\r
488 " bne RegTest1Fail \n\t" \
\r
489 " cmpwi 29, 29 \n\t" \
\r
490 " bne RegTest1Fail \n\t" \
\r
491 " cmpwi 30, 30 \n\t" \
\r
492 " bne RegTest1Fail \n\t" \
\r
493 " cmpwi 31, 31 \n\t" \
\r
494 " bne RegTest1Fail \n\t" \
\r
496 " mfspr 0, 256 #USPRG0 \n\t" \
\r
497 " cmpwi 0, 301 \n\t" \
\r
498 " bne RegTest1Fail \n\t" \
\r
499 " mfspr 0, 8 #LR \n\t" \
\r
500 " cmpwi 0, 501 \n\t" \
\r
501 " bne RegTest1Fail \n\t" \
\r
502 " mfspr 0, 1 #XER \n\t" \
\r
503 " cmpwi 0, 4 \n\t" \
\r
504 " bne RegTest1Fail \n\t" \
\r
506 " bl prvRegTest1Pass \n\t" \
\r
507 " b RegTest1Start \n\t" \
\r
509 "RegTest1Fail: \n\t" \
\r
512 " bl prvRegTestFail \n\t" \
\r
513 " b RegTest1Start \n\t" \
\r
516 /*-----------------------------------------------------------*/
\r
518 static void prvRegTestTask2( void *pvParameters )
\r
520 /* Just to remove compiler warning. */
\r
521 ( void ) pvParameters;
\r
523 /* The second register test task as described at the top of this file.
\r
524 Note that this task fills the registers with different values to the
\r
525 first register test task. */
\r
528 "RegTest2Start: \n\t" \
\r
530 " li 0, 300 \n\t" \
\r
531 " mtspr 256, 0 #USPRG0 \n\t" \
\r
532 " li 0, 500 \n\t" \
\r
533 " mtspr 8, 0 #LR \n\t" \
\r
535 " mtspr 1, 0 #XER \n\t" \
\r
546 " li 10, 110 \n\t" \
\r
547 " li 11, 111 \n\t" \
\r
548 " li 12, 112 \n\t" \
\r
549 " li 13, 113 \n\t" \
\r
550 " li 14, 114 \n\t" \
\r
551 " li 15, 115 \n\t" \
\r
552 " li 16, 116 \n\t" \
\r
553 " li 17, 117 \n\t" \
\r
554 " li 18, 118 \n\t" \
\r
555 " li 19, 119 \n\t" \
\r
556 " li 20, 120 \n\t" \
\r
557 " li 21, 121 \n\t" \
\r
558 " li 22, 122 \n\t" \
\r
559 " li 23, 123 \n\t" \
\r
560 " li 24, 124 \n\t" \
\r
561 " li 25, 125 \n\t" \
\r
562 " li 26, 126 \n\t" \
\r
563 " li 27, 127 \n\t" \
\r
564 " li 28, 128 \n\t" \
\r
565 " li 29, 129 \n\t" \
\r
566 " li 30, 130 \n\t" \
\r
567 " li 31, 131 \n\t" \
\r
569 " cmpwi 0, 11 \n\t" \
\r
570 " bne RegTest2Fail \n\t" \
\r
571 " cmpwi 2, 12 \n\t" \
\r
572 " bne RegTest2Fail \n\t" \
\r
573 " cmpwi 3, 13 \n\t" \
\r
574 " bne RegTest2Fail \n\t" \
\r
575 " cmpwi 4, 14 \n\t" \
\r
576 " bne RegTest2Fail \n\t" \
\r
577 " cmpwi 5, 15 \n\t" \
\r
578 " bne RegTest2Fail \n\t" \
\r
579 " cmpwi 6, 16 \n\t" \
\r
580 " bne RegTest2Fail \n\t" \
\r
581 " cmpwi 7, 17 \n\t" \
\r
582 " bne RegTest2Fail \n\t" \
\r
583 " cmpwi 8, 18 \n\t" \
\r
584 " bne RegTest2Fail \n\t" \
\r
585 " cmpwi 9, 19 \n\t" \
\r
586 " bne RegTest2Fail \n\t" \
\r
587 " cmpwi 10, 110 \n\t" \
\r
588 " bne RegTest2Fail \n\t" \
\r
589 " cmpwi 11, 111 \n\t" \
\r
590 " bne RegTest2Fail \n\t" \
\r
591 " cmpwi 12, 112 \n\t" \
\r
592 " bne RegTest2Fail \n\t" \
\r
593 " cmpwi 13, 113 \n\t" \
\r
594 " bne RegTest2Fail \n\t" \
\r
595 " cmpwi 14, 114 \n\t" \
\r
596 " bne RegTest2Fail \n\t" \
\r
597 " cmpwi 15, 115 \n\t" \
\r
598 " bne RegTest2Fail \n\t" \
\r
599 " cmpwi 16, 116 \n\t" \
\r
600 " bne RegTest2Fail \n\t" \
\r
601 " cmpwi 17, 117 \n\t" \
\r
602 " bne RegTest2Fail \n\t" \
\r
603 " cmpwi 18, 118 \n\t" \
\r
604 " bne RegTest2Fail \n\t" \
\r
605 " cmpwi 19, 119 \n\t" \
\r
606 " bne RegTest2Fail \n\t" \
\r
607 " cmpwi 20, 120 \n\t" \
\r
608 " bne RegTest2Fail \n\t" \
\r
609 " cmpwi 21, 121 \n\t" \
\r
610 " bne RegTest2Fail \n\t" \
\r
611 " cmpwi 22, 122 \n\t" \
\r
612 " bne RegTest2Fail \n\t" \
\r
613 " cmpwi 23, 123 \n\t" \
\r
614 " bne RegTest2Fail \n\t" \
\r
615 " cmpwi 24, 124 \n\t" \
\r
616 " bne RegTest2Fail \n\t" \
\r
617 " cmpwi 25, 125 \n\t" \
\r
618 " bne RegTest2Fail \n\t" \
\r
619 " cmpwi 26, 126 \n\t" \
\r
620 " bne RegTest2Fail \n\t" \
\r
621 " cmpwi 27, 127 \n\t" \
\r
622 " bne RegTest2Fail \n\t" \
\r
623 " cmpwi 28, 128 \n\t" \
\r
624 " bne RegTest2Fail \n\t" \
\r
625 " cmpwi 29, 129 \n\t" \
\r
626 " bne RegTest2Fail \n\t" \
\r
627 " cmpwi 30, 130 \n\t" \
\r
628 " bne RegTest2Fail \n\t" \
\r
629 " cmpwi 31, 131 \n\t" \
\r
630 " bne RegTest2Fail \n\t" \
\r
632 " mfspr 0, 256 #USPRG0 \n\t" \
\r
633 " cmpwi 0, 300 \n\t" \
\r
634 " bne RegTest2Fail \n\t" \
\r
635 " mfspr 0, 8 #LR \n\t" \
\r
636 " cmpwi 0, 500 \n\t" \
\r
637 " bne RegTest2Fail \n\t" \
\r
638 " mfspr 0, 1 #XER \n\t" \
\r
639 " cmpwi 0, 4 \n\t" \
\r
640 " bne RegTest2Fail \n\t" \
\r
642 " bl prvRegTest2Pass \n\t" \
\r
643 " b RegTest2Start \n\t" \
\r
645 "RegTest2Fail: \n\t" \
\r
648 " bl prvRegTestFail \n\t" \
\r
649 " b RegTest2Start \n\t" \
\r
652 /*-----------------------------------------------------------*/
\r
654 /* This hook function will get called if there is a suspected stack overflow.
\r
655 An overflow can cause the task name to be corrupted, in which case the task
\r
656 handle needs to be used to determine the offending task. */
\r
657 void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName );
\r
658 void vApplicationStackOverflowHook( TaskHandle_t xTask, signed char *pcTaskName )
\r
660 /* To prevent the optimiser removing the variables. */
\r
661 volatile TaskHandle_t xTaskIn = xTask;
\r
662 volatile signed char *pcTaskNameIn = pcTaskName;
\r
664 /* Remove compiler warnings. */
\r
666 ( void ) pcTaskNameIn;
\r
668 /* The following three calls are simply to stop compiler warnings about the
\r
669 functions not being used - they are called from the inline assembly. */
\r