Nut/OS  4.10.3
API Reference
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$
00039  * Revision 1.17  2009/03/05 22:16:57  freckle
00040  * use __NUT_EMULATION instead of __APPLE__, __linux__, or __CYGWIN__
00041  *
00042  * Revision 1.16  2008/08/11 07:00:24  haraldkipp
00043  * BSD types replaced by stdint types (feature request #1282721).
00044  *
00045  * Revision 1.15  2005/07/26 15:49:59  haraldkipp
00046  * Cygwin support added.
00047  *
00048  * Revision 1.14  2005/06/06 10:44:42  haraldkipp
00049  * Header files moved to re-enable building apart from source tree.
00050  *
00051  * Revision 1.13  2005/05/27 17:42:27  drsung
00052  * Platform dependant files were moved to /arch directory.
00053  *
00054  * Revision 1.12  2005/05/26 15:47:50  drsung
00055  * Fixed cvs commit comment from last commit. The
00056  * combination / and * made some compilers to produce errors... (ugh).
00057  * Thanks to Daniel Hobi who discovered this.
00058  *
00059  * Revision 1.11  2005/05/26 10:10:03  drsung
00060  * Moved all platform dependend code from this file to /include/arch/xxx_atom.h
00061  *
00062  * Revision 1.10  2005/05/13 21:47:07  chaac
00063  * Entering a critical section should now be faster on AVR's when
00064  * calling NutEnterCritical().
00065  *
00066  * Revision 1.9  2005/04/05 17:42:45  haraldkipp
00067  * ARM7 implementation of critical sections added.
00068  *
00069  * Revision 1.8  2005/02/21 12:37:59  phblum
00070  * Removed tabs and added semicolons after NUTTRACER macros
00071  *
00072  * Revision 1.7  2005/02/16 19:51:15  haraldkipp
00073  * Enable tracer configuration.
00074  *
00075  * Revision 1.6  2005/02/10 07:06:48  hwmaier
00076  * Changes to incorporate support for AT90CAN128 CPU
00077  *
00078  * Revision 1.5  2005/01/24 22:34:46  freckle
00079  * Added new tracer by Phlipp Blum <blum@tik.ee.ethz.ch>
00080  *
00081  * Revision 1.4  2004/04/07 12:13:57  haraldkipp
00082  * Matthias Ringwald's *nix emulation added
00083  *
00084  * Revision 1.3  2004/03/17 11:30:22  haraldkipp
00085  * Bugfix for ICCAVR
00086  *
00087  * Revision 1.2  2004/03/16 16:48:28  haraldkipp
00088  * Added Jan Dubiec's H8/300 port.
00089  *
00090  * Revision 1.1.1.1  2003/05/09 14:41:18  haraldkipp
00091  * Initial using 3.2.1
00092  *
00093  * Revision 1.6  2003/05/06 17:53:56  harald
00094  * Force critical inline
00095  *
00096  * Revision 1.5  2003/02/04 18:00:51  harald
00097  * Version 3 released
00098  *
00099  * Revision 1.4  2002/06/26 17:29:28  harald
00100  * First pre-release with 2.4 stack
00101  *
00102  */
00103 
00104 #include <cfg/os.h>
00105 #include <sys/types.h>
00106 #include <stdint.h>
00107 
00108 #ifdef NUTTRACER_CRITICAL
00109 #include <sys/tracer.h>
00110 #endif
00111 
00112 /*
00113  * The folowing macros must at least be defined for each supported platform.
00114  *
00115  * NutEnterCritical()
00116  * Starts a critical section.
00117  * The global interrupt flag must be disabled to protect the folowing code from 
00118  * interruption. The state of the global interrupt flag must be saved, to 
00119  * later restore.
00120  *
00121  * NutExitCritical()
00122  * Finalize a critical section. Must be used only at the end of a critical section 
00123  * to restore the global interrupt flag to the state saved by NutEnterCritical()
00124  *
00125  * NutJumpOutCritical()
00126  * Macro for early leaving the critical section. Must be used in the middle on a 
00127  * critical section if you want to terminate the critical section.
00128  *
00129  */
00130 
00131 #ifdef __NUT_EMULATION__
00132 #include <arch/unix/atom.h>
00133 #elif defined(__AVR__)
00134 #include <arch/avr/atom.h>
00135 #elif defined(__arm__)
00136 #include <arch/arm/atom.h>
00137 #elif defined(__AVR32__)
00138 #include <arch/avr32/atom.h>
00139 #elif defined(__H8300H__) || defined(__H8300S__)
00140 #include <arch/h8300h/atom.h>
00141 #elif defined(__m68k__)
00142 #include <arch/m68k/atom.h>
00143 #endif
00144 
00145 #endif