zephyr/lib/libc/armstdc/src/threading_weak.c
Gerard Marull-Paretas cbd31d720b lib: migrate includes to <zephyr/...>
In order to bring consistency in-tree, migrate all lib code to the new
prefix <zephyr/...>. Note that the conversion has been scripted, refer
to zephyrproject-rtos#45388 for more details.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
2022-05-06 19:58:09 +02:00

73 lines
1.3 KiB
C

/*
* Copyright (c) 2021 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/*
* Weak stub implementation of threading related kernel functions.
*
* This file is needed for armlink.
*
* When linking with armlink the linker will resolve undefined symbols for all
* undefined functions even if those functions the reference the undefined
* symbol is never actually called.
*
* This file provides weak stub implementations that are compiled when
* CONFIG_MULTITHREADING=n to ensure proper linking.
*/
#include <zephyr/kernel.h>
int __weak z_impl_k_mutex_init(struct k_mutex *mutex)
{
return 0;
}
int __weak z_impl_k_mutex_lock(struct k_mutex *mutex, k_timeout_t timeout)
{
return 0;
}
int __weak z_impl_k_mutex_unlock(struct k_mutex *mutex)
{
return 0;
}
void __weak z_impl_k_sem_give(struct k_sem *sem)
{
}
int __weak z_impl_k_sem_init(struct k_sem *sem, unsigned int initial_count,
unsigned int limit)
{
return 0;
}
int __weak z_impl_k_sem_take(struct k_sem *sem, k_timeout_t timeout)
{
return 0;
}
k_tid_t __weak z_impl_z_current_get(void)
{
return 0;
}
int32_t __weak z_impl_k_usleep(int us)
{
return 0;
}
void __weak z_thread_abort(struct k_thread *thread)
{
}
void __weak k_sched_lock(void)
{
}
void __weak k_sched_unlock(void)
{
}