summaryrefslogtreecommitdiff
path: root/backport-include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'backport-include/asm')
-rw-r--r--backport-include/asm/atomic.h19
-rw-r--r--backport-include/asm/barrier.h26
-rw-r--r--backport-include/asm/errno.h23
-rw-r--r--backport-include/asm/ioctls.h9
4 files changed, 77 insertions, 0 deletions
diff --git a/backport-include/asm/atomic.h b/backport-include/asm/atomic.h
new file mode 100644
index 0000000..31bddc6
--- /dev/null
+++ b/backport-include/asm/atomic.h
@@ -0,0 +1,19 @@
+#ifndef __BACKPORT_ASM_ATOMIC_H
+#define __BACKPORT_ASM_ATOMIC_H
+#include_next <asm/atomic.h>
+#include <linux/version.h>
+#include <asm/barrier.h>
+
+#if LINUX_VERSION_IS_LESS(3,1,0)
+/*
+ * In many versions, several architectures do not seem to include an
+ * atomic64_t implementation, and do not include the software emulation from
+ * asm-generic/atomic64_t.
+ * Detect and handle this here.
+ */
+#if (!defined(ATOMIC64_INIT) && !defined(CONFIG_X86) && !(defined(CONFIG_ARM) && !defined(CONFIG_GENERIC_ATOMIC64)))
+#include <asm-generic/atomic64.h>
+#endif
+#endif
+
+#endif /* __BACKPORT_ASM_ATOMIC_H */
diff --git a/backport-include/asm/barrier.h b/backport-include/asm/barrier.h
new file mode 100644
index 0000000..bca0558
--- /dev/null
+++ b/backport-include/asm/barrier.h
@@ -0,0 +1,26 @@
+#ifndef __BACKPORT_ASM_BARRIER_H
+#define __BACKPORT_ASM_BARRIER_H
+
+#include <linux/version.h>
+#if LINUX_VERSION_IS_GEQ(3,4,0) || \
+ defined(CONFIG_ALPHA) || defined(CONFIG_MIPS)
+#include_next <asm/barrier.h>
+#endif /* >= 3.4 */
+
+#ifndef dma_rmb
+#define dma_rmb() rmb()
+#endif
+
+#ifndef dma_wmb
+#define dma_wmb() wmb()
+#endif
+
+#ifndef smp_mb__after_atomic
+#define smp_mb__after_atomic smp_mb__after_clear_bit
+#endif
+
+#ifndef smp_acquire__after_ctrl_dep
+#define smp_acquire__after_ctrl_dep() smp_rmb()
+#endif
+
+#endif /* __BACKPORT_ASM_BARRIER_H */
diff --git a/backport-include/asm/errno.h b/backport-include/asm/errno.h
new file mode 100644
index 0000000..0a730b7
--- /dev/null
+++ b/backport-include/asm/errno.h
@@ -0,0 +1,23 @@
+#ifndef __BACKPORT_ASM_ERRNO_H
+#define __BACKPORT_ASM_ERRNO_H
+#include_next <asm/errno.h>
+
+#ifndef ERFKILL
+#if !defined(CONFIG_ALPHA) && !defined(CONFIG_MIPS) && !defined(CONFIG_PARISC) && !defined(CONFIG_SPARC)
+#define ERFKILL 132 /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_ALPHA
+#define ERFKILL 138 /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_MIPS
+#define ERFKILL 167 /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_PARISC
+#define ERFKILL 256 /* Operation not possible due to RF-kill */
+#endif
+#ifdef CONFIG_SPARC
+#define ERFKILL 134 /* Operation not possible due to RF-kill */
+#endif
+#endif
+
+#endif /* __BACKPORT_ASM_ERRNO_H */
diff --git a/backport-include/asm/ioctls.h b/backport-include/asm/ioctls.h
new file mode 100644
index 0000000..72c2f0a
--- /dev/null
+++ b/backport-include/asm/ioctls.h
@@ -0,0 +1,9 @@
+#ifndef __BACKPORT_ASM_IOCTLS_H
+#define __BACKPORT_ASM_IOCTLS_H
+#include_next <asm/ioctls.h>
+
+#ifndef TIOCPKT_IOCTL
+#define TIOCPKT_IOCTL 64
+#endif
+
+#endif /* __BACKPORT_ASM_IOCTLS_H */