microblaze: Setup correct pointer to TLS area
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>
Fri, 24 Feb 2012 04:52:25 +0000 (14:52 +1000)
committerMichal Simek <monstr@monstr.eu>
Fri, 25 May 2012 04:41:18 +0000 (06:41 +0200)
Setup a pointer to the TLS area in copy_thread.
r10 is 6th argumetn which contains TLS area.
And r21 is the thread reg.

Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Signed-off-by: David Holsgrove <david.holsgrove@petalogix.com>
Signed-off-by: Michal Simek <monstr@monstr.eu>
arch/microblaze/kernel/process.c

index 883b92789cdf849330d3b06e29fafef9b3381b39..1944e00f07e1d4185cbf8bbdf894591192ef6abd 100644 (file)
@@ -182,8 +182,12 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 #endif
        ti->cpu_context.r15 = (unsigned long)ret_from_fork - 8;
 
+       /*
+        *  r21 is the thread reg, r10 is 6th arg to clone
+        *  which contains TLS area
+        */
        if (clone_flags & CLONE_SETTLS)
-               ;
+               childregs->r21 = childregs->r10;
 
        return 0;
 }