]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/Common/ethernet/lwip-1.4.0/ports/MicroBlaze-Ethernet-Lite/sys_arch.c
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / Common / ethernet / lwip-1.4.0 / ports / MicroBlaze-Ethernet-Lite / sys_arch.c
1 /*\r
2  * Copyright (c) 2001-2003 Swedish Institute of Computer Science.\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without modification,\r
6  * are permitted provided that the following conditions are met:\r
7  *\r
8  * 1. Redistributions of source code must retain the above copyright notice,\r
9  *    this list of conditions and the following disclaimer.\r
10  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
11  *    this list of conditions and the following disclaimer in the documentation\r
12  *    and/or other materials provided with the distribution.\r
13  * 3. The name of the author may not be used to endorse or promote products\r
14  *    derived from this software without specific prior written permission.\r
15  *\r
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
17  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
18  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT\r
19  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
20  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT\r
21  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
22  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
23  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING\r
24  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY\r
25  * OF SUCH DAMAGE.\r
26  *\r
27  * This file is part of the lwIP TCP/IP stack.\r
28  *\r
29  * Author: Adam Dunkels <adam@sics.se>\r
30  *\r
31  */\r
32 \r
33 //*****************************************************************************\r
34 //\r
35 // Include OS functionality.\r
36 //\r
37 //*****************************************************************************\r
38 \r
39 /* ------------------------ System architecture includes ----------------------------- */\r
40 #include "arch/sys_arch.h"\r
41 \r
42 /* ------------------------ lwIP includes --------------------------------- */\r
43 #include "lwip/opt.h"\r
44 \r
45 #include "lwip/debug.h"\r
46 #include "lwip/def.h"\r
47 #include "lwip/sys.h"\r
48 #include "lwip/mem.h"\r
49 #include "lwip/stats.h"\r
50 \r
51 /* Very crude mechanism used to determine if the critical section handling\r
52 functions are being called from an interrupt context or not.  This relies on\r
53 the interrupt handler setting this variable manually. */\r
54 portBASE_TYPE xInsideISR = pdFALSE;\r
55 \r
56 /*---------------------------------------------------------------------------*\r
57  * Routine:  sys_mbox_new\r
58  *---------------------------------------------------------------------------*\r
59  * Description:\r
60  *      Creates a new mailbox\r
61  * Inputs:\r
62  *      int size                -- Size of elements in the mailbox\r
63  * Outputs:\r
64  *      sys_mbox_t              -- Handle to new mailbox\r
65  *---------------------------------------------------------------------------*/\r
66 err_t sys_mbox_new( sys_mbox_t *pxMailBox, int iSize )\r
67 {\r
68 err_t xReturn = ERR_MEM;\r
69 \r
70         *pxMailBox = xQueueCreate( iSize, sizeof( void * ) );\r
71 \r
72         if( *pxMailBox != NULL )\r
73         {\r
74                 xReturn = ERR_OK;\r
75                 SYS_STATS_INC_USED( mbox );\r
76         }\r
77 \r
78         return xReturn;\r
79 }\r
80 \r
81 \r
82 /*---------------------------------------------------------------------------*\r
83  * Routine:  sys_mbox_free\r
84  *---------------------------------------------------------------------------*\r
85  * Description:\r
86  *      Deallocates a mailbox. If there are messages still present in the\r
87  *      mailbox when the mailbox is deallocated, it is an indication of a\r
88  *      programming error in lwIP and the developer should be notified.\r
89  * Inputs:\r
90  *      sys_mbox_t mbox         -- Handle of mailbox\r
91  * Outputs:\r
92  *      sys_mbox_t              -- Handle to new mailbox\r
93  *---------------------------------------------------------------------------*/\r
94 void sys_mbox_free( sys_mbox_t *pxMailBox )\r
95 {\r
96 unsigned long ulMessagesWaiting;\r
97 \r
98         ulMessagesWaiting = uxQueueMessagesWaiting( *pxMailBox );\r
99         configASSERT( ( ulMessagesWaiting == 0 ) );\r
100 \r
101         #if SYS_STATS\r
102         {\r
103                 if( ulMessagesWaiting != 0UL )\r
104                 {\r
105                         SYS_STATS_INC( mbox.err );\r
106                 }\r
107 \r
108                 SYS_STATS_DEC( mbox.used );\r
109         }\r
110         #endif /* SYS_STATS */\r
111 \r
112         vQueueDelete( *pxMailBox );\r
113 }\r
114 \r
115 /*---------------------------------------------------------------------------*\r
116  * Routine:  sys_mbox_post\r
117  *---------------------------------------------------------------------------*\r
118  * Description:\r
119  *      Post the "msg" to the mailbox.\r
120  * Inputs:\r
121  *      sys_mbox_t mbox         -- Handle of mailbox\r
122  *      void *data              -- Pointer to data to post\r
123  *---------------------------------------------------------------------------*/\r
124 void sys_mbox_post( sys_mbox_t *pxMailBox, void *pxMessageToPost )\r
125 {\r
126         while( xQueueSendToBack( *pxMailBox, &pxMessageToPost, portMAX_DELAY ) != pdTRUE );\r
127 }\r
128 \r
129 /*---------------------------------------------------------------------------*\r
130  * Routine:  sys_mbox_trypost\r
131  *---------------------------------------------------------------------------*\r
132  * Description:\r
133  *      Try to post the "msg" to the mailbox.  Returns immediately with\r
134  *      error if cannot.\r
135  * Inputs:\r
136  *      sys_mbox_t mbox         -- Handle of mailbox\r
137  *      void *msg               -- Pointer to data to post\r
138  * Outputs:\r
139  *      err_t                   -- ERR_OK if message posted, else ERR_MEM\r
140  *                                  if not.\r
141  *---------------------------------------------------------------------------*/\r
142 err_t sys_mbox_trypost( sys_mbox_t *pxMailBox, void *pxMessageToPost )\r
143 {\r
144 err_t xReturn;\r
145 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
146 \r
147         if( xInsideISR != pdFALSE )\r
148         {\r
149                 xReturn = xQueueSendFromISR( *pxMailBox, &pxMessageToPost, &xHigherPriorityTaskWoken );\r
150         }\r
151         else\r
152         {\r
153                 xReturn = xQueueSend( *pxMailBox, &pxMessageToPost, ( portTickType ) 0 );\r
154         }\r
155 \r
156         if( xReturn == pdPASS )\r
157         {\r
158                 xReturn = ERR_OK;\r
159         }\r
160         else\r
161         {\r
162                 /* The queue was already full. */\r
163                 xReturn = ERR_MEM;\r
164                 SYS_STATS_INC( mbox.err );\r
165         }\r
166 \r
167         return xReturn;\r
168 }\r
169 \r
170 /*---------------------------------------------------------------------------*\r
171  * Routine:  sys_arch_mbox_fetch\r
172  *---------------------------------------------------------------------------*\r
173  * Description:\r
174  *      Blocks the thread until a message arrives in the mailbox, but does\r
175  *      not block the thread longer than "timeout" milliseconds (similar to\r
176  *      the sys_arch_sem_wait() function). The "msg" argument is a result\r
177  *      parameter that is set by the function (i.e., by doing "*msg =\r
178  *      ptr"). The "msg" parameter maybe NULL to indicate that the message\r
179  *      should be dropped.\r
180  *\r
181  *      The return values are the same as for the sys_arch_sem_wait() function:\r
182  *      Number of milliseconds spent waiting or SYS_ARCH_TIMEOUT if there was a\r
183  *      timeout.\r
184  *\r
185  *      Note that a function with a similar name, sys_mbox_fetch(), is\r
186  *      implemented by lwIP.\r
187  * Inputs:\r
188  *      sys_mbox_t mbox         -- Handle of mailbox\r
189  *      void **msg              -- Pointer to pointer to msg received\r
190  *      u32_t timeout           -- Number of milliseconds until timeout\r
191  * Outputs:\r
192  *      u32_t                   -- SYS_ARCH_TIMEOUT if timeout, else number\r
193  *                                  of milliseconds until received.\r
194  *---------------------------------------------------------------------------*/\r
195 u32_t sys_arch_mbox_fetch( sys_mbox_t *pxMailBox, void **ppvBuffer, u32_t ulTimeOut )\r
196 {\r
197 void *pvDummy;\r
198 portTickType xStartTime, xEndTime, xElapsed;\r
199 unsigned long ulReturn;\r
200 \r
201         xStartTime = xTaskGetTickCount();\r
202 \r
203         if( NULL == ppvBuffer )\r
204         {\r
205                 ppvBuffer = &pvDummy;\r
206         }\r
207 \r
208         if( ulTimeOut != 0UL )\r
209         {\r
210                 configASSERT( xInsideISR == ( portBASE_TYPE ) 0 );\r
211 \r
212                 if( pdTRUE == xQueueReceive( *pxMailBox, &( *ppvBuffer ), ulTimeOut/ portTICK_RATE_MS ) )\r
213                 {\r
214                         xEndTime = xTaskGetTickCount();\r
215                         xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;\r
216 \r
217                         ulReturn = xElapsed;\r
218                 }\r
219                 else\r
220                 {\r
221                         /* Timed out. */\r
222                         *ppvBuffer = NULL;\r
223                         ulReturn = SYS_ARCH_TIMEOUT;\r
224                 }\r
225         }\r
226         else\r
227         {\r
228                 while( pdTRUE != xQueueReceive( *pxMailBox, &( *ppvBuffer ), portMAX_DELAY ) );\r
229                 xEndTime = xTaskGetTickCount();\r
230                 xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;\r
231 \r
232                 if( xElapsed == 0UL )\r
233                 {\r
234                         xElapsed = 1UL;\r
235                 }\r
236 \r
237                 ulReturn = xElapsed;\r
238         }\r
239 \r
240         return ulReturn;\r
241 }\r
242 \r
243 /*---------------------------------------------------------------------------*\r
244  * Routine:  sys_arch_mbox_tryfetch\r
245  *---------------------------------------------------------------------------*\r
246  * Description:\r
247  *      Similar to sys_arch_mbox_fetch, but if message is not ready\r
248  *      immediately, we'll return with SYS_MBOX_EMPTY.  On success, 0 is\r
249  *      returned.\r
250  * Inputs:\r
251  *      sys_mbox_t mbox         -- Handle of mailbox\r
252  *      void **msg              -- Pointer to pointer to msg received\r
253  * Outputs:\r
254  *      u32_t                   -- SYS_MBOX_EMPTY if no messages.  Otherwise,\r
255  *                                  return ERR_OK.\r
256  *---------------------------------------------------------------------------*/\r
257 u32_t sys_arch_mbox_tryfetch( sys_mbox_t *pxMailBox, void **ppvBuffer )\r
258 {\r
259 void *pvDummy;\r
260 unsigned long ulReturn;\r
261 long lResult;\r
262 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
263 \r
264         if( ppvBuffer== NULL )\r
265         {\r
266                 ppvBuffer = &pvDummy;\r
267         }\r
268 \r
269         if( xInsideISR != pdFALSE )\r
270         {\r
271                 lResult = xQueueReceiveFromISR( *pxMailBox, &( *ppvBuffer ), &xHigherPriorityTaskWoken );\r
272         }\r
273         else\r
274         {\r
275                 lResult = xQueueReceive( *pxMailBox, &( *ppvBuffer ), 0UL );\r
276         }\r
277 \r
278         if( lResult == pdPASS )\r
279         {\r
280                 ulReturn = ERR_OK;\r
281         }\r
282         else\r
283         {\r
284                 ulReturn = SYS_MBOX_EMPTY;\r
285         }\r
286 \r
287         return ulReturn;\r
288 }\r
289 \r
290 /*---------------------------------------------------------------------------*\r
291  * Routine:  sys_sem_new\r
292  *---------------------------------------------------------------------------*\r
293  * Description:\r
294  *      Creates and returns a new semaphore. The "ucCount" argument specifies\r
295  *      the initial state of the semaphore.\r
296  *      NOTE: Currently this routine only creates counts of 1 or 0\r
297  * Inputs:\r
298  *      sys_mbox_t mbox         -- Handle of mailbox\r
299  *      u8_t ucCount              -- Initial ucCount of semaphore (1 or 0)\r
300  * Outputs:\r
301  *      sys_sem_t               -- Created semaphore or 0 if could not create.\r
302  *---------------------------------------------------------------------------*/\r
303 err_t sys_sem_new( sys_sem_t *pxSemaphore, u8_t ucCount )\r
304 {\r
305 err_t xReturn = ERR_MEM;\r
306 \r
307         vSemaphoreCreateBinary( ( *pxSemaphore ) );\r
308 \r
309         if( *pxSemaphore != NULL )\r
310         {\r
311                 if( ucCount == 0U )\r
312                 {\r
313                         xSemaphoreTake( *pxSemaphore, 1UL );\r
314                 }\r
315 \r
316                 xReturn = ERR_OK;\r
317                 SYS_STATS_INC_USED( sem );\r
318         }\r
319         else\r
320         {\r
321                 SYS_STATS_INC( sem.err );\r
322         }\r
323 \r
324         return xReturn;\r
325 }\r
326 \r
327 /*---------------------------------------------------------------------------*\r
328  * Routine:  sys_arch_sem_wait\r
329  *---------------------------------------------------------------------------*\r
330  * Description:\r
331  *      Blocks the thread while waiting for the semaphore to be\r
332  *      signaled. If the "timeout" argument is non-zero, the thread should\r
333  *      only be blocked for the specified time (measured in\r
334  *      milliseconds).\r
335  *\r
336  *      If the timeout argument is non-zero, the return value is the number of\r
337  *      milliseconds spent waiting for the semaphore to be signaled. If the\r
338  *      semaphore wasn't signaled within the specified time, the return value is\r
339  *      SYS_ARCH_TIMEOUT. If the thread didn't have to wait for the semaphore\r
340  *      (i.e., it was already signaled), the function may return zero.\r
341  *\r
342  *      Notice that lwIP implements a function with a similar name,\r
343  *      sys_sem_wait(), that uses the sys_arch_sem_wait() function.\r
344  * Inputs:\r
345  *      sys_sem_t sem           -- Semaphore to wait on\r
346  *      u32_t timeout           -- Number of milliseconds until timeout\r
347  * Outputs:\r
348  *      u32_t                   -- Time elapsed or SYS_ARCH_TIMEOUT.\r
349  *---------------------------------------------------------------------------*/\r
350 u32_t sys_arch_sem_wait( sys_sem_t *pxSemaphore, u32_t ulTimeout )\r
351 {\r
352 portTickType xStartTime, xEndTime, xElapsed;\r
353 unsigned long ulReturn;\r
354 \r
355         xStartTime = xTaskGetTickCount();\r
356 \r
357         if( ulTimeout != 0UL )\r
358         {\r
359                 if( xSemaphoreTake( *pxSemaphore, ulTimeout / portTICK_RATE_MS ) == pdTRUE )\r
360                 {\r
361                         xEndTime = xTaskGetTickCount();\r
362                         xElapsed = (xEndTime - xStartTime) * portTICK_RATE_MS;\r
363                         ulReturn = xElapsed;\r
364                 }\r
365                 else\r
366                 {\r
367                         ulReturn = SYS_ARCH_TIMEOUT;\r
368                 }\r
369         }\r
370         else\r
371         {\r
372                 while( xSemaphoreTake( *pxSemaphore, portMAX_DELAY ) != pdTRUE );\r
373                 xEndTime = xTaskGetTickCount();\r
374                 xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;\r
375 \r
376                 if( xElapsed == 0UL )\r
377                 {\r
378                         xElapsed = 1UL;\r
379                 }\r
380 \r
381                 ulReturn = xElapsed;\r
382         }\r
383 \r
384         return ulReturn;\r
385 }\r
386 \r
387 /** Create a new mutex\r
388  * @param mutex pointer to the mutex to create\r
389  * @return a new mutex */\r
390 err_t sys_mutex_new( sys_mutex_t *pxMutex )\r
391 {\r
392 err_t xReturn = ERR_MEM;\r
393 \r
394         *pxMutex = xSemaphoreCreateMutex();\r
395 \r
396         if( *pxMutex != NULL ) \r
397         {\r
398                 xReturn = ERR_OK;\r
399                 SYS_STATS_INC_USED( mutex );\r
400         } \r
401         else \r
402         {\r
403                 SYS_STATS_INC( mutex.err );\r
404         }\r
405         \r
406         return xReturn;\r
407 }\r
408 \r
409 /** Lock a mutex\r
410  * @param mutex the mutex to lock */\r
411 void sys_mutex_lock( sys_mutex_t *pxMutex )\r
412 {\r
413         while( xSemaphoreTake( *pxMutex, portMAX_DELAY ) != pdPASS );\r
414 }\r
415 \r
416 /** Unlock a mutex\r
417  * @param mutex the mutex to unlock */\r
418 void sys_mutex_unlock(sys_mutex_t *pxMutex )\r
419 {\r
420         xSemaphoreGive( *pxMutex );\r
421 }\r
422 \r
423 \r
424 /** Delete a semaphore\r
425  * @param mutex the mutex to delete */\r
426 void sys_mutex_free( sys_mutex_t *pxMutex )\r
427 {\r
428         SYS_STATS_DEC( mutex.used );\r
429         vQueueDelete( *pxMutex );\r
430 }\r
431 \r
432 \r
433 /*---------------------------------------------------------------------------*\r
434  * Routine:  sys_sem_signal\r
435  *---------------------------------------------------------------------------*\r
436  * Description:\r
437  *      Signals (releases) a semaphore\r
438  * Inputs:\r
439  *      sys_sem_t sem           -- Semaphore to signal\r
440  *---------------------------------------------------------------------------*/\r
441 void sys_sem_signal( sys_sem_t *pxSemaphore )\r
442 {\r
443 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
444 \r
445         if( xInsideISR != pdFALSE )\r
446         {\r
447                 xSemaphoreGiveFromISR( *pxSemaphore, &xHigherPriorityTaskWoken );\r
448         }\r
449         else\r
450         {\r
451                 xSemaphoreGive( *pxSemaphore );\r
452         }\r
453 }\r
454 \r
455 /*---------------------------------------------------------------------------*\r
456  * Routine:  sys_sem_free\r
457  *---------------------------------------------------------------------------*\r
458  * Description:\r
459  *      Deallocates a semaphore\r
460  * Inputs:\r
461  *      sys_sem_t sem           -- Semaphore to free\r
462  *---------------------------------------------------------------------------*/\r
463 void sys_sem_free( sys_sem_t *pxSemaphore )\r
464 {\r
465         SYS_STATS_DEC(sem.used);\r
466         vQueueDelete( *pxSemaphore );\r
467 }\r
468 \r
469 /*---------------------------------------------------------------------------*\r
470  * Routine:  sys_init\r
471  *---------------------------------------------------------------------------*\r
472  * Description:\r
473  *      Initialize sys arch\r
474  *---------------------------------------------------------------------------*/\r
475 void sys_init(void)\r
476 {\r
477 }\r
478 \r
479 u32_t sys_now(void)\r
480 {\r
481         return xTaskGetTickCount();\r
482 }\r
483 \r
484 /*---------------------------------------------------------------------------*\r
485  * Routine:  sys_thread_new\r
486  *---------------------------------------------------------------------------*\r
487  * Description:\r
488  *      Starts a new thread with priority "prio" that will begin its\r
489  *      execution in the function "thread()". The "arg" argument will be\r
490  *      passed as an argument to the thread() function. The id of the new\r
491  *      thread is returned. Both the id and the priority are system\r
492  *      dependent.\r
493  * Inputs:\r
494  *      char *name              -- Name of thread\r
495  *      void (* thread)(void *arg) -- Pointer to function to run.\r
496  *      void *arg               -- Argument passed into function\r
497  *      int stacksize           -- Required stack amount in bytes\r
498  *      int prio                -- Thread priority\r
499  * Outputs:\r
500  *      sys_thread_t            -- Pointer to per-thread timeouts.\r
501  *---------------------------------------------------------------------------*/\r
502 sys_thread_t sys_thread_new( const char *pcName, void( *pxThread )( void *pvParameters ), void *pvArg, int iStackSize, int iPriority )\r
503 {\r
504 xTaskHandle xCreatedTask;\r
505 portBASE_TYPE xResult;\r
506 sys_thread_t xReturn;\r
507 \r
508         xResult = xTaskCreate( pxThread, ( signed char * ) pcName, iStackSize, pvArg, iPriority, &xCreatedTask );\r
509 \r
510         if( xResult == pdPASS )\r
511         {\r
512                 xReturn = xCreatedTask;\r
513         }\r
514         else\r
515         {\r
516                 xReturn = NULL;\r
517         }\r
518 \r
519         return xReturn;\r
520 }\r
521 \r
522 /*---------------------------------------------------------------------------*\r
523  * Routine:  sys_arch_protect\r
524  *---------------------------------------------------------------------------*\r
525  * Description:\r
526  *      This optional function does a "fast" critical region protection and\r
527  *      returns the previous protection level. This function is only called\r
528  *      during very short critical regions. An embedded system which supports\r
529  *      ISR-based drivers might want to implement this function by disabling\r
530  *      interrupts. Task-based systems might want to implement this by using\r
531  *      a mutex or disabling tasking. This function should support recursive\r
532  *      calls from the same task or interrupt. In other words,\r
533  *      sys_arch_protect() could be called while already protected. In\r
534  *      that case the return value indicates that it is already protected.\r
535  *\r
536  *      sys_arch_protect() is only required if your port is supporting an\r
537  *      operating system.\r
538  * Outputs:\r
539  *      sys_prot_t              -- Previous protection level (not used here)\r
540  *---------------------------------------------------------------------------*/\r
541 sys_prot_t sys_arch_protect( void )\r
542 {\r
543         if( xInsideISR == pdFALSE )\r
544         {\r
545                 taskENTER_CRITICAL();\r
546         }\r
547         return ( sys_prot_t ) 1;\r
548 }\r
549 \r
550 /*---------------------------------------------------------------------------*\r
551  * Routine:  sys_arch_unprotect\r
552  *---------------------------------------------------------------------------*\r
553  * Description:\r
554  *      This optional function does a "fast" set of critical region\r
555  *      protection to the value specified by pval. See the documentation for\r
556  *      sys_arch_protect() for more information. This function is only\r
557  *      required if your port is supporting an operating system.\r
558  * Inputs:\r
559  *      sys_prot_t              -- Previous protection level (not used here)\r
560  *---------------------------------------------------------------------------*/\r
561 void sys_arch_unprotect( sys_prot_t xValue )\r
562 {\r
563         (void) xValue;\r
564         if( xInsideISR == pdFALSE )\r
565         {\r
566                 taskEXIT_CRITICAL();\r
567         }\r
568 }\r
569 \r
570 /*\r
571  * Prints an assertion messages and aborts execution.\r
572  */\r
573 void sys_assert( const char *pcMessage )\r
574 {\r
575         (void) pcMessage;\r
576 \r
577         for (;;)\r
578         {\r
579         }\r
580 }\r
581 /*-------------------------------------------------------------------------*\r
582  * End of File:  sys_arch.c\r
583  *-------------------------------------------------------------------------*/\r
584 \r