atom.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  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 EGNITE SOFTWARE GMBH 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 EGNITE
  23. * SOFTWARE GMBH 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: atom.h,v $
  37. * Revision 1.15 2005/07/26 15:49:59 haraldkipp
  38. * Cygwin support added.
  39. *
  40. * Revision 1.14 2005/06/06 10:44:42 haraldkipp
  41. * Header files moved to re-enable building apart from source tree.
  42. *
  43. * Revision 1.13 2005/05/27 17:42:27 drsung
  44. * Platform dependant files were moved to /arch directory.
  45. *
  46. * Revision 1.12 2005/05/26 15:47:50 drsung
  47. * Fixed cvs commit comment from last commit. The
  48. * combination / and * made some compilers to produce errors... (ugh).
  49. * Thanks to Daniel Hobi who discovered this.
  50. *
  51. * Revision 1.11 2005/05/26 10:10:03 drsung
  52. * Moved all platform dependend code from this file to /include/arch/xxx_atom.h
  53. *
  54. * Revision 1.10 2005/05/13 21:47:07 chaac
  55. * Entering a critical section should now be faster on AVR's when
  56. * calling NutEnterCritical().
  57. *
  58. * Revision 1.9 2005/04/05 17:42:45 haraldkipp
  59. * ARM7 implementation of critical sections added.
  60. *
  61. * Revision 1.8 2005/02/21 12:37:59 phblum
  62. * Removed tabs and added semicolons after NUTTRACER macros
  63. *
  64. * Revision 1.7 2005/02/16 19:51:15 haraldkipp
  65. * Enable tracer configuration.
  66. *
  67. * Revision 1.6 2005/02/10 07:06:48 hwmaier
  68. * Changes to incorporate support for AT90CAN128 CPU
  69. *
  70. * Revision 1.5 2005/01/24 22:34:46 freckle
  71. * Added new tracer by Phlipp Blum <blum@tik.ee.ethz.ch>
  72. *
  73. * Revision 1.4 2004/04/07 12:13:57 haraldkipp
  74. * Matthias Ringwald's *nix emulation added
  75. *
  76. * Revision 1.3 2004/03/17 11:30:22 haraldkipp
  77. * Bugfix for ICCAVR
  78. *
  79. * Revision 1.2 2004/03/16 16:48:28 haraldkipp
  80. * Added Jan Dubiec's H8/300 port.
  81. *
  82. * Revision 1.1.1.1 2003/05/09 14:41:18 haraldkipp
  83. * Initial using 3.2.1
  84. *
  85. * Revision 1.6 2003/05/06 17:53:56 harald
  86. * Force critical inline
  87. *
  88. * Revision 1.5 2003/02/04 18:00:51 harald
  89. * Version 3 released
  90. *
  91. * Revision 1.4 2002/06/26 17:29:28 harald
  92. * First pre-release with 2.4 stack
  93. *
  94. */
  95. #include <cfg/os.h>
  96. #include <sys/types.h>
  97. #ifdef NUTTRACER_CRITICAL
  98. #include <sys/tracer.h>
  99. #endif
  100. /*
  101. * The folowing macros must at least be defined for each supported platform.
  102. *
  103. * NutEnterCritical()
  104. * Starts a critical section.
  105. * The global interrupt flag must be disabled to protect the folowing code from
  106. * interruption. The state of the global interrupt flag must be saved, to
  107. * later restore.
  108. *
  109. * NutExitCritical()
  110. * Finalize a critical section. Must be used only at the end of a critical section
  111. * to restore the global interrupt flag to the state saved by NutEnterCritical()
  112. *
  113. * NutJumpOutCritical()
  114. * Macro for early leaving the critical section. Must be used in the middle on a
  115. * critical section if you want to terminate the critical section.
  116. *
  117. */
  118. #if defined(__AVR__)
  119. #include <arch/avr/atom.h>
  120. #elif defined(__arm__)
  121. #include <arch/arm/atom.h>
  122. #elif defined(__H8300H__) || defined(__H8300S__)
  123. #include <arch/h8300h/atom.h>
  124. #elif defined(__m68k__)
  125. #include <arch/m68k/atom.h>
  126. #elif defined(__linux__) || defined(__APPLE__) || defined(__CYGWIN__)
  127. #include <arch/unix/atom.h>
  128. #endif
  129. #endif