crt1.c 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. /**
  14. * @file ARMCMx/compilers/GCC/crt1.c
  15. * @brief Startup stub functions.
  16. *
  17. * @addtogroup ARMCMx_GCC_STARTUP
  18. * @{
  19. */
  20. #include <stdbool.h>
  21. /**
  22. * @brief Architecture-dependent core initialization.
  23. * @details This hook is invoked immediately after the stack initialization
  24. * and before the DATA and BSS segments initialization.
  25. * @note This function is a weak symbol.
  26. */
  27. #if !defined(__DOXYGEN__)
  28. __attribute__((weak))
  29. #endif
  30. /*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
  31. void __core_init(void) {}
  32. /**
  33. * @brief Early initialization.
  34. * @details This hook is invoked immediately after the stack initialization
  35. * and before the DATA and BSS segments initialization. The
  36. * default behavior is to do nothing.
  37. * @note This function is a weak symbol.
  38. */
  39. #if !defined(__DOXYGEN__)
  40. __attribute__((weak))
  41. #endif
  42. /*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
  43. void __early_init(void) {}
  44. /*lint -restore*/
  45. /**
  46. * @brief Late initialization.
  47. * @details This hook is invoked after the DATA and BSS segments
  48. * initialization and before any static constructor. The
  49. * default behavior is to do nothing.
  50. * @note This function is a weak symbol.
  51. */
  52. #if !defined(__DOXYGEN__)
  53. __attribute__((weak))
  54. #endif
  55. /*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
  56. void __late_init(void) {}
  57. /*lint -restore*/
  58. /**
  59. * @brief Default @p main() function exit handler.
  60. * @details This handler is invoked or the @p main() function exit. The
  61. * default behavior is to enter an infinite loop.
  62. * @note This function is a weak symbol.
  63. */
  64. #if !defined(__DOXYGEN__)
  65. __attribute__((noreturn, weak))
  66. #endif
  67. /*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
  68. void __default_exit(void) {
  69. /*lint -restore*/
  70. while (true) {
  71. }
  72. }
  73. /** @} */