kernel: thread: make offload_sem visible for releasing it outside
In order to release irq_offload semaphore outside kernel/thread.c, we make it visible by modifying it non-static under ztest. This would be needed such as when call irq_offload() to enter interrupt context and a fatal error happened, then you have to release it in your fatal handler, or the irq_offload will still be locked and no longer be using again. Signed-off-by: Enjia Mai <enjiax.mai@intel.com>
This commit is contained in:
parent
39dab07f49
commit
00d7f2cfb6
1 changed files with 4 additions and 1 deletions
|
@ -908,7 +908,10 @@ static inline int z_vrfy_k_float_disable(struct k_thread *thread)
|
||||||
#endif /* CONFIG_USERSPACE */
|
#endif /* CONFIG_USERSPACE */
|
||||||
|
|
||||||
#ifdef CONFIG_IRQ_OFFLOAD
|
#ifdef CONFIG_IRQ_OFFLOAD
|
||||||
static K_SEM_DEFINE(offload_sem, 1, 1);
|
/* Make offload_sem visible outside under testing, in order to release
|
||||||
|
* it outside when error happened.
|
||||||
|
*/
|
||||||
|
K_SEM_DEFINE(offload_sem, 1, 1);
|
||||||
|
|
||||||
void irq_offload(irq_offload_routine_t routine, const void *parameter)
|
void irq_offload(irq_offload_routine_t routine, const void *parameter)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue