aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-12-17 11:57:44 -0800
committerBrian Behlendorf <[email protected]>2009-12-17 11:57:44 -0800
commit3a03ce5cbf61def830905dfab0f43d5b6074f921 (patch)
treec190b0f5e0f51ca1fbf470d33480b724a903b777 /include
parent242f539a2ea886769a6408192a6a263fb2a45eaf (diff)
Check for changed gaurd macro in 2.6.28+ for rwsem implementation.
As part of the 2.6.28 cleanup which moved all the linux/include/asm/ headers in to linux/arch, the guard headers for many header files changed. The i386 rwsem implementation keys off this header to ensure the internal members of the rwsem structure are interpreted correctly. This change checks for the new guard macro in addition to the only one, the implementation of the rwsem has not changed for i386 so this is safe and correct.
Diffstat (limited to 'include')
-rw-r--r--include/sys/rwlock.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h
index 0043f3966..89fdfa537 100644
--- a/include/sys/rwlock.h
+++ b/include/sys/rwlock.h
@@ -64,7 +64,11 @@ typedef struct {
extern void __up_read_locked(struct rw_semaphore *);
extern int __down_write_trylock_locked(struct rw_semaphore *);
#else
-# ifdef _I386_RWSEM_H
+/*
+ * 2.6.x - 2.6.27 use guard macro _I386_RWSEM_H
+ * 2.6.28 - 2.6.32+ use guard macro _ASM_X86_RWSEM_H
+ */
+# if defined(_I386_RWSEM_H) || defined(_ASM_X86_RWSEM_H)
# define RW_COUNT(rwp) ((SEM(rwp)->count < 0) ? (-1) : \
(SEM(rwp)->count & RWSEM_ACTIVE_MASK))
# else