Page MenuHomeFreeBSD

D29988.diff
No OneTemporary

D29988.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/spinlock.h b/sys/compat/linuxkpi/common/include/linux/spinlock.h
--- a/sys/compat/linuxkpi/common/include/linux/spinlock.h
+++ b/sys/compat/linuxkpi/common/include/linux/spinlock.h
@@ -31,6 +31,7 @@
#ifndef _LINUX_SPINLOCK_H_
#define _LINUX_SPINLOCK_H_
+#include <asm/atomic.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
@@ -160,4 +161,16 @@
mtx_assert(&(_l)->m, MA_OWNED); \
} while (0)
+static inline int
+atomic_dec_and_lock_irqsave(atomic_t *cnt, spinlock_t *lock,
+ unsigned long flags)
+{
+ spin_lock_irqsave(lock, flags);
+ if (atomic_dec_and_test(cnt)) {
+ return (1);
+ }
+ spin_unlock_irqrestore(lock, flags);
+ return (0);
+}
+
#endif /* _LINUX_SPINLOCK_H_ */
diff --git a/sys/sys/param.h b/sys/sys/param.h
--- a/sys/sys/param.h
+++ b/sys/sys/param.h
@@ -60,7 +60,7 @@
* in the range 5 to 9.
*/
#undef __FreeBSD_version
-#define __FreeBSD_version 1400010 /* Master, propagated to newvers */
+#define __FreeBSD_version 1400011 /* Master, propagated to newvers */
/*
* __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD,

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 8, 8:11 PM (14 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14541901
Default Alt Text
D29988.diff (1 KB)

Event Timeline