newlib.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. #ifndef TOOLCHAIN_NEWLIB_H_
  2. #define TOOLCHAIN_NEWLIB_H_
  3. /*
  4. * Copyright (C) 2012 by egnite GmbH
  5. * Copyright (C) 2001-2006 by egnite Software GmbH
  6. *
  7. * All rights reserved.
  8. *
  9. * Redistribution and use in source and binary forms, with or without
  10. * modification, are permitted provided that the following conditions
  11. * are met:
  12. *
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. * 3. Neither the name of the copyright holders nor the names of
  19. * contributors may be used to endorse or promote products derived
  20. * from this software without specific prior written permission.
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  23. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  24. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  25. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  26. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  27. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  28. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  29. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  30. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  31. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  32. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  33. * SUCH DAMAGE.
  34. *
  35. * For additional information see http://www.ethernut.de/
  36. */
  37. #ifdef __arm__
  38. #ifdef __CORTEX__
  39. #include <arch/cm3.h>
  40. #endif
  41. #include <arch/arm.h>
  42. #endif
  43. #if defined(MCU_AT91SAM7SE)
  44. /*!
  45. * \brief Function running in internal RAM.
  46. *
  47. * When running in flash or external RAM, certain time critical functions
  48. * may be executed in internal RAM for optimal performance. Another use is
  49. * self re-programming, where the programming function itself cannot run in
  50. * flash.
  51. *
  52. * This section will be copied to internal RAM during runtime initialization.
  53. */
  54. #ifndef SECTION_FUNC_IRAM
  55. #define SECTION_FUNC_IRAM __attribute__ ((long_call, section(".text_iram")))
  56. #endif
  57. /*!
  58. * \brief Initialized variables in internal RAM.
  59. *
  60. * If variables are by default in external RAM, this attribute can be used
  61. * to place certain variables in internal RAM. Actually this is rarely used.
  62. *
  63. * The initial values in this section will be copied to internal RAM during
  64. * runtime initialization.
  65. */
  66. #ifndef SECTION_DATA_IRAM
  67. #define SECTION_DATA_IRAM __attribute__ ((section(".data_iram")))
  68. #endif
  69. /*!
  70. * \brief Variables in internal RAM.
  71. *
  72. * If variables are by default in external RAM, this attribute can be used
  73. * to place certain variables in internal RAM. Often used for buffers, when
  74. * peripheral DMA does not properly work in external SDRAM.
  75. *
  76. * This section will be cleared to zero during runtime initialization.
  77. */
  78. #ifndef SECTION_BSS_IRAM
  79. #define SECTION_BSS_IRAM __attribute__ ((section(".bss_iram")))
  80. #endif
  81. /*!
  82. * \brief Function running in external RAM.
  83. *
  84. * Typically used for self re-programming functions, if the default code
  85. * is located in flash.
  86. *
  87. * This section will be copied to external RAM during runtime initialization.
  88. */
  89. #ifndef SECTION_FUNC_XRAM
  90. #define SECTION_FUNC_XRAM __attribute__ ((long_call, section(".text_xram")))
  91. #endif
  92. /*!
  93. * \brief Variables in external RAM.
  94. *
  95. * If variables are by default in internal RAM, this attribute can be used
  96. * to place certain variables in external RAM. Rarely used for large buffers,
  97. * which will not fit in internal RAM.
  98. *
  99. * This section will be cleared to zero during runtime initialization.
  100. */
  101. #ifndef SECTION_BSS_XRAM
  102. #define SECTION_BSS_XRAM __attribute__ ((section(".bss_xram")))
  103. #endif
  104. #endif
  105. #include <toolchain/generic.h>
  106. #endif