atom.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. #ifndef _SYS_ATOM_H_
  2. #define _SYS_ATOM_H_
  3. /*
  4. * Copyright (C) 2001-2005 by egnite Software GmbH. All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. Neither the name of the copyright holders nor the names of
  16. * contributors may be used to endorse or promote products derived
  17. * from this software without specific prior written permission.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  21. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  22. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  23. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  25. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  26. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  27. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  29. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  30. * SUCH DAMAGE.
  31. *
  32. * For additional information see http://www.ethernut.de/
  33. *
  34. */
  35. /*
  36. * $Log$
  37. * Revision 1.17 2009/03/05 22:16:57 freckle
  38. * use __NUT_EMULATION instead of __APPLE__, __linux__, or __CYGWIN__
  39. *
  40. * Revision 1.16 2008/08/11 07:00:24 haraldkipp
  41. * BSD types replaced by stdint types (feature request #1282721).
  42. *
  43. * Revision 1.15 2005/07/26 15:49:59 haraldkipp
  44. * Cygwin support added.
  45. *
  46. * Revision 1.14 2005/06/06 10:44:42 haraldkipp
  47. * Header files moved to re-enable building apart from source tree.
  48. *
  49. * Revision 1.13 2005/05/27 17:42:27 drsung
  50. * Platform dependant files were moved to /arch directory.
  51. *
  52. * Revision 1.12 2005/05/26 15:47:50 drsung
  53. * Fixed cvs commit comment from last commit. The
  54. * combination / and * made some compilers to produce errors... (ugh).
  55. * Thanks to Daniel Hobi who discovered this.
  56. *
  57. * Revision 1.11 2005/05/26 10:10:03 drsung
  58. * Moved all platform dependend code from this file to /include/arch/xxx_atom.h
  59. *
  60. * Revision 1.10 2005/05/13 21:47:07 chaac
  61. * Entering a critical section should now be faster on AVR's when
  62. * calling NutEnterCritical().
  63. *
  64. * Revision 1.9 2005/04/05 17:42:45 haraldkipp
  65. * ARM7 implementation of critical sections added.
  66. *
  67. * Revision 1.8 2005/02/21 12:37:59 phblum
  68. * Removed tabs and added semicolons after NUTTRACER macros
  69. *
  70. * Revision 1.7 2005/02/16 19:51:15 haraldkipp
  71. * Enable tracer configuration.
  72. *
  73. * Revision 1.6 2005/02/10 07:06:48 hwmaier
  74. * Changes to incorporate support for AT90CAN128 CPU
  75. *
  76. * Revision 1.5 2005/01/24 22:34:46 freckle
  77. * Added new tracer by Phlipp Blum <blum@tik.ee.ethz.ch>
  78. *
  79. * Revision 1.4 2004/04/07 12:13:57 haraldkipp
  80. * Matthias Ringwald's *nix emulation added
  81. *
  82. * Revision 1.3 2004/03/17 11:30:22 haraldkipp
  83. * Bugfix for ICCAVR
  84. *
  85. * Revision 1.2 2004/03/16 16:48:28 haraldkipp
  86. * Added Jan Dubiec's H8/300 port.
  87. *
  88. * Revision 1.1.1.1 2003/05/09 14:41:18 haraldkipp
  89. * Initial using 3.2.1
  90. *
  91. * Revision 1.6 2003/05/06 17:53:56 harald
  92. * Force critical inline
  93. *
  94. * Revision 1.5 2003/02/04 18:00:51 harald
  95. * Version 3 released
  96. *
  97. * Revision 1.4 2002/06/26 17:29:28 harald
  98. * First pre-release with 2.4 stack
  99. *
  100. */
  101. #include <cfg/os.h>
  102. #include <sys/types.h>
  103. #include <stdint.h>
  104. #ifdef NUTTRACER_CRITICAL
  105. #include <sys/tracer.h>
  106. #endif
  107. /*
  108. * The folowing macros must at least be defined for each supported platform.
  109. *
  110. * NutEnterCritical()
  111. * Starts a critical section.
  112. * The global interrupt flag must be disabled to protect the folowing code from
  113. * interruption. The state of the global interrupt flag must be saved, to
  114. * later restore.
  115. *
  116. * NutExitCritical()
  117. * Finalize a critical section. Must be used only at the end of a critical section
  118. * to restore the global interrupt flag to the state saved by NutEnterCritical()
  119. *
  120. * NutJumpOutCritical()
  121. * Macro for early leaving the critical section. Must be used in the middle on a
  122. * critical section if you want to terminate the critical section.
  123. *
  124. */
  125. #ifdef __NUT_EMULATION__
  126. #include <arch/unix/atom.h>
  127. #elif defined(__AVR__)
  128. #include <arch/avr/atom.h>
  129. #elif defined(__arm__) && !defined(__CORTEX__)
  130. #include <arch/arm/atom.h>
  131. #elif defined(__arm__) && defined(__CORTEX__)
  132. #include <arch/cm3/atom.h>
  133. #elif defined(__AVR32__)
  134. #include <arch/avr32/atom.h>
  135. #elif defined(__H8300H__) || defined(__H8300S__)
  136. #include <arch/h8300h/atom.h>
  137. #elif defined(__m68k__)
  138. #include <arch/m68k/atom.h>
  139. #endif
  140. #endif