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: nutinit.c,v $ 00036 * Revision 1.15 2005/08/02 17:47:04 haraldkipp 00037 * Major API documentation update. 00038 * 00039 * Revision 1.14 2005/07/26 15:58:49 haraldkipp 00040 * Cygwin added. 00041 * Linux EEPROM support moved to dev. 00042 * 00043 * Revision 1.13 2005/05/27 17:30:25 drsung 00044 * Platform dependant files were moved to /arch directory. 00045 * 00046 * Revision 1.12 2005/02/10 07:06:51 hwmaier 00047 * Changes to incorporate support for AT90CAN128 CPU 00048 * 00049 * Revision 1.11 2005/01/22 19:29:56 haraldkipp 00050 * Initializing ms62_5 will move it to the data segment. Still no final 00051 * solution to make sure it's kept in AVR's internal memory. But helps 00052 * in most cases. 00053 * 00054 * Revision 1.10 2005/01/13 18:56:04 haraldkipp 00055 * Moved ms62_5 counter from timer.c to make sure this is located in internal 00056 * RAM (AVR platforms). This fixes the wrong baudrate bug for applications 00057 * occupying all internal RAM. 00058 * 00059 * Revision 1.9 2004/08/04 23:10:30 freckle 00060 * added an avr-libc compatible (but yet uncomplete) eeprom simulation that 00061 * uses file 'eeprom.bin' in the current directory to store eeprom content 00062 * 00063 * Revision 1.8 2004/04/07 12:13:58 haraldkipp 00064 * Matthias Ringwald's *nix emulation added 00065 * 00066 * Revision 1.7 2004/03/16 16:48:45 haraldkipp 00067 * Added Jan Dubiec's H8/300 port. 00068 * 00069 * Revision 1.6 2004/03/03 17:52:26 drsung 00070 * New field 'hostname' added to structure confos. 00071 * 00072 * Revision 1.5 2004/02/18 13:51:06 drsung 00073 * Changed memory calculations to use u_short. Makes more sense than using signed integers, especially on hardware with more than 32KB static RAM... 00074 * 00075 * Revision 1.4 2003/12/15 19:30:19 haraldkipp 00076 * Thread termination support 00077 * 00078 * Revision 1.3 2003/12/05 22:39:46 drsung 00079 * New external RAM handling 00080 * 00081 * Revision 1.2 2003/09/29 16:35:25 haraldkipp 00082 * Replaced XRAMEND by NUTRAMEND 00083 * 00084 * Revision 1.1.1.1 2003/05/09 14:41:51 haraldkipp 00085 * Initial using 3.2.1 00086 * 00087 * Revision 1.4 2003/05/06 18:53:43 harald 00088 * ICCAVR port 00089 * 00090 * Revision 1.3 2003/04/21 17:08:34 harald 00091 * Local var removed from naked function 00092 * 00093 * Revision 1.2 2003/03/31 14:39:05 harald 00094 * Fix GCC different handling of main 00095 * 00096 * Revision 1.1 2003/02/04 18:17:07 harald 00097 * Version 3 released 00098 * 00099 */ 00100 00101 #define __NUTINIT__ 00102 #include <compiler.h> 00103 #include <sys/heap.h> 00104 #include <sys/thread.h> 00105 #include <sys/timer.h> 00106 00107 #include <sys/confos.h> 00108 #include <string.h> 00109 00114 00126 volatile u_char ms62_5 = 0; 00127 00130 #if defined(__AVR__) 00131 #include "../arch/avr/os/nutinit.c" 00132 #elif defined(__arm__) 00133 #include "../arch/arm/os/nutinit.c" 00134 #elif defined(__H8300H__) || defined(__H8300S__) 00135 #include "../arch/h8300h/os/nutinit.c" 00136 #elif defined(__m68k__) 00137 #include "../arch/m68k/os/nutinit.c" 00138 #elif defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__) 00139 // avoid stdio nut wrapper */ 00140 #define NO_STDIO_NUT_WRAPPER 00141 #include "../arch/unix/os/nutinit.c" 00142 #include "../arch/unix/os/options.c" 00143 #include "../arch/unix/dev/eeprom.c" 00144 #endif 00145