On Mon, 19 Sep 2016, Jonas Bonn wrote:
On 09/16/2016 04:43 PM, Stafford Horne wrote:
I know this was proposed by way of this patch, but we deferred accepting this
until the OpenRISC spec could be updated accordingly. Has this been done
now? If not, still NAK.
From: Christian Svensson <b...@cmd.nu>
Historically OpenRISC GCC has reserved r10 which we now use to hold
the thread pointer for thread-local storage (TLS).
Thanks for your review, I do not believe the spec has been updated. I will
look into seeing what I can do and update the patch if needed.
Signed-off-by: Christian Svensson <b...@cmd.nu>
Signed-off-by: Stefan Kristiansson <stefan.kristians...@saunalahti.fi>
Signed-off-by: Stafford Horne <sho...@gmail.com>
arch/openrisc/kernel/process.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/arch/openrisc/kernel/process.c
index 7095dfe..277123b 100644
@@ -173,6 +173,19 @@ copy_thread(unsigned long clone_flags, unsigned long
userregs->sp = usp;
+ * For CLONE_SETTLS set "tp" (r10) to the TLS pointer passed
+ * The kernel entry is:
+ * int clone (long flags, void *child_stack, int
+ * int *child_tid, struct void *tls)
+ * This makes the source r7 in the kernel registers.
+ if (clone_flags & CLONE_SETTLS)
+ userregs->gpr = userregs->gpr;
userregs->gpr = 0; /* Result from fork() */
kregs->gpr = 0; /* Userspace thread */