atom.h

Go to the documentation of this file.
00001 #ifndef _SYS_ATOM_H_
00002 #define _SYS_ATOM_H_
00003 
00004 /*
00005  * Copyright (C) 2001-2005 by egnite Software GmbH. All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00024  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  *
00035  */
00036 
00037 /*
00038  * $Log: atom.h,v $
00039  * Revision 1.15  2005/07/26 15:49:59  haraldkipp
00040  * Cygwin support added.
00041  *
00042  * Revision 1.14  2005/06/06 10:44:42  haraldkipp
00043  * Header files moved to re-enable building apart from source tree.
00044  *
00045  * Revision 1.13  2005/05/27 17:42:27  drsung
00046  * Platform dependant files were moved to /arch directory.
00047  *
00048  * Revision 1.12  2005/05/26 15:47:50  drsung
00049  * Fixed cvs commit comment from last commit. The
00050  * combination / and * made some compilers to produce errors... (ugh).
00051  * Thanks to Daniel Hobi who discovered this.
00052  *
00053  * Revision 1.11  2005/05/26 10:10:03  drsung
00054  * Moved all platform dependend code from this file to /include/arch/xxx_atom.h
00055  *
00056  * Revision 1.10  2005/05/13 21:47:07  chaac
00057  * Entering a critical section should now be faster on AVR's when
00058  * calling NutEnterCritical().
00059  *
00060  * Revision 1.9  2005/04/05 17:42:45  haraldkipp
00061  * ARM7 implementation of critical sections added.
00062  *
00063  * Revision 1.8  2005/02/21 12:37:59  phblum
00064  * Removed tabs and added semicolons after NUTTRACER macros
00065  *
00066  * Revision 1.7  2005/02/16 19:51:15  haraldkipp
00067  * Enable tracer configuration.
00068  *
00069  * Revision 1.6  2005/02/10 07:06:48  hwmaier
00070  * Changes to incorporate support for AT90CAN128 CPU
00071  *
00072  * Revision 1.5  2005/01/24 22:34:46  freckle
00073  * Added new tracer by Phlipp Blum <blum@tik.ee.ethz.ch>
00074  *
00075  * Revision 1.4  2004/04/07 12:13:57  haraldkipp
00076  * Matthias Ringwald's *nix emulation added
00077  *
00078  * Revision 1.3  2004/03/17 11:30:22  haraldkipp
00079  * Bugfix for ICCAVR
00080  *
00081  * Revision 1.2  2004/03/16 16:48:28  haraldkipp
00082  * Added Jan Dubiec's H8/300 port.
00083  *
00084  * Revision 1.1.1.1  2003/05/09 14:41:18  haraldkipp
00085  * Initial using 3.2.1
00086  *
00087  * Revision 1.6  2003/05/06 17:53:56  harald
00088  * Force critical inline
00089  *
00090  * Revision 1.5  2003/02/04 18:00:51  harald
00091  * Version 3 released
00092  *
00093  * Revision 1.4  2002/06/26 17:29:28  harald
00094  * First pre-release with 2.4 stack
00095  *
00096  */
00097 
00098 #include <cfg/os.h>
00099 #include <sys/types.h>
00100 
00101 #ifdef NUTTRACER_CRITICAL
00102 #include <sys/tracer.h>
00103 #endif
00104 
00105 /*
00106  * The folowing macros must at least be defined for each supported platform.
00107  *
00108  * NutEnterCritical()
00109  * Starts a critical section.
00110  * The global interrupt flag must be disabled to protect the folowing code from 
00111  * interruption. The state of the global interrupt flag must be saved, to 
00112  * later restore.
00113  *
00114  * NutExitCritical()
00115  * Finalize a critical section. Must be used only at the end of a critical section 
00116  * to restore the global interrupt flag to the state saved by NutEnterCritical()
00117  *
00118  * NutJumpOutCritical()
00119  * Macro for early leaving the critical section. Must be used in the middle on a 
00120  * critical section if you want to terminate the critical section.
00121  *
00122  */
00123 
00124 #if defined(__AVR__)
00125 #include <arch/avr/atom.h>
00126 #elif defined(__arm__)
00127 #include <arch/arm/atom.h>
00128 #elif defined(__H8300H__) || defined(__H8300S__)
00129 #include <arch/h8300h/atom.h>
00130 #elif defined(__m68k__)
00131 #include <arch/m68k/atom.h>
00132 #elif defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__)
00133 #include <arch/unix/atom.h>
00134 #endif
00135 
00136 #endif

© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/