Browse Source

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>
pull/85575/head
Guennadi Liakhovetski 5 months ago committed by Benjamin Cabé
parent
commit
037cb87276
  1. 2
      kernel/idle.c
  2. 5
      kernel/spinlock_validate.c

2
kernel/idle.c

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

5
kernel/spinlock_validate.c

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

Loading…
Cancel
Save