]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MicroBlaze/main.c
Correct calculation of xHeapStructSize in heap_4 and heap_5.
[freertos] / FreeRTOS / Demo / MicroBlaze / main.c
1 #error This project has been reworked for use with a later version of the Xilinx tools and IP.  Please find more up to date projects in other FreeRTOS/Demo/MicroBlaze_nnn directories.\r
2 \r
3 /*\r
4     FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.\r
5     All rights reserved\r
6 \r
7     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
8 \r
9     This file is part of the FreeRTOS distribution.\r
10 \r
11     FreeRTOS is free software; you can redistribute it and/or modify it under\r
12     the terms of the GNU General Public License (version 2) as published by the\r
13     Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
14 \r
15     ***************************************************************************\r
16     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
17     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
18     >>!   obliged to provide the source code for proprietary components     !<<\r
19     >>!   outside of the FreeRTOS kernel.                                   !<<\r
20     ***************************************************************************\r
21 \r
22     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
23     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
24     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
25     link: http://www.freertos.org/a00114.html\r
26 \r
27     ***************************************************************************\r
28      *                                                                       *\r
29      *    FreeRTOS provides completely free yet professionally developed,    *\r
30      *    robust, strictly quality controlled, supported, and cross          *\r
31      *    platform software that is more than just the market leader, it     *\r
32      *    is the industry's de facto standard.                               *\r
33      *                                                                       *\r
34      *    Help yourself get started quickly while simultaneously helping     *\r
35      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
36      *    tutorial book, reference manual, or both:                          *\r
37      *    http://www.FreeRTOS.org/Documentation                              *\r
38      *                                                                       *\r
39     ***************************************************************************\r
40 \r
41     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
42     the FAQ page "My application does not run, what could be wrong?".  Have you\r
43     defined configASSERT()?\r
44 \r
45     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
46     embedded software for free we request you assist our global community by\r
47     participating in the support forum.\r
48 \r
49     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
50     be as productive as possible as early as possible.  Now you can receive\r
51     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
52     Ltd, and the world's leading authority on the world's leading RTOS.\r
53 \r
54     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
55     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
56     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
57 \r
58     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
59     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
60 \r
61     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
62     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
63     licenses offer ticketed support, indemnification and commercial middleware.\r
64 \r
65     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
66     engineered and independently SIL3 certified version for use in safety and\r
67     mission critical applications that require provable dependability.\r
68 \r
69     1 tab == 4 spaces!\r
70 */\r
71 \r
72 /*\r
73  * Creates all the demo application tasks, then starts the scheduler.  The WEB\r
74  * documentation provides more details of the standard demo application tasks.\r
75  *\r
76  * In addition to the standard tasks, main() creates two "Register Check" \r
77  * tasks.  These tasks write known values into every general purpose register,\r
78  * then check each register to ensure it still contains the expected (written)\r
79  * value.  The register check tasks operate at the idle priority so will get\r
80  * repeatedly preempted.  A register being found to contain an incorrect value\r
81  * following such a preemption would be indicative of an error in the context\r
82  * switch mechanism.\r
83  * \r
84  * Main.c also creates a task called "Check".  This only executes every three \r
85  * seconds but has the highest priority so is guaranteed to get processor time.  \r
86  * Its main function is to check that all the other tasks are still operational.\r
87  * Each task (other than the "flash" tasks) maintains a unique count that is \r
88  * incremented each time the task successfully completes its function.  Should \r
89  * any error occur within such a task the count is permanently halted.  The \r
90  * check task inspects the count of each task to ensure it has changed since\r
91  * the last time the check task executed.  If all the count variables have \r
92  * changed all the tasks are still executing error free, and the check task\r
93  * toggles the onboard LED.  Should any task contain an error at any time \r
94  * the LED toggle rate will change from 3 seconds to 500ms.\r
95  *\r
96  */\r
97 \r
98 /* Scheduler includes. */\r
99 #include "FreeRTOS.h"\r
100 #include "task.h"\r
101 \r
102 /* Demo application includes. */\r
103 #include "partest.h"\r
104 #include "flash.h"\r
105 #include "comtest2.h"\r
106 #include "integer.h"\r
107 #include "semtest.h"\r
108 #include "BlockQ.h"\r
109 #include "dynamic.h"\r
110 #include "PollQ.h"\r
111 \r
112 /* Hardware library includes. */\r
113 #include <xintc.h>\r
114 \r
115 /* The rate at which the 'check' LED will flash when no errors have been\r
116 detected. */\r
117 #define mainNO_ERROR_CHECK_PERIOD       3000\r
118 \r
119 /* The rate at which the 'check' LED will flash when an error has been\r
120 detected in one of the demo tasks. */\r
121 #define mainERROR_CHECK_PERIOD          500\r
122 \r
123 /* Demo application task priorities. */\r
124 #define mainLED_TASK_PRIORITY           ( tskIDLE_PRIORITY + 2 )\r
125 #define mainCHECK_TASK_PRIORITY         ( tskIDLE_PRIORITY + 3 )\r
126 #define mainSEM_TEST_PRIORITY           ( tskIDLE_PRIORITY + 1 )\r
127 #define mainCOM_TEST_PRIORITY           ( tskIDLE_PRIORITY + 2 )\r
128 #define mainBLOCK_Q_PRIORITY            ( tskIDLE_PRIORITY + 2 )\r
129 #define mainQUEUE_POLL_PRIORITY         ( tskIDLE_PRIORITY + 2 )\r
130 \r
131 /* Software cannot influence the BAUD rate used by the simple UART \r
132 implementation. */\r
133 #define mainBAUD_RATE                           0\r
134 \r
135 /* The LED flashed by the 'check' task to indicate the system status. */\r
136 #define mainCHECK_TASK_LED                      3\r
137 \r
138 /* The first LED flashed by the COM port test tasks.  LED mainCOM_TEST_LED + 1\r
139 will also be used. */\r
140 #define mainCOM_TEST_LED                        4\r
141 \r
142 /* The register test task does not make any function calls so does not require\r
143 much stack at all. */\r
144 #define mainTINY_STACK                          70\r
145 \r
146 /*\r
147  * The task that executes at the highest priority and calls \r
148  * prvCheckOtherTasksAreStillRunning().  See the description at the top\r
149  * of the file.\r
150  */\r
151 static void vErrorChecks( void *pvParameters );\r
152 \r
153 /*\r
154  * Checks that all the demo application tasks are still executing without error\r
155  * - as described at the top of the file.\r
156  */\r
157 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void );\r
158 \r
159 /*\r
160  * The register test task as described at the top of this file.\r
161  */\r
162 static void vRegisterTest( void *pvParameters );\r
163 \r
164 /*\r
165  * Perform any necessary hardware configuration.\r
166  */\r
167 static void prvSetupHardware( void );\r
168 \r
169 /* Set to pdFAIL should an error be discovered in the register test tasks. */\r
170 static unsigned long ulRegisterTestStatus = pdPASS;\r
171 const unsigned long *pulStatusAddr = &ulRegisterTestStatus;\r
172 \r
173 /*-----------------------------------------------------------*/\r
174 \r
175 /*\r
176  * Create all the demo tasks - then start the scheduler.\r
177  */\r
178 int main (void) \r
179 {\r
180         /* When re-starting a debug session (rather than cold booting) we want\r
181         to ensure the installed interrupt handlers do not execute until after the\r
182         scheduler has been started. */\r
183         portDISABLE_INTERRUPTS();\r
184 \r
185         prvSetupHardware();\r
186 \r
187         /* Start the standard demo application tasks. */\r
188         vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
189         vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainBAUD_RATE, mainCOM_TEST_LED );\r
190         vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
191         vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
192         vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
193         vStartDynamicPriorityTasks();\r
194         vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
195         \r
196         /* Create two register check tasks - using a different parameter for each.\r
197         The parameter is used to generate the known values written to the registers. */\r
198         #if configUSE_PREEMPTION == 1\r
199                 xTaskCreate( vRegisterTest, "Reg1", mainTINY_STACK, ( void * ) 10, tskIDLE_PRIORITY, NULL );\r
200                 xTaskCreate( vRegisterTest, "Reg2", mainTINY_STACK, ( void * ) 20, tskIDLE_PRIORITY, NULL );\r
201         #endif\r
202 \r
203         /* Create the 'check' task that is defined in this file. */\r
204         xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
205 \r
206         /* Finally start the scheduler. */\r
207         vTaskStartScheduler();\r
208 \r
209         /* Should not get here as the processor is now under control of the \r
210         scheduler! */\r
211 \r
212         return 0;\r
213 }\r
214 /*-----------------------------------------------------------*/\r
215 \r
216 static void vErrorChecks( void *pvParameters )\r
217 {\r
218 TickType_t xDelayPeriod = mainNO_ERROR_CHECK_PERIOD;\r
219 \r
220         /* The parameters are not used. */\r
221         ( void ) pvParameters;\r
222 \r
223         /* Cycle for ever, delaying then checking all the other tasks are still\r
224         operating without error.  The delay period used will depend on whether\r
225         or not an error has been discovered in one of the demo tasks. */\r
226         for( ;; )\r
227         {\r
228                 vTaskDelay( xDelayPeriod );\r
229                 if( !prvCheckOtherTasksAreStillRunning() )\r
230                 {\r
231                         /* An error has been found.  Shorten the delay period to make\r
232                         the LED flash faster. */\r
233                         xDelayPeriod = mainERROR_CHECK_PERIOD;\r
234                 }\r
235 \r
236                 vParTestToggleLED( mainCHECK_TASK_LED );\r
237         }\r
238 }\r
239 /*-----------------------------------------------------------*/\r
240 \r
241 static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void )\r
242 {\r
243 static portBASE_TYPE xAllTestsPass = pdTRUE;\r
244 \r
245         /* Return pdFALSE if any demo application task set has encountered\r
246         an error. */\r
247 \r
248         if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
249         {\r
250                 xAllTestsPass = pdFALSE;\r
251         }\r
252 \r
253         if( xAreComTestTasksStillRunning() != pdTRUE )\r
254         {\r
255                 xAllTestsPass = pdFALSE;\r
256         }\r
257 \r
258         if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
259         {\r
260                 xAllTestsPass = pdFALSE;\r
261         }\r
262 \r
263         if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
264         {\r
265                 xAllTestsPass = pdFAIL;\r
266         }\r
267 \r
268         if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
269         {\r
270                 xAllTestsPass = ( long ) pdFAIL;\r
271         }\r
272 \r
273         if( xArePollingQueuesStillRunning() != pdTRUE )\r
274         {\r
275                 xAllTestsPass = ( long ) pdFAIL;\r
276         }\r
277 \r
278         /* Mutual exclusion on this variable is not necessary as we only read it. */\r
279         if( ulRegisterTestStatus != pdPASS )\r
280         {\r
281                 xAllTestsPass = pdFALSE;\r
282         }\r
283 \r
284         return xAllTestsPass;\r
285 }\r
286 /*-----------------------------------------------------------*/\r
287 \r
288 static void prvSetupHardware( void )\r
289 {\r
290         /* Ensure the interrupt controller is enabled in order that subsequent \r
291         code can successfully configure the peripherals. */\r
292         XIntc_mMasterEnable( XPAR_OPB_INTC_0_BASEADDR );\r
293 \r
294         /* Initialise the GPIO used for the LED's. */\r
295         vParTestInitialise();\r
296 }\r
297 /*-----------------------------------------------------------*/\r
298 \r
299 static void vRegisterTest( void *pvParameters )\r
300 {\r
301         for( ;; )\r
302         {\r
303                 /* Fill the registers with their register number plus the offset \r
304                 (added) value.  The added value is passed in as a parameter so\r
305                 is contained in r5. */\r
306                 asm volatile (  "addi r3, r5, 3         \n\t" \\r
307                                                 "addi r4, r5, 4         \n\t" \\r
308                                                 "addi r6, r5, 6         \n\t" \\r
309                                                 "addi r7, r5, 7         \n\t" \\r
310                                                 "addi r8, r5, 8         \n\t" \\r
311                                                 "addi r9, r5, 9         \n\t" \\r
312                                                 "addi r10, r5, 10       \n\t" \\r
313                                                 "addi r11, r5, 11       \n\t" \\r
314                                                 "addi r12, r5, 12       \n\t" \\r
315                                                 "addi r16, r5, 16       \n\t" \\r
316                                                 "addi r17, r5, 17       \n\t" \\r
317                                                 "addi r18, r5, 18       \n\t" \\r
318                                                 "addi r19, r5, 19       \n\t" \\r
319                                                 "addi r20, r5, 20       \n\t" \\r
320                                                 "addi r21, r5, 21       \n\t" \\r
321                                                 "addi r22, r5, 22       \n\t" \\r
322                                                 "addi r23, r5, 23       \n\t" \\r
323                                                 "addi r24, r5, 24       \n\t" \\r
324                                                 "addi r25, r5, 25       \n\t" \\r
325                                                 "addi r26, r5, 26       \n\t" \\r
326                                                 "addi r27, r5, 27       \n\t" \\r
327                                                 "addi r28, r5, 28       \n\t" \\r
328                                                 "addi r29, r5, 29       \n\t" \\r
329                                                 "addi r30, r5, 30       \n\t" \\r
330                                                 "addi r31, r5, 31       \n\t"\r
331                                         );\r
332 \r
333                 /* Now read back the register values to ensure they are as we expect. \r
334                 This task will get preempted frequently so other tasks are likely to\r
335                 have executed since the register values were written. */\r
336 \r
337                 /* r3 should contain r5 + 3.  Subtract 3 to leave r3 equal to r5. */\r
338                 asm volatile (  "addi r3, r3, -3 " );\r
339 \r
340                 /* Compare r3 and r5.  If they are not equal then either r3 or r5\r
341                 contains the wrong value and *pulStatusAddr is to pdFAIL. */\r
342                 asm volatile (  "cmp r3, r3, r5                         \n\t" \\r
343                                                 "beqi r3, 12                            \n\t" \\r
344                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
345                                                 "sw     r0, r0, r3                              \n\t" \r
346                                          );\r
347 \r
348                 /* Repeat for all the other registers. */\r
349                 asm volatile (  "addi r4, r4, -4                        \n\t" \\r
350                                                 "cmp r4, r4, r5                         \n\t" \\r
351                                                 "beqi r4, 12                            \n\t" \\r
352                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
353                                                 "sw     r0, r0, r3                              \n\t" \\r
354                                                 "addi r6, r6, -6                        \n\t" \\r
355                                                 "cmp r6, r6, r5                         \n\t" \\r
356                                                 "beqi r6, 12                            \n\t" \\r
357                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
358                                                 "sw     r0, r0, r3                              \n\t" \\r
359                                                 "addi r7, r7, -7                        \n\t" \\r
360                                                 "cmp r7, r7, r5                         \n\t" \\r
361                                                 "beqi r7, 12                            \n\t" \\r
362                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
363                                                 "sw     r0, r0, r3                              \n\t" \\r
364                                                 "addi r8, r8, -8                        \n\t" \\r
365                                                 "cmp r8, r8, r5                         \n\t" \\r
366                                                 "beqi r8, 12                            \n\t" \\r
367                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
368                                                 "sw     r0, r0, r3                              \n\t" \\r
369                                                 "addi r9, r9, -9                        \n\t" \\r
370                                                 "cmp r9, r9, r5                         \n\t" \\r
371                                                 "beqi r9, 12                            \n\t" \\r
372                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
373                                                 "sw     r0, r0, r3                              \n\t" \\r
374                                                 "addi r10, r10, -10                     \n\t" \\r
375                                                 "cmp r10, r10, r5                       \n\t" \\r
376                                                 "beqi r10, 12                           \n\t" \\r
377                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
378                                                 "sw     r0, r0, r3                              \n\t" \\r
379                                                 "addi r11, r11, -11                     \n\t" \\r
380                                                 "cmp r11, r11, r5                       \n\t" \\r
381                                                 "beqi r11, 12                           \n\t" \\r
382                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
383                                                 "sw     r0, r0, r3                              \n\t" \\r
384                                                 "addi r12, r12, -12                     \n\t" \\r
385                                                 "cmp r12, r12, r5                       \n\t" \\r
386                                                 "beqi r12, 12                           \n\t" \\r
387                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
388                                                 "sw     r0, r0, r3                              \n\t" \\r
389                                                 "sw     r0, r0, r3                              \n\t" \\r
390                                                 "addi r16, r16, -16                     \n\t" \\r
391                                                 "cmp r16, r16, r5                       \n\t" \\r
392                                                 "beqi r16, 12                           \n\t" \\r
393                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
394                                                 "sw     r0, r0, r3                              \n\t" \\r
395                                                 "addi r17, r17, -17                     \n\t" \\r
396                                                 "cmp r17, r17, r5                       \n\t" \\r
397                                                 "beqi r17, 12                           \n\t" \\r
398                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
399                                                 "sw     r0, r0, r3                              \n\t" \\r
400                                                 "addi r18, r18, -18                     \n\t" \\r
401                                                 "cmp r18, r18, r5                       \n\t" \\r
402                                                 "beqi r18, 12                           \n\t" \\r
403                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
404                                                 "sw     r0, r0, r3                              \n\t" \\r
405                                                 "addi r19, r19, -19                     \n\t" \\r
406                                                 "cmp r19, r19, r5                       \n\t" \\r
407                                                 "beqi r19, 12                           \n\t" \\r
408                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
409                                                 "sw     r0, r0, r3                              \n\t" \\r
410                                                 "addi r20, r20, -20                     \n\t" \\r
411                                                 "cmp r20, r20, r5                       \n\t" \\r
412                                                 "beqi r20, 12                           \n\t" \\r
413                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
414                                                 "sw     r0, r0, r3                              \n\t" \\r
415                                                 "addi r21, r21, -21                     \n\t" \\r
416                                                 "cmp r21, r21, r5                       \n\t" \\r
417                                                 "beqi r21, 12                           \n\t" \\r
418                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
419                                                 "sw     r0, r0, r3                              \n\t" \\r
420                                                 "addi r22, r22, -22                     \n\t" \\r
421                                                 "cmp r22, r22, r5                       \n\t" \\r
422                                                 "beqi r22, 12                           \n\t" \\r
423                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
424                                                 "sw     r0, r0, r3                              \n\t" \\r
425                                                 "addi r23, r23, -23                     \n\t" \\r
426                                                 "cmp r23, r23, r5                       \n\t" \\r
427                                                 "beqi r23, 12                           \n\t" \\r
428                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
429                                                 "sw     r0, r0, r3                              \n\t" \\r
430                                                 "addi r24, r24, -24                     \n\t" \\r
431                                                 "cmp r24, r24, r5                       \n\t" \\r
432                                                 "beqi r24, 12                           \n\t" \\r
433                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
434                                                 "sw     r0, r0, r3                              \n\t" \\r
435                                                 "addi r25, r25, -25                     \n\t" \\r
436                                                 "cmp r25, r25, r5                       \n\t" \\r
437                                                 "beqi r25, 12                           \n\t" \\r
438                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
439                                                 "sw     r0, r0, r3                              \n\t" \\r
440                                                 "addi r26, r26, -26                     \n\t" \\r
441                                                 "cmp r26, r26, r5                       \n\t" \\r
442                                                 "beqi r26, 12                           \n\t" \\r
443                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
444                                                 "sw     r0, r0, r3                              \n\t" \\r
445                                                 "addi r27, r27, -27                     \n\t" \\r
446                                                 "cmp r27, r27, r5                       \n\t" \\r
447                                                 "beqi r27, 12                           \n\t" \\r
448                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
449                                                 "sw     r0, r0, r3                              \n\t" \\r
450                                                 "addi r28, r28, -28                     \n\t" \\r
451                                                 "cmp r28, r28, r5                       \n\t" \\r
452                                                 "beqi r28, 12                           \n\t" \\r
453                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
454                                                 "sw     r0, r0, r3                              \n\t" \\r
455                                                 "addi r29, r29, -29                     \n\t" \\r
456                                                 "cmp r29, r29, r5                       \n\t" \\r
457                                                 "beqi r29, 12                           \n\t" \\r
458                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
459                                                 "sw     r0, r0, r3                              \n\t" \\r
460                                                 "addi r30, r30, -30                     \n\t" \\r
461                                                 "cmp r30, r30, r5                       \n\t" \\r
462                                                 "beqi r30, 12                           \n\t" \\r
463                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
464                                                 "sw     r0, r0, r3                              \n\t" \\r
465                                                 "addi r31, r31, -31                     \n\t" \\r
466                                                 "cmp r31, r31, r5                       \n\t" \\r
467                                                 "beqi r31, 12                           \n\t" \\r
468                                                 "lwi r3, r0, pulStatusAddr      \n\t" \\r
469                                                 "sw     r0, r0, r3                              \n\t"\r
470                                         );\r
471         }\r
472 }\r
473 \r
474 \r
475 \r