miscellaneous.cpp 472 B

12345678910111213141516171819202122
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-04-27 flybreak the first version.
  9. */
  10. #include <arm-tpl.h>
  11. extern "C" int __ARM_TPL_execute_once(__ARM_TPL_exec_once_flag *__flag,
  12. void (*__init_routine)(void))
  13. {
  14. if (*__flag == 0)
  15. {
  16. __init_routine();
  17. *__flag = 1;
  18. }
  19. return 0;
  20. }