patch-2.1.17 linux/include/asm-m68k/processor.h

Next file: linux/include/asm-m68k/serial.h
Previous file: linux/include/asm-m68k/pgtable.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.16/linux/include/asm-m68k/processor.h linux/include/asm-m68k/processor.h
@@ -61,7 +61,9 @@
 	unsigned long nilstate = 0;
 
 	/* clear floating point state */
-	__asm__ __volatile__ ("frestore %0@" : : "a" (&nilstate));
+	__asm__ __volatile__ (".chip 68k/68881\n\t"
+			      "frestore %0@\n\t"
+			      ".chip 68k" : : "a" (&nilstate));
 
 	/* reads from user space */
 	set_fs(USER_DS);
@@ -76,7 +78,15 @@
  */
 extern inline unsigned long thread_saved_pc(struct thread_struct *t)
 {
-	return ((unsigned long *)((struct switch_stack *)t->ksp)->a6)[1];
+	extern int sys_pause(void);
+	extern void schedule(void);
+	struct switch_stack *sw = (struct switch_stack *)t->ksp;
+	/* Check whether the thread is blocked in resume() */
+	if (sw->retpc >= (unsigned long)schedule &&
+	    sw->retpc < (unsigned long)sys_pause)
+		return ((unsigned long *)sw->a6)[1];
+	else
+		return sw->retpc;
 }
 
 #endif

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov