summaryrefslogtreecommitdiff
path: root/target/linux
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2019-10-15 23:07:51 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2019-10-15 23:08:36 +0200
commitfb1227583603bc6fefbdac5c1b1bf81cdf737d65 (patch)
treea5bc6785527cf8bdc19e7ea5b27ceadae366edf5 /target/linux
parentfc597779adafc38a94c55798e42c11df610b7d4d (diff)
allow to build nds32 toolchain with old kernel
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/Config.in.kernelversion1
-rw-r--r--target/linux/patches/3.10-nds32/futex.patch40
2 files changed, 41 insertions, 0 deletions
diff --git a/target/linux/Config.in.kernelversion b/target/linux/Config.in.kernelversion
index 7aa58467f..8ee00c734 100644
--- a/target/linux/Config.in.kernelversion
+++ b/target/linux/Config.in.kernelversion
@@ -7,6 +7,7 @@ config ADK_TARGET_LINUX_KERNEL_NEW
choice
prompt "Linux Kernel version" if !ADK_TARGET_CHOOSE_ARCH
depends on ADK_TARGET_OS_LINUX
+default ADK_TARGET_LINUX_KERNEL_VERSION_3_10_NDS32 if ADK_TARGET_ARCH_NDS32
default ADK_TARGET_LINUX_KERNEL_VERSION_GIT if ADK_TARGET_BOARD_BCM28XX
default ADK_TARGET_LINUX_KERNEL_VERSION_GIT if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG
default ADK_TARGET_LINUX_KERNEL_VERSION_GIT if ADK_TARGET_SYSTEM_KINETIS_K70
diff --git a/target/linux/patches/3.10-nds32/futex.patch b/target/linux/patches/3.10-nds32/futex.patch
new file mode 100644
index 000000000..f45e04293
--- /dev/null
+++ b/target/linux/patches/3.10-nds32/futex.patch
@@ -0,0 +1,40 @@
+diff -Nur linux-3.10-nds32.orig/arch/nds32/include/asm/futex.h linux-3.10-nds32/arch/nds32/include/asm/futex.h
+--- linux-3.10-nds32.orig/arch/nds32/include/asm/futex.h 2017-07-31 07:41:18.000000000 +0200
++++ linux-3.10-nds32/arch/nds32/include/asm/futex.h 2019-10-15 22:59:44.514997184 +0200
+@@ -24,10 +24,10 @@
+ #define __futex_atomic_op(insn, ret, oldval, tmp, uaddr, oparg) \
+ smp_mb(); \
+ asm volatile( \
+- " movi $r15, #0\n" \
+- "1: llw %1, [%2+$r15]\n" \
++ " movi $ta, #0\n" \
++ "1: llw %1, [%2+$ta]\n" \
+ " " insn "\n" \
+- "2: scw %0, [%2+$r15]\n" \
++ "2: scw %0, [%2+$ta]\n" \
+ " beqz %0, 1b\n" \
+ " movi %0, #0\n" \
+ "3:\n" \
+@@ -47,18 +47,18 @@
+
+ smp_mb();
+ asm volatile(
+- " movi $r15, #0\n"
+- "1: llw %1, [%6 + $r15]\n"
++ " movi $ta, #0\n"
++ "1: llw %1, [%6 + $ta]\n"
+ " sub %3, %1, %4\n"
+ " cmovz %2, %5, %3\n"
+ " cmovn %2, %1, %3\n"
+- "2: scw %2, [%6 + $r15]\n"
++ "2: scw %2, [%6 + $ta]\n"
+ " beqz %2, 1b\n"
+ "3:\n "
+ __futex_atomic_ex_table("%7")
+ : "+&r" (ret), "=&r" (val), "=&r" (tmp), "=&r" (flags)
+ : "r" (oldval), "r" (newval), "r" (uaddr), "i" (-EFAULT)
+- : "$r15", "memory");
++ : "$ta", "memory");
+ smp_mb();
+
+ *uval = val;