From: Mathieu Desnoyers Date: Fri, 24 Jun 2011 03:03:30 +0000 (-0400) Subject: update spinlock wrapper X-Git-Tag: v2.0-pre1~35 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=8e1be6f10739dd3be36921dee2662c2610f44564;p=lttng-modules.git update spinlock wrapper Signed-off-by: Mathieu Desnoyers --- diff --git a/wrapper/spinlock.h b/wrapper/spinlock.h index e38d3891..8b1ad992 100644 --- a/wrapper/spinlock.h +++ b/wrapper/spinlock.h @@ -11,9 +11,12 @@ #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) -#define raw_spin_lock_init(lock) \ - do { \ - *(lock) = __RAW_SPIN_LOCK_UNLOCKED; \ +#include + +#define raw_spin_lock_init(lock) \ + do { \ + raw_spinlock_t __lock = __RAW_SPIN_LOCK_UNLOCKED; \ + memcpy(lock, &__lock, sizeof(lock)); \ } while (0) #define raw_spin_is_locked(lock) __raw_spin_is_locked(lock)