Mercurial > ecos
comparison packages/hal/i386/linux/current/src/linux_misc.c @ 42:94fd8fbfe8fe ecos-sw-1999-10-05
Merge from eCos master repository on 1999-10-05-12:38:44-BST
| author | jlarmour |
|---|---|
| date | Tue, 05 Oct 1999 12:09:26 +0000 |
| parents | |
| children | 41bd4f3a90de |
comparison
equal
deleted
inserted
replaced
| 41:7b92742d1d6f | 42:94fd8fbfe8fe |
|---|---|
| 1 //============================================================================= | |
| 2 // | |
| 3 // linux_misc.c | |
| 4 // | |
| 5 // Misc code for the Linux HAL | |
| 6 // | |
| 7 //============================================================================= | |
| 8 //####COPYRIGHTBEGIN#### | |
| 9 // | |
| 10 // ------------------------------------------- | |
| 11 // The contents of this file are subject to the Cygnus eCos Public License | |
| 12 // Version 1.0 (the "License"); you may not use this file except in | |
| 13 // compliance with the License. You may obtain a copy of the License at | |
| 14 // http://sourceware.cygnus.com/ecos | |
| 15 // | |
| 16 // Software distributed under the License is distributed on an "AS IS" | |
| 17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 18 // License for the specific language governing rights and limitations under | |
| 19 // the License. | |
| 20 // | |
| 21 // The Original Code is eCos - Embedded Cygnus Operating System, released | |
| 22 // October 31, 1998. | |
| 23 // | |
| 24 // The Initial Developer of the Original Code is Cygnus. Portions created | |
| 25 // by Cygnus are Copyright (C) 1998,1999 Cygnus Solutions. All Rights Reserved. | |
| 26 // ------------------------------------------- | |
| 27 // | |
| 28 //####COPYRIGHTEND#### | |
| 29 //============================================================================= | |
| 30 //#####DESCRIPTIONBEGIN#### | |
| 31 // | |
| 32 // Author(s): asl | |
| 33 // Contributors:asl | |
| 34 // Date: 1999-09-23 | |
| 35 // Purpose: Misc functions for the Linux HAL | |
| 36 // Description: Misc functions for the Linux HAL | |
| 37 // | |
| 38 //####DESCRIPTIONEND#### | |
| 39 // | |
| 40 //============================================================================= | |
| 41 | |
| 42 #include <pkgconf/hal.h> | |
| 43 #include <cyg/infra/cyg_type.h> // base types | |
| 44 | |
| 45 #ifdef CYGPKG_KERNEL | |
| 46 # include <pkgconf/kernel.h> | |
| 47 #endif | |
| 48 | |
| 49 // This in not correct, but it will do. | |
| 50 externC int cyg_hal_sys__newselect(int,int,int,int,int); | |
| 51 | |
| 52 // Here we define an action to do in the idle thread. For the | |
| 53 // synthetic architecture it makes no sence to spin eating processor | |
| 54 // time that other processes could make use of. Instead we call | |
| 55 // select. The itimer will still go off and kick the schedular back | |
| 56 // into life so giving up an escape path from the select. There is one | |
| 57 // catch 22. This only works if we are using the real time clock for | |
| 58 // itimer, not the virtual clock. The virtual clock works on time the | |
| 59 // process actually uses. When its sitting in the select it does not | |
| 60 // use any time, so the timer does not expire! Also we don't do a | |
| 61 // select when the THREAD_YIELD optin is in use since we want the | |
| 62 // yield to be called regularly. | |
| 63 | |
| 64 void | |
| 65 hal_idle_thread_action(cyg_uint32 loop_count) | |
| 66 { | |
| 67 #ifndef CYGIMP_IDLE_THREAD_YIELD | |
| 68 #ifdef CYGSEM_HAL_I386_LINUX_REAL_TIME | |
| 69 cyg_hal_sys__newselect(0,0,0,0,0); | |
| 70 #endif | |
| 71 #endif | |
| 72 } |
