mirror of
https://github.com/apache/nuttx.git
synced 2026-05-18 08:54:05 +08:00
include/notifier: fix undefined reference to spin_lock_irqsave_nopreempt
Fix linker error caused by including spinlock_type.h instead of spinlock.h in notifier.h header file. Error message: undefined reference to 'spin_lock_irqsave_nopreempt' in .text.clock_changed_notifier_call_chain Root cause: The notifier.h header was including <nuttx/spinlock_type.h> which only provides type definitions, but the inline functions in notifier.h use spinlock functions like spin_lock_irqsave_nopreempt(). These functions are defined in <nuttx/spinlock.h>, not in spinlock_type.h. Solution: Change the include from <nuttx/spinlock_type.h> to <nuttx/spinlock.h> to get both the type definitions and the function implementations. This fixes the undefined reference error when using notifier chains with spinlock protection. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/irq.h>
|
||||
#include <nuttx/mutex.h>
|
||||
#include <nuttx/spinlock_type.h>
|
||||
#include <nuttx/spinlock.h>
|
||||
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
|
||||
Reference in New Issue
Block a user