patch-2.1.115 linux/arch/sparc/kernel/process.c

Next file: linux/arch/sparc/kernel/rtrap.S
Previous file: linux/arch/sparc/kernel/irq.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.114/linux/arch/sparc/kernel/process.c linux/arch/sparc/kernel/process.c
@@ -1,4 +1,4 @@
-/*  $Id: process.c,v 1.110 1998/04/08 16:15:51 jj Exp $
+/*  $Id: process.c,v 1.118 1998/08/04 20:48:47 davem Exp $
  *  linux/arch/sparc/kernel/process.c
  *
  *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
@@ -26,6 +26,7 @@
 #include <linux/smp.h>
 #include <linux/smp_lock.h>
 #include <linux/reboot.h>
+#include <linux/delay.h>
 
 #include <asm/auxio.h>
 #include <asm/oplib.h>
@@ -40,8 +41,8 @@
 #include <asm/elf.h>
 
 extern void fpsave(unsigned long *, unsigned long *, void *, unsigned long *);
-extern void srmmu_check_pgt_cache(void);
 
+struct task_struct *last_task_used_math = NULL;
 struct task_struct *current_set[NR_CPUS] = {&init_task, };
 
 #ifndef __SMP__
@@ -92,9 +93,8 @@
 				}
 			}
 			restore_flags(flags);
-			check_pgt_cache();
-		} else
-			srmmu_check_pgt_cache();
+		}
+		check_pgt_cache();
 		schedule();
 	}
 	ret = 0;
@@ -113,18 +113,10 @@
 	current->priority = -100;
 	while(1) {
 		srmmu_check_pgt_cache();
-		/*
-		 * tq_scheduler currently assumes we're running in a process
-		 * context (ie that we hold the kernel lock..)
-		 */
-		if (tq_scheduler) {
-			lock_kernel();
-			run_task_queue(&tq_scheduler);
-			unlock_kernel();
-		}
+		run_task_queue(&tq_scheduler);
 		/* endless idle loop with no priority at all */
 		current->counter = -100;
-		if(!smp_commenced || need_resched)
+		if(!smp_commenced || current->need_resched)
 			schedule();
 	}
 }
@@ -143,7 +135,7 @@
 extern char reboot_command [];
 
 #ifdef CONFIG_SUN_CONSOLE
-extern void console_restore_palette (void);
+extern void (*prom_palette)(int);
 extern int serial_console;
 #endif
 
@@ -153,8 +145,8 @@
 	mdelay(8);
 	cli();
 #ifdef CONFIG_SUN_CONSOLE
-	if (!serial_console)
-		console_restore_palette ();
+	if (!serial_console && prom_palette)
+		prom_palette (1);
 #endif
 	prom_halt();
 	panic("Halt failed!");
@@ -171,8 +163,8 @@
 	p = strchr (reboot_command, '\n');
 	if (p) *p = 0;
 #ifdef CONFIG_SUN_CONSOLE
-	if (!serial_console)
-		console_restore_palette ();
+	if (!serial_console && prom_palette)
+		prom_palette (1);
 #endif
 	if (cmd)
 		prom_reboot(cmd);
@@ -332,9 +324,6 @@
 	printk("fsr:               0x%08lx  fpqdepth:          0x%08lx\n", tss->fsr, tss->fpqdepth);
 	/* XXX missing: fpqueue */
 
-	printk("sstk_info.stack:   0x%08lx  sstk_info.status:  0x%08lx\n", 
-								(unsigned long)tss->sstk_info.the_stack,
-							        (unsigned long)tss->sstk_info.cur_status);
 	printk("flags:             0x%08lx  current_ds:        0x%08lx\n", tss->flags, tss->current_ds.seg);
 	
 	show_regwindow((struct reg_window *)tss->ksp);
@@ -368,8 +357,6 @@
 void flush_thread(void)
 {
 	current->tss.w_saved = 0;
-	current->tss.sstk_info.cur_status = 0;
-	current->tss.sstk_info.the_stack = 0;
 
 	/* No new signal delivery by default */
 	current->tss.new_signal = 0;
@@ -539,7 +526,7 @@
 			 * This is a clone() call with supplied user stack.
 			 * Set some valid stack frames to give to the child.
 			 */
-			childstack = (struct sparc_stackf *) sp;
+			childstack = (struct sparc_stackf *) (sp & ~0x7UL);
 			parentstack = (struct sparc_stackf *) regs->u_regs[UREG_FP];
 
 #if 0

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