mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] s390 fixes (11/12).
@ 2003-02-03 14:50 Martin Schwidefsky
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Schwidefsky @ 2003-02-03 14:50 UTC (permalink / raw)
  To: linux-kernel, torvalds

fix support for thread local storage on s390
diff -urN linux-2.5.59/arch/s390/kernel/process.c 
linux-2.5.59-s390/arch/s390/kernel/process.c
--- linux-2.5.59/arch/s390/kernel/process.c	Fri Jan 17 03:22:28 2003
+++ linux-2.5.59-s390/arch/s390/kernel/process.c	Mon Feb  3 15:18:29 2003
@@ -196,8 +196,6 @@
 
         /* new return point is ret_from_fork */
         frame->gprs[8] = (unsigned long) ret_from_fork;
-	/* start disabled because of schedule_tick and rq->lock being held */
-	frame->childregs.psw.mask &= ~0x03000000;
 
         /* fake return stack for resume(), don't go back to schedule */
         frame->gprs[9]  = (unsigned long) frame;
@@ -213,6 +211,10 @@
 	p->thread.ar4 = get_fs().ar4;
         /* Don't copy debug registers */
         memset(&p->thread.per_info,0,sizeof(p->thread.per_info));
+
+	/* Set a new TLS ?  */
+	if (clone_flags & CLONE_SETTLS)
+		frame->childregs.acrs[0] = regs->gprs[6];
         return 0;
 }
 
@@ -335,7 +337,7 @@
 	int count = 0;
 	if (!p || p == current || p->state == TASK_RUNNING)
 		return 0;
-	stack_page = (unsigned long) p;
+	stack_page = (unsigned long) p->thread_info;
 	r15 = p->thread.ksp;
         if (!stack_page || r15 < stack_page || r15 >= 8188+stack_page)
                 return 0;
diff -urN linux-2.5.59/arch/s390x/kernel/process.c 
linux-2.5.59-s390/arch/s390x/kernel/process.c
--- linux-2.5.59/arch/s390x/kernel/process.c	Fri Jan 17 03:22:25 2003
+++ linux-2.5.59-s390/arch/s390x/kernel/process.c	Mon Feb  3 15:18:29 2003
@@ -203,6 +203,19 @@
 	p->thread.ar4 = get_fs().ar4;
         /* Don't copy debug registers */
         memset(&p->thread.per_info,0,sizeof(p->thread.per_info));
+
+	/* Set a new TLS ?  */
+	if (clone_flags & CLONE_SETTLS) {
+		if (current->thread.flags & S390_FLAG_31BIT) {
+			frame->childregs.acrs[0] =
+				(unsigned int) regs->gprs[6];
+		} else {
+			frame->childregs.acrs[0] =
+				(unsigned int)(regs->gprs[6] >> 32);
+			frame->childregs.acrs[1] =
+				(unsigned int) regs->gprs[6];
+		}
+	}
         return 0;
 }
 
@@ -319,7 +332,7 @@
         int count = 0;
         if (!p || p == current || p->state == TASK_RUNNING)
                 return 0;
-        stack_page = (unsigned long) p;
+	stack_page = (unsigned long) p->thread_info;
         r15 = p->thread.ksp;
         if (!stack_page || r15 < stack_page || r15 >= 16380+stack_page)
                 return 0;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] s390 fixes (11/12).
@ 2003-02-03 19:48 Martin Schwidefsky
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Schwidefsky @ 2003-02-03 19:48 UTC (permalink / raw)
  To: linux-kernel, torvalds

fix support for thread local storage on s390
diff -urN linux-2.5.59/arch/s390/kernel/process.c linux-2.5.59-s390/arch/s390/kernel/process.c
--- linux-2.5.59/arch/s390/kernel/process.c	Fri Jan 17 03:22:28 2003
+++ linux-2.5.59-s390/arch/s390/kernel/process.c	Mon Feb  3 20:50:16 2003
@@ -196,8 +196,6 @@
 
         /* new return point is ret_from_fork */
         frame->gprs[8] = (unsigned long) ret_from_fork;
-	/* start disabled because of schedule_tick and rq->lock being held */
-	frame->childregs.psw.mask &= ~0x03000000;
 
         /* fake return stack for resume(), don't go back to schedule */
         frame->gprs[9]  = (unsigned long) frame;
@@ -213,6 +211,10 @@
 	p->thread.ar4 = get_fs().ar4;
         /* Don't copy debug registers */
         memset(&p->thread.per_info,0,sizeof(p->thread.per_info));
+
+	/* Set a new TLS ?  */
+	if (clone_flags & CLONE_SETTLS)
+		frame->childregs.acrs[0] = regs->gprs[6];
         return 0;
 }
 
@@ -335,7 +337,7 @@
 	int count = 0;
 	if (!p || p == current || p->state == TASK_RUNNING)
 		return 0;
-	stack_page = (unsigned long) p;
+	stack_page = (unsigned long) p->thread_info;
 	r15 = p->thread.ksp;
         if (!stack_page || r15 < stack_page || r15 >= 8188+stack_page)
                 return 0;
diff -urN linux-2.5.59/arch/s390x/kernel/process.c linux-2.5.59-s390/arch/s390x/kernel/process.c
--- linux-2.5.59/arch/s390x/kernel/process.c	Fri Jan 17 03:22:25 2003
+++ linux-2.5.59-s390/arch/s390x/kernel/process.c	Mon Feb  3 20:50:16 2003
@@ -203,6 +203,19 @@
 	p->thread.ar4 = get_fs().ar4;
         /* Don't copy debug registers */
         memset(&p->thread.per_info,0,sizeof(p->thread.per_info));
+
+	/* Set a new TLS ?  */
+	if (clone_flags & CLONE_SETTLS) {
+		if (current->thread.flags & S390_FLAG_31BIT) {
+			frame->childregs.acrs[0] =
+				(unsigned int) regs->gprs[6];
+		} else {
+			frame->childregs.acrs[0] =
+				(unsigned int)(regs->gprs[6] >> 32);
+			frame->childregs.acrs[1] =
+				(unsigned int) regs->gprs[6];
+		}
+	}
         return 0;
 }
 
@@ -319,7 +332,7 @@
         int count = 0;
         if (!p || p == current || p->state == TASK_RUNNING)
                 return 0;
-        stack_page = (unsigned long) p;
+	stack_page = (unsigned long) p->thread_info;
         r15 = p->thread.ksp;
         if (!stack_page || r15 < stack_page || r15 >= 16380+stack_page)
                 return 0;


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-02-03 19:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-03 14:50 [PATCH] s390 fixes (11/12) Martin Schwidefsky
2003-02-03 19:48 Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®