From 4aed856d7fb17ced2554aaebe5a3c3069d127a74 Mon Sep 17 00:00:00 2001 From: Enjia Mai Date: Fri, 12 Mar 2021 23:05:56 +0800 Subject: [PATCH] kernel: smp: Remove unused internal API z_smp_reacquire_global_lock() The internal function z_smp_reacquire_global_lock() has not used by anywhere inside zephyr code, so remove it. Fixes #33273. Signed-off-by: Enjia Mai --- kernel/include/kswap.h | 1 - kernel/smp.c | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/kernel/include/kswap.h b/kernel/include/kswap.h index 75f298cdbec..cfc7036037e 100644 --- a/kernel/include/kswap.h +++ b/kernel/include/kswap.h @@ -25,7 +25,6 @@ extern struct k_spinlock sched_spinlock; * to restore the lock state to whatever the thread's counter * expects. */ -void z_smp_reacquire_global_lock(struct k_thread *thread); void z_smp_release_global_lock(struct k_thread *thread); /* context switching and scheduling-related routines */ diff --git a/kernel/smp.c b/kernel/smp.c index 03d0a9d6bf6..6e58a7b8964 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -41,17 +41,6 @@ void z_smp_global_unlock(unsigned int key) arch_irq_unlock(key); } -void z_smp_reacquire_global_lock(struct k_thread *thread) -{ - if (thread->base.global_lock_count) { - arch_irq_lock(); - - while (!atomic_cas(&global_lock, 0, 1)) { - } - } -} - - /* Called from within z_swap(), so assumes lock already held */ void z_smp_release_global_lock(struct k_thread *thread) {