Re: nptl 0.30

Paul Mackerras <[email protected]>
Newsgroups gmane.comp.lib.phil
Message-ID <[email protected]>
Steve Munroe writes:

> Do you have a PPC64 nptl kernel working?

I'm running a ppc64 kernel on an RS/6000 B80 at the moment, and I just
tried my ppc32 NPTL build, and it passed all the tests.  The kernel is
stock 2.5.65 plus the patch below (which adds CLONE_SETTLS support)
plus a couple of other unrelated patches.  I haven't tried building a
ppc64 NPTL yet.

Paul.

diff -urN linux-2.5/arch/ppc64/kernel/process.c ppc64/arch/ppc64/kernel/process.c
--- linux-2.5/arch/ppc64/kernel/process.c	2003-02-23 21:45:50.000000000 +1100
+++ ppc64/arch/ppc64/kernel/process.c	2003-03-19 16:37:25.000000000 +1100
@@ -208,6 +208,12 @@
 	} else {
 		childregs->gpr[1] = usp;
 		p->thread.regs = childregs;
+		if (clone_flags & CLONE_SETTLS) {
+			if (test_thread_flag(TIF_32BIT))
+				childregs->gpr[2] = childregs->gpr[6];
+			else
+				childregs->gpr[13] = childregs->gpr[6];
+		}
 	}
 	childregs->gpr[3] = 0;  /* Result from fork() */
 	sp -= STACK_FRAME_OVERHEAD;
@@ -304,7 +310,7 @@
 	if (clone_flags & (CLONE_PARENT_SETTID | CLONE_CHILD_SETTID |
 			   CLONE_CHILD_CLEARTID)) {
 		parent_tidptr = p3;
-		child_tidptr = p4;
+		child_tidptr = p5;
 		if (test_thread_flag(TIF_32BIT)) {
 			parent_tidptr &= 0xffffffff;
 			child_tidptr &= 0xffffffff;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.