[PATCH] Fix x86_64 SPINLOCK_MAGIC debugging

From: Zwane Mwaikambo
Date: Thu Sep 09 2004 - 22:06:39 EST


Using a label isn't sufficent anymore for determining the location of the
failed lock. Use __builtin_return_address instead.

Signed-off-by: Zwane Mwaikambo <zwane@xxxxxxxxxxx>

--- linux-2.6-bk/include/asm-x86_64/spinlock.h.orig 2004-09-09 22:58:46.389411752 -0400
+++ linux-2.6-bk/include/asm-x86_64/spinlock.h 2004-09-09 23:00:31.513430472 -0400
@@ -113,10 +113,8 @@ static inline int _raw_spin_trylock(spin
static inline void _raw_spin_lock(spinlock_t *lock)
{
#ifdef CONFIG_DEBUG_SPINLOCK
- __label__ here;
-here:
if (lock->magic != SPINLOCK_MAGIC) {
-printk("eip: %p\n", &&here);
+ printk("eip: %p\n", __builtin_return_address(0));
BUG();
}
#endif
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/