aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/compat/compat-asm.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-10-06 06:01:11 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-06 06:01:11 +0200
commitb4ba33e33b6d64913c08ed1809e711ce98422454 (patch)
tree47cd286478e89a86d0720cdd10aaec425ecd8e5a /src/compat/compat-asm.h
parentversion: bump snapshot (diff)
downloadwireguard-monolithic-historical-b4ba33e33b6d64913c08ed1809e711ce98422454.tar.xz
wireguard-monolithic-historical-b4ba33e33b6d64913c08ed1809e711ce98422454.zip
compat: account for ancient ARM assembler
Diffstat (limited to '')
-rw-r--r--src/compat/compat-asm.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/compat/compat-asm.h b/src/compat/compat-asm.h
index c49f766..8ce3045 100644
--- a/src/compat/compat-asm.h
+++ b/src/compat/compat-asm.h
@@ -8,6 +8,7 @@
#include <linux/linkage.h>
#include <linux/kconfig.h>
+#include <linux/version.h>
/* PaX compatibility */
#if defined(RAP_PLUGIN)
@@ -15,4 +16,28 @@
#define ENTRY RAP_ENTRY
#endif
+#if defined(__LINUX_ARM_ARCH__) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
+ .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
+ .macro ret\c, reg
+#if __LINUX_ARM_ARCH__ < 6
+ mov\c pc, \reg
+#else
+ .ifeqs "\reg", "lr"
+ bx\c \reg
+ .else
+ mov\c pc, \reg
+ .endif
+#endif
+ .endm
+ .endr
+#endif
+
+#if defined(__LINUX_ARM_ARCH__) && LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0)
+#include <asm/assembler.h>
+#define lspush push
+#define lspull pull
+#undef push
+#undef pull
+#endif
+
#endif /* _WG_COMPATASM_H */