2 FreeRTOS V8.1.1 - Copyright (C) 2014 Real Time Engineers Ltd.
\r
5 VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
\r
7 ***************************************************************************
\r
9 * FreeRTOS provides completely free yet professionally developed, *
\r
10 * robust, strictly quality controlled, supported, and cross *
\r
11 * platform software that has become a de facto standard. *
\r
13 * Help yourself get started quickly and support the FreeRTOS *
\r
14 * project by purchasing a FreeRTOS tutorial book, reference *
\r
15 * manual, or both from: http://www.FreeRTOS.org/Documentation *
\r
19 ***************************************************************************
\r
21 This file is part of the FreeRTOS distribution.
\r
23 FreeRTOS is free software; you can redistribute it and/or modify it under
\r
24 the terms of the GNU General Public License (version 2) as published by the
\r
25 Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
\r
27 >>! NOTE: The modification to the GPL is included to allow you to !<<
\r
28 >>! distribute a combined work that includes FreeRTOS without being !<<
\r
29 >>! obliged to provide the source code for proprietary components !<<
\r
30 >>! outside of the FreeRTOS kernel. !<<
\r
32 FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
\r
33 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
\r
34 FOR A PARTICULAR PURPOSE. Full license text is available from the following
\r
35 link: http://www.freertos.org/a00114.html
\r
39 ***************************************************************************
\r
41 * Having a problem? Start by reading the FAQ "My application does *
\r
42 * not run, what could be wrong?" *
\r
44 * http://www.FreeRTOS.org/FAQHelp.html *
\r
46 ***************************************************************************
\r
48 http://www.FreeRTOS.org - Documentation, books, training, latest versions,
\r
49 license and Real Time Engineers Ltd. contact details.
\r
51 http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
\r
52 including FreeRTOS+Trace - an indispensable productivity tool, a DOS
\r
53 compatible FAT file system, and our tiny thread aware UDP/IP stack.
\r
55 http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High
\r
56 Integrity Systems to sell under the OpenRTOS brand. Low cost OpenRTOS
\r
57 licenses offer ticketed support, indemnification and middleware.
\r
59 http://www.SafeRTOS.com - High Integrity Systems also provide a safety
\r
60 engineered and independently SIL3 certified version for use in safety and
\r
61 mission critical applications that require provable dependability.
\r
67 * Creates all the demo application tasks, then starts the scheduler.
\r
68 * In addition to the standard demo tasks, the following tasks and tests are
\r
69 * defined and/or created within this file:
\r
71 * "Check" task - This only executes every five seconds but has the highest
\r
72 * priority so is guaranteed to get processor time. Its main function is to
\r
73 * check that all the standard demo tasks are still operational. The check
\r
74 * task will write an error message to the console should an error be detected
\r
75 * within any of the demo tasks. The check task also toggles the LED defined
\r
76 * by mainCHECK_LED every 5 seconds while the system is error free, with the
\r
77 * toggle rate increasing to every 500ms should an error occur.
\r
79 * "Reg test" tasks - These fill the registers with known values, then check
\r
80 * that each register still contains its expected value. Each task uses
\r
81 * different values. The tasks run with very low priority so get preempted very
\r
82 * frequently. A register containing an unexpected value is indicative of an
\r
83 * error in the context switching mechanism.
\r
85 * See the online documentation for this demo for more information on interrupt
\r
89 /* Standard includes. */
\r
94 /* Scheduler includes. */
\r
95 #include "FreeRTOS.h"
\r
99 /* Demo application includes. */
\r
100 #include "partest.h"
\r
102 #include "blocktim.h"
\r
103 #include "semtest.h"
\r
104 #include "serial.h"
\r
105 #include "comtest.h"
\r
106 #include "GenQTest.h"
\r
108 #include "integer.h"
\r
110 #include "BlockQ.h"
\r
111 #include "dynamic.h"
\r
112 #include "countsem.h"
\r
113 #include "recmutex.h"
\r
116 /*-----------------------------------------------------------*/
\r
118 #error The batch file Demo\NiosII_CycloneIII_DBC3C40_GCC\CreateProjectDirectoryStructure.bat must be executed before the project is imported into the workspace. Failure to do this will result in the include paths stored in the project being deleted. Remove this line after CreateProjectDirectoryStructure.bat has been executed.
\r
120 /*-----------------------------------------------------------*/
\r
122 /* The rate at which the LED controlled by the 'check' task will toggle when no
\r
123 errors have been detected. */
\r
124 #define mainNO_ERROR_PERIOD ( 5000 )
\r
126 /* The rate at which the LED controlled by the 'check' task will toggle when an
\r
127 error has been detected. */
\r
128 #define mainERROR_PERIOD ( 500 )
\r
130 /* The LED toggled by the Check task. */
\r
131 #define mainCHECK_LED ( 7 )
\r
133 /* The first LED used by the ComTest tasks. One LED toggles each time a
\r
134 character is transmitted, and one each time a character is received and
\r
135 verified as being the expected character. */
\r
136 #define mainCOMTEST_LED ( 4 )
\r
138 /* Priority definitions for the tasks in the demo application. */
\r
139 #define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
140 #define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
\r
141 #define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 4 )
\r
142 #define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
143 #define mainQUEUE_BLOCK_PRIORITY ( tskIDLE_PRIORITY + 3 )
\r
144 #define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
\r
145 #define mainSEMAPHORE_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
\r
146 #define mainGENERIC_QUEUE_PRIORITY ( tskIDLE_PRIORITY )
\r
147 #define mainREG_TEST_PRIORITY ( tskIDLE_PRIORITY )
\r
150 #define mainDONT_WAIT ( 0 )
\r
152 /* The parameters passed to the reg test tasks. This is just done to check
\r
153 the parameter passing mechanism is working correctly. */
\r
154 #define mainREG_TEST_1_PARAMETER ( ( void * ) 0x12345678 )
\r
155 #define mainREG_TEST_2_PARAMETER ( ( void * ) 0x87654321 )
\r
157 /*-----------------------------------------------------------*/
\r
160 * Setup the processor ready for the demo.
\r
162 static void prvSetupHardware( void );
\r
165 * Execute all of the check functions to ensure the tests haven't failed.
\r
167 static void prvCheckTask( void *pvParameters );
\r
170 * The register test (or RegTest) tasks as described at the top of this file.
\r
172 static void prvFirstRegTestTask( void *pvParameters );
\r
173 static void prvSecondRegTestTask( void *pvParameters );
\r
175 /*-----------------------------------------------------------*/
\r
177 /* Counters that are incremented on each iteration of the RegTest tasks
\r
178 so long as no errors have been detected. */
\r
179 volatile unsigned long ulRegTest1Counter = 0UL, ulRegTest2Counter = 0UL;
\r
181 /*-----------------------------------------------------------*/
\r
184 * Create the demo tasks then start the scheduler.
\r
188 /* Configure any hardware required for this demo. */
\r
189 prvSetupHardware();
\r
191 /* Create all the other standard demo tasks. These serve no purpose other
\r
192 than to test the port and demonstrate the use of the FreeRTOS API. */
\r
193 vStartLEDFlashTasks( tskIDLE_PRIORITY );
\r
194 vStartIntegerMathTasks( mainGENERIC_QUEUE_PRIORITY );
\r
195 vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
\r
196 vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );
\r
197 vCreateBlockTimeTasks();
\r
198 vStartSemaphoreTasks( mainSEMAPHORE_TASK_PRIORITY );
\r
199 vStartDynamicPriorityTasks();
\r
200 vStartQueuePeekTasks();
\r
201 vStartGenericQueueTasks( mainGENERIC_QUEUE_PRIORITY );
\r
202 vStartCountingSemaphoreTasks();
\r
203 vStartRecursiveMutexTasks();
\r
204 vAltStartComTestTasks( mainCOM_TEST_PRIORITY, 0, mainCOMTEST_LED );
\r
206 /* prvCheckTask uses sprintf so requires more stack. */
\r
207 xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
\r
209 /* The RegTest tasks as described at the top of this file. */
\r
210 xTaskCreate( prvFirstRegTestTask, "Rreg1", configMINIMAL_STACK_SIZE, mainREG_TEST_1_PARAMETER, mainREG_TEST_PRIORITY, NULL );
\r
211 xTaskCreate( prvSecondRegTestTask, "Rreg2", configMINIMAL_STACK_SIZE, mainREG_TEST_2_PARAMETER, mainREG_TEST_PRIORITY, NULL );
\r
213 /* This task has to be created last as it keeps account of the number of tasks
\r
214 it expects to see running. */
\r
215 vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
\r
217 /* Finally start the scheduler. */
\r
218 vTaskStartScheduler();
\r
220 /* Will only reach here if there is insufficient heap available to start
\r
224 /*-----------------------------------------------------------*/
\r
226 static void prvSetupHardware( void )
\r
228 /* Setup the digital IO for the LED's. */
\r
229 vParTestInitialise();
\r
231 /*-----------------------------------------------------------*/
\r
233 void vApplicationStackOverflowHook( void )
\r
235 /* Look at pxCurrentTCB to see which task overflowed its stack. */
\r
241 /*-----------------------------------------------------------*/
\r
243 void _general_exception_handler( unsigned long ulCause, unsigned long ulStatus )
\r
245 /* This overrides the definition provided by the kernel. Other exceptions
\r
246 should be handled here. */
\r
252 /*-----------------------------------------------------------*/
\r
254 static void prvCheckTask( void *pvParameters )
\r
256 TickType_t xLastExecutionTime, ulTicksToWait = mainNO_ERROR_PERIOD;
\r
257 unsigned long ulLastRegTest1 = 0UL, ulLastRegTest2 = 0UL;
\r
258 const char * pcMessage;
\r
260 /* Initialise the variable used to control our iteration rate prior to
\r
262 xLastExecutionTime = xTaskGetTickCount();
\r
266 /* Wait until it is time to run the tests again. */
\r
267 vTaskDelayUntil( &xLastExecutionTime, ulTicksToWait );
\r
269 /* Have any of the standard demo tasks detected an error in their
\r
271 if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
\r
273 ulTicksToWait = mainERROR_PERIOD;
\r
274 pcMessage = "Error: Integer Maths.\n";
\r
276 else if( xAreGenericQueueTasksStillRunning() != pdTRUE )
\r
278 ulTicksToWait = mainERROR_PERIOD;
\r
279 pcMessage = "Error: GenQ.\n";
\r
281 else if( xAreBlockingQueuesStillRunning() != pdTRUE )
\r
283 ulTicksToWait = mainERROR_PERIOD;
\r
284 pcMessage = "Error: BlockQ.\n";
\r
286 else if( xArePollingQueuesStillRunning() != pdTRUE )
\r
288 ulTicksToWait = mainERROR_PERIOD;
\r
289 pcMessage = "Error: PollQ.\n";
\r
291 else if( xAreQueuePeekTasksStillRunning() != pdTRUE )
\r
293 ulTicksToWait = mainERROR_PERIOD;
\r
294 pcMessage = "Error: PeekQ.\n";
\r
296 else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE )
\r
298 ulTicksToWait = mainERROR_PERIOD;
\r
299 pcMessage = "Error: Block Time.\n";
\r
301 else if( xAreSemaphoreTasksStillRunning() != pdTRUE )
\r
303 ulTicksToWait = mainERROR_PERIOD;
\r
304 pcMessage = "Error: Semaphore Test.\n";
\r
306 else if( xAreComTestTasksStillRunning() != pdTRUE )
\r
308 ulTicksToWait = mainERROR_PERIOD;
\r
309 pcMessage = "Error: Comm Test.\n";
\r
311 else if( xIsCreateTaskStillRunning() != pdTRUE )
\r
313 ulTicksToWait = mainERROR_PERIOD;
\r
314 pcMessage = "Error: Suicidal Tasks.\n";
\r
316 else if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
\r
318 ulTicksToWait = mainERROR_PERIOD;
\r
319 pcMessage = "Error: Dynamic Priority.\n";
\r
321 else if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE )
\r
323 ulTicksToWait = mainERROR_PERIOD;
\r
324 pcMessage = "Error: Count Semaphore.\n";
\r
326 else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )
\r
328 ulTicksToWait = mainERROR_PERIOD;
\r
329 pcMessage = "Error: Recursive Mutex.\n";
\r
331 else if( ulLastRegTest1 == ulRegTest1Counter )
\r
333 /* ulRegTest1Counter is no longer being incremented, indicating
\r
334 that an error has been discovered in prvFirstRegTestTask(). */
\r
335 ulTicksToWait = mainERROR_PERIOD;
\r
336 pcMessage = "Error: Reg Test1.\n";
\r
338 else if( ulLastRegTest2 == ulRegTest2Counter )
\r
340 /* ulRegTest2Counter is no longer being incremented, indicating
\r
341 that an error has been discovered in prvSecondRegTestTask(). */
\r
342 ulTicksToWait = mainERROR_PERIOD;
\r
343 pcMessage = "Error: Reg Test2.\n";
\r
350 /* Remember the counter values this time around so a counter failing
\r
351 to be incremented correctly can be spotted. */
\r
352 ulLastRegTest1 = ulRegTest1Counter;
\r
353 ulLastRegTest2 = ulRegTest2Counter;
\r
355 /* Print out an error message if there is one. Mutual exclusion is
\r
356 not used as this is the only task accessing stdout. */
\r
357 if( pcMessage != NULL )
\r
359 printf( pcMessage );
\r
362 /* Provide visual feedback of the system status. If the LED is toggled
\r
363 every 5 seconds then no errors have been found. If the LED is toggled
\r
364 every 500ms then at least one error has been found. */
\r
365 vParTestToggleLED( mainCHECK_LED );
\r
368 /*-----------------------------------------------------------*/
\r
370 static void prvFirstRegTestTask( void *pvParameters )
\r
372 /* Check the parameters are passed in as expected. */
\r
373 if( pvParameters != mainREG_TEST_1_PARAMETER )
\r
375 /* Don't execute any further so an error is recognised by the check
\r
377 vTaskDelete( NULL );
\r
380 /* Fill registers with known values, then check that each register still
\r
381 contains its expected value. An incorrect value is indicative of an error
\r
382 in the context switching process.
\r
384 If no errors are found ulRegTest1Counter is incremented. The check task
\r
385 will recognise an error if ulRegTest1Counter stops being incremented.
\r
386 This task also performs a manual yield in the middle of its execution, just
\r
387 to increase the test coverage. */
\r
389 " .extern ulRegTest1Counter \n" \
\r
391 " addi r3, r0, 3 \n" \
\r
392 " addi r4, r0, 4 \n" \
\r
393 " addi r5, r0, 5 \n" \
\r
394 " addi r6, r0, 6 \n" \
\r
395 " addi r7, r0, 7 \n" \
\r
396 " addi r8, r0, 8 \n" \
\r
397 " addi r9, r0, 9 \n" \
\r
398 " addi r10, r0, 10 \n" \
\r
399 " addi r11, r0, 11 \n" \
\r
400 " addi r12, r0, 12 \n" \
\r
401 " addi r13, r0, 13 \n" \
\r
402 " addi r14, r0, 14 \n" \
\r
403 " addi r15, r0, 15 \n" \
\r
404 " addi r16, r0, 16 \n" \
\r
405 " addi r17, r0, 17 \n" \
\r
406 " addi r18, r0, 18 \n" \
\r
407 " addi r19, r0, 19 \n" \
\r
408 " addi r20, r0, 20 \n" \
\r
409 " addi r21, r0, 21 \n" \
\r
410 " addi r22, r0, 22 \n" \
\r
411 " addi r23, r0, 23 \n" \
\r
412 " addi r28, r0, 28 \n" \
\r
413 " addi r31, r0, 31 \n" \
\r
415 " addi r2, r0, 0 \n" \
\r
417 " bne r2, r0, RegTest1Error \n" \
\r
418 " addi r2, r0, 3 \n" \
\r
419 " bne r2, r3, RegTest1Error \n" \
\r
420 " addi r2, r0, 4 \n" \
\r
421 " bne r2, r4, RegTest1Error \n" \
\r
422 " addi r2, r0, 5 \n" \
\r
423 " bne r2, r5, RegTest1Error \n" \
\r
424 " addi r2, r0, 6 \n" \
\r
425 " bne r2, r6, RegTest1Error \n" \
\r
426 " addi r2, r0, 7 \n" \
\r
427 " bne r2, r7, RegTest1Error \n" \
\r
428 " addi r2, r0, 8 \n" \
\r
429 " bne r2, r8, RegTest1Error \n" \
\r
430 " addi r2, r0, 9 \n" \
\r
431 " bne r2, r9, RegTest1Error \n" \
\r
432 " addi r2, r0, 10 \n" \
\r
433 " bne r2, r10, RegTest1Error \n" \
\r
434 " addi r2, r0, 11 \n" \
\r
435 " bne r2, r11, RegTest1Error \n" \
\r
436 " addi r2, r0, 12 \n" \
\r
437 " bne r2, r12, RegTest1Error \n" \
\r
438 " addi r2, r0, 13 \n" \
\r
439 " bne r2, r13, RegTest1Error \n" \
\r
440 " addi r2, r0, 14 \n" \
\r
441 " bne r2, r14, RegTest1Error \n" \
\r
442 " addi r2, r0, 15 \n" \
\r
443 " bne r2, r15, RegTest1Error \n" \
\r
444 " addi r2, r0, 16 \n" \
\r
445 " bne r2, r16, RegTest1Error \n" \
\r
446 " addi r2, r0, 17 \n" \
\r
447 " bne r2, r17, RegTest1Error \n" \
\r
448 " addi r2, r0, 18 \n" \
\r
449 " bne r2, r18, RegTest1Error \n" \
\r
450 " addi r2, r0, 19 \n" \
\r
451 " bne r2, r19, RegTest1Error \n" \
\r
452 " addi r2, r0, 20 \n" \
\r
453 " bne r2, r20, RegTest1Error \n" \
\r
454 " addi r2, r0, 21 \n" \
\r
455 " bne r2, r21, RegTest1Error \n" \
\r
456 " addi r2, r0, 22 \n" \
\r
457 " bne r2, r22, RegTest1Error \n" \
\r
458 " addi r2, r0, 23 \n" \
\r
459 " bne r2, r23, RegTest1Error \n" \
\r
460 " addi r2, r0, 28 \n" \
\r
461 " bne r2, r28, RegTest1Error \n" \
\r
462 " addi r2, r0, 31 \n" \
\r
463 " bne r2, r31, RegTest1Error \n" \
\r
464 " ldw r2, %gprel(ulRegTest1Counter)(gp) \n" \
\r
465 " addi r2, r2, 1 \n" \
\r
466 " stw r2, %gprel(ulRegTest1Counter)(gp) \n" \
\r
467 " br RegTest1 \n" \
\r
468 "RegTest1Error: \n" \
\r
469 " br RegTest1Error \n"
\r
472 /*-----------------------------------------------------------*/
\r
474 static void prvSecondRegTestTask( void *pvParameters )
\r
476 /* Check the parameters are passed in as expected. */
\r
477 if( pvParameters != mainREG_TEST_2_PARAMETER )
\r
479 /* Don't execute any further so an error is recognised by the check
\r
481 vTaskDelete( NULL );
\r
484 /* Fill registers with known values, then check that each register still
\r
485 contains its expected value. An incorrect value is indicative of an error
\r
486 in the context switching process.
\r
488 If no errors are found ulRegTest2Counter is incremented. The check task
\r
489 will recognise an error if ulRegTest2Counter stops being incremented. */
\r
491 " .extern ulRegTest2Counter \n" \
\r
493 " addi r3, r0, 3 \n" \
\r
494 " addi r4, r0, 4 \n" \
\r
495 " addi r5, r0, 5 \n" \
\r
496 " addi r6, r0, 6 \n" \
\r
497 " addi r7, r0, 7 \n" \
\r
498 " addi r8, r0, 8 \n" \
\r
499 " addi r9, r0, 9 \n" \
\r
500 " addi r10, r0, 10 \n" \
\r
501 " addi r11, r0, 11 \n" \
\r
502 " addi r12, r0, 12 \n" \
\r
503 " addi r13, r0, 13 \n" \
\r
504 " addi r14, r0, 14 \n" \
\r
505 " addi r15, r0, 15 \n" \
\r
506 " addi r16, r0, 16 \n" \
\r
507 " addi r17, r0, 17 \n" \
\r
508 " addi r18, r0, 18 \n" \
\r
509 " addi r19, r0, 19 \n" \
\r
510 " addi r20, r0, 20 \n" \
\r
511 " addi r21, r0, 21 \n" \
\r
512 " addi r22, r0, 22 \n" \
\r
513 " addi r23, r0, 23 \n" \
\r
514 " addi r28, r0, 28 \n" \
\r
515 " addi r31, r0, 31 \n" \
\r
517 " addi r2, r0, 0 \n" \
\r
518 " bne r2, r0, RegTest2Error \n" \
\r
519 " addi r2, r0, 3 \n" \
\r
520 " bne r2, r3, RegTest2Error \n" \
\r
521 " addi r2, r0, 4 \n" \
\r
522 " bne r2, r4, RegTest2Error \n" \
\r
523 " addi r2, r0, 5 \n" \
\r
524 " bne r2, r5, RegTest2Error \n" \
\r
525 " addi r2, r0, 6 \n" \
\r
526 " bne r2, r6, RegTest2Error \n" \
\r
527 " addi r2, r0, 7 \n" \
\r
528 " bne r2, r7, RegTest2Error \n" \
\r
529 " addi r2, r0, 8 \n" \
\r
530 " bne r2, r8, RegTest2Error \n" \
\r
531 " addi r2, r0, 9 \n" \
\r
532 " bne r2, r9, RegTest2Error \n" \
\r
533 " addi r2, r0, 10 \n" \
\r
534 " bne r2, r10, RegTest2Error \n" \
\r
535 " addi r2, r0, 11 \n" \
\r
536 " bne r2, r11, RegTest2Error \n" \
\r
537 " addi r2, r0, 12 \n" \
\r
538 " bne r2, r12, RegTest2Error \n" \
\r
539 " addi r2, r0, 13 \n" \
\r
540 " bne r2, r13, RegTest2Error \n" \
\r
541 " addi r2, r0, 14 \n" \
\r
542 " bne r2, r14, RegTest2Error \n" \
\r
543 " addi r2, r0, 15 \n" \
\r
544 " bne r2, r15, RegTest2Error \n" \
\r
545 " addi r2, r0, 16 \n" \
\r
546 " bne r2, r16, RegTest2Error \n" \
\r
547 " addi r2, r0, 17 \n" \
\r
548 " bne r2, r17, RegTest2Error \n" \
\r
549 " addi r2, r0, 18 \n" \
\r
550 " bne r2, r18, RegTest2Error \n" \
\r
551 " addi r2, r0, 19 \n" \
\r
552 " bne r2, r19, RegTest2Error \n" \
\r
553 " addi r2, r0, 20 \n" \
\r
554 " bne r2, r20, RegTest2Error \n" \
\r
555 " addi r2, r0, 21 \n" \
\r
556 " bne r2, r21, RegTest2Error \n" \
\r
557 " addi r2, r0, 22 \n" \
\r
558 " bne r2, r22, RegTest2Error \n" \
\r
559 " addi r2, r0, 23 \n" \
\r
560 " bne r2, r23, RegTest2Error \n" \
\r
561 " addi r2, r0, 28 \n" \
\r
562 " bne r2, r28, RegTest2Error \n" \
\r
563 " addi r2, r0, 31 \n" \
\r
564 " bne r2, r31, RegTest2Error \n" \
\r
565 " ldw r2, %gprel(ulRegTest2Counter)(gp) \n" \
\r
566 " addi r2, r2, 1 \n" \
\r
567 " stw r2, %gprel(ulRegTest2Counter)(gp) \n" \
\r
568 " br RegTest2 \n" \
\r
569 "RegTest2Error: \n" \
\r
570 " br RegTest2Error \n"
\r
573 /*-----------------------------------------------------------*/
\r