threading_weak.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /*
  2. * Copyright (c) 2021 Nordic Semiconductor ASA
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /*
  7. * Weak stub implementation of threading related kernel functions.
  8. *
  9. * This file is needed for armlink.
  10. *
  11. * When linking with armlink the linker will resolve undefined symbols for all
  12. * undefined functions even if those functions the reference the undefined
  13. * symbol is never actually called.
  14. *
  15. * This file provides weak stub implementations that are compiled when
  16. * CONFIG_MULTITHREADING=n to ensure proper linking.
  17. */
  18. #include <kernel.h>
  19. int __weak z_impl_k_mutex_init(struct k_mutex *mutex)
  20. {
  21. return 0;
  22. }
  23. int __weak z_impl_k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout)
  24. {
  25. return 0;
  26. }
  27. int __weak z_impl_k_mutex_unlock(struct k_mutex *mutex)
  28. {
  29. return 0;
  30. }
  31. void __weak z_impl_k_sem_give(struct k_sem *sem)
  32. {
  33. }
  34. int __weak z_impl_k_sem_init(struct k_sem *sem, unsigned int initial_count,
  35. unsigned int limit)
  36. {
  37. return 0;
  38. }
  39. int __weak z_impl_k_sem_take(struct k_sem *sem, k_timeout_t timeout)
  40. {
  41. return 0;
  42. }
  43. k_tid_t __weak z_impl_z_current_get(void)
  44. {
  45. return 0;
  46. }
  47. int32_t __weak z_impl_k_usleep(int us)
  48. {
  49. return 0;
  50. }
  51. void __weak z_thread_abort(struct k_thread *thread)
  52. {
  53. }
  54. void __weak k_sched_lock(void)
  55. {
  56. }
  57. void __weak k_sched_unlock(void)
  58. {
  59. }