On Thu, Aug 01, 2024 at 10:43:03AM GMT, Alexandre Ghiti wrote:
...
It depends on where the definition is done. It should work if the__arch_spin_lock() would use queued_spin_lock() so that would make andiff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.hI'm not sure what's better/worse, but instead of inventing this
index 0655aa5b57b2..bf47cca2c375 100644
--- a/include/asm-generic/qspinlock.h
+++ b/include/asm-generic/qspinlock.h
@@ -136,6 +136,7 @@ static __always_inline bool virt_spin_lock(struct qspinlock *lock)
}
#endif
+#ifndef __no_arch_spinlock_redefine
__no_arch_spinlock_redefine thing we could just name all the functions
something like __arch_spin* and then add defines for both to asm/spinlock.h,
i.e.
#define queued_spin_lock(l) __arch_spin_lock(l)
...
#define ticket_spin_lock(l) __arch_spin_lock(l)
...
"infinite recursive definition" right? And that would override the
"real" queued_spin_lock() implementation too.
But maybe I missed something!
preprocessor expands the implementation of __arch_spin_* before
evaluating the #define of queued_spin_*. IOW, we just need to put
the defines after the static inline constructions.
Thanks,
drew
_______________________________________________
linux-riscv mailing list
linux-riscv@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/linux-riscv