llext: export spinlock debugging symbols to extensions

With spinlock debugging enabled LLEXTs need additional symbols
exported by the kernel.

Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
This commit is contained in:
Guennadi Liakhovetski 2025-02-04 10:56:12 +01:00 committed by Benjamin Cabé
commit 037cb87276
2 changed files with 7 additions and 0 deletions

View file

@ -8,6 +8,7 @@
#include <zephyr/toolchain.h>
#include <zephyr/linker/sections.h>
#include <zephyr/drivers/timer/system_timer.h>
#include <zephyr/llext/symbol.h>
#include <zephyr/pm/pm.h>
#include <stdbool.h>
#include <zephyr/logging/log.h>
@ -100,3 +101,4 @@ void __weak arch_spin_relax(void)
arch_nop();
}
EXPORT_SYMBOL(arch_spin_relax);

View file

@ -5,6 +5,7 @@
*/
#include <kernel_internal.h>
#include <zephyr/spinlock.h>
#include <zephyr/llext/symbol.h>
bool z_spin_lock_valid(struct k_spinlock *l)
{
@ -17,6 +18,7 @@ bool z_spin_lock_valid(struct k_spinlock *l)
}
return true;
}
EXPORT_SYMBOL(z_spin_lock_valid);
bool z_spin_unlock_valid(struct k_spinlock *l)
{
@ -33,15 +35,18 @@ bool z_spin_unlock_valid(struct k_spinlock *l)
}
return true;
}
EXPORT_SYMBOL(z_spin_unlock_valid);
void z_spin_lock_set_owner(struct k_spinlock *l)
{
l->thread_cpu = _current_cpu->id | (uintptr_t)_current;
}
EXPORT_SYMBOL(z_spin_lock_set_owner);
#ifdef CONFIG_KERNEL_COHERENCE
bool z_spin_lock_mem_coherent(struct k_spinlock *l)
{
return arch_mem_coherent((void *)l);
}
EXPORT_SYMBOL(z_spin_lock_mem_coherent);
#endif /* CONFIG_KERNEL_COHERENCE */