Christian Svensson
2013-02-13 09:39:10 UTC
* arch/openrisc/kernel/process.c:
(copy_thread): Support for CLONE_SETTLS flag.
---
arch/openrisc/kernel/process.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index 55210f3..12056bf 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -142,6 +142,13 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
childregs->sp = usp;
}
+ /*
+ * If CLONE_SETTLS is set, set "tp" in the new task to "r7",
+ * which is passed in as arg #5 to sys_clone().
+ */
+ if (clone_flags & CLONE_SETTLS)
+ childregs->gpr[10] = regs->gpr[7];
+
childregs->gpr[11] = 0; /* Result from fork() */
/*
(copy_thread): Support for CLONE_SETTLS flag.
---
arch/openrisc/kernel/process.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c
index 55210f3..12056bf 100644
--- a/arch/openrisc/kernel/process.c
+++ b/arch/openrisc/kernel/process.c
@@ -142,6 +142,13 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
childregs->sp = usp;
}
+ /*
+ * If CLONE_SETTLS is set, set "tp" in the new task to "r7",
+ * which is passed in as arg #5 to sys_clone().
+ */
+ if (clone_flags & CLONE_SETTLS)
+ childregs->gpr[10] = regs->gpr[7];
+
childregs->gpr[11] = 0; /* Result from fork() */
/*
--
1.8.1.2
1.8.1.2