00001 /* 00002 * Copyright (C) 2001-2005 by egnite Software GmbH. All rights reserved. 00003 * 00004 * Redistribution and use in source and binary forms, with or without 00005 * modification, are permitted provided that the following conditions 00006 * are met: 00007 * 00008 * 1. Redistributions of source code must retain the above copyright 00009 * notice, this list of conditions and the following disclaimer. 00010 * 2. Redistributions in binary form must reproduce the above copyright 00011 * notice, this list of conditions and the following disclaimer in the 00012 * documentation and/or other materials provided with the distribution. 00013 * 3. Neither the name of the copyright holders nor the names of 00014 * contributors may be used to endorse or promote products derived 00015 * from this software without specific prior written permission. 00016 * 00017 * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS 00018 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00019 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00020 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE 00021 * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00022 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00023 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 00024 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 00025 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00026 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 00027 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00028 * SUCH DAMAGE. 00029 * 00030 * For additional information see http://www.ethernut.de/ 00031 * 00032 */ 00033 00034 /* 00035 * $Log$ 00036 * Revision 1.17 2009/03/05 22:16:57 freckle 00037 * use __NUT_EMULATION instead of __APPLE__, __linux__, or __CYGWIN__ 00038 * 00039 * Revision 1.16 2008/08/11 07:00:34 haraldkipp 00040 * BSD types replaced by stdint types (feature request #1282721). 00041 * 00042 * Revision 1.15 2005/08/02 17:47:04 haraldkipp 00043 * Major API documentation update. 00044 * 00045 * Revision 1.14 2005/07/26 15:58:49 haraldkipp 00046 * Cygwin added. 00047 * Linux EEPROM support moved to dev. 00048 * 00049 * Revision 1.13 2005/05/27 17:30:25 drsung 00050 * Platform dependant files were moved to /arch directory. 00051 * 00052 * Revision 1.12 2005/02/10 07:06:51 hwmaier 00053 * Changes to incorporate support for AT90CAN128 CPU 00054 * 00055 * Revision 1.11 2005/01/22 19:29:56 haraldkipp 00056 * Initializing ms62_5 will move it to the data segment. Still no final 00057 * solution to make sure it's kept in AVR's internal memory. But helps 00058 * in most cases. 00059 * 00060 * Revision 1.10 2005/01/13 18:56:04 haraldkipp 00061 * Moved ms62_5 counter from timer.c to make sure this is located in internal 00062 * RAM (AVR platforms). This fixes the wrong baudrate bug for applications 00063 * occupying all internal RAM. 00064 * 00065 * Revision 1.9 2004/08/04 23:10:30 freckle 00066 * added an avr-libc compatible (but yet uncomplete) eeprom simulation that 00067 * uses file 'eeprom.bin' in the current directory to store eeprom content 00068 * 00069 * Revision 1.8 2004/04/07 12:13:58 haraldkipp 00070 * Matthias Ringwald's *nix emulation added 00071 * 00072 * Revision 1.7 2004/03/16 16:48:45 haraldkipp 00073 * Added Jan Dubiec's H8/300 port. 00074 * 00075 * Revision 1.6 2004/03/03 17:52:26 drsung 00076 * New field 'hostname' added to structure confos. 00077 * 00078 * Revision 1.5 2004/02/18 13:51:06 drsung 00079 * Changed memory calculations to use u_short. Makes more sense than using signed integers, especially on hardware with more than 32KB static RAM... 00080 * 00081 * Revision 1.4 2003/12/15 19:30:19 haraldkipp 00082 * Thread termination support 00083 * 00084 * Revision 1.3 2003/12/05 22:39:46 drsung 00085 * New external RAM handling 00086 * 00087 * Revision 1.2 2003/09/29 16:35:25 haraldkipp 00088 * Replaced XRAMEND by NUTRAMEND 00089 * 00090 * Revision 1.1.1.1 2003/05/09 14:41:51 haraldkipp 00091 * Initial using 3.2.1 00092 * 00093 * Revision 1.4 2003/05/06 18:53:43 harald 00094 * ICCAVR port 00095 * 00096 * Revision 1.3 2003/04/21 17:08:34 harald 00097 * Local var removed from naked function 00098 * 00099 * Revision 1.2 2003/03/31 14:39:05 harald 00100 * Fix GCC different handling of main 00101 * 00102 * Revision 1.1 2003/02/04 18:17:07 harald 00103 * Version 3 released 00104 * 00105 */ 00106 00107 #define __NUTINIT__ 00108 #include <compiler.h> 00109 #include <sys/heap.h> 00110 #include <sys/thread.h> 00111 #include <sys/timer.h> 00112 00113 #include <sys/confos.h> 00114 #include <string.h> 00115 00120 00132 volatile uint8_t ms62_5 = 0; 00133 00136 #ifdef __NUT_EMULATION__ 00137 // avoid stdio nut wrapper */ 00138 #define NO_STDIO_NUT_WRAPPER 00139 #include "../arch/unix/os/nutinit.c" 00140 #include "../arch/unix/os/options.c" 00141 #include "../arch/unix/dev/eeprom.c" 00142 #elif defined(__AVR__) 00143 #include "../arch/avr/os/nutinit.c" 00144 #elif defined(__arm__) 00145 #include "../arch/arm/os/nutinit.c" 00146 #elif defined(__AVR32__) 00147 #include "../arch/avr32/os/nutinit.c" 00148 #elif defined(__H8300H__) || defined(__H8300S__) 00149 #include "../arch/h8300h/os/nutinit.c" 00150 #elif defined(__m68k__) 00151 #include "../arch/m68k/os/nutinit.c" 00152 #endif 00153