crt1.c 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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 ARMCAx-TZ/compilers/GCC/crt1.c
  15. * @brief Startup stub functions.
  16. *
  17. * @addtogroup ARMCAx_GCC_STARTUP
  18. * @{
  19. */
  20. #include <stdbool.h>
  21. /**
  22. * @brief Early initialization.
  23. * @details This hook is invoked immediately after the stack initialization
  24. * and before the DATA and BSS segments initialization. The
  25. * default behavior is to do nothing.
  26. * @note This function is a weak symbol.
  27. */
  28. #if !defined(__DOXYGEN__)
  29. __attribute__((weak))
  30. #endif
  31. /*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
  32. void __early_init(void) {}
  33. /*lint -restore*/
  34. /**
  35. * @brief Late initialization.
  36. * @details This hook is invoked after the DATA and BSS segments
  37. * initialization and before any static constructor. The
  38. * default behavior is to do nothing.
  39. * @note This function is a weak symbol.
  40. */
  41. #if !defined(__DOXYGEN__)
  42. __attribute__((weak))
  43. #endif
  44. /*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
  45. void __late_init(void) {}
  46. /*lint -restore*/
  47. /**
  48. * @brief Default @p main() function exit handler.
  49. * @details This handler is invoked or the @p main() function exit. The
  50. * default behavior is to enter an infinite loop.
  51. * @note This function is a weak symbol.
  52. */
  53. #if !defined(__DOXYGEN__)
  54. __attribute__((noreturn, weak))
  55. #endif
  56. /*lint -save -e9075 [8.4] All symbols are invoked from asm context.*/
  57. void __default_exit(void) {
  58. /*lint -restore*/
  59. while (true) {
  60. }
  61. }
  62. /** @} */