patch-2.1.121 linux/arch/alpha/kernel/process.c

Next file: linux/arch/alpha/kernel/proto.h
Previous file: linux/arch/alpha/kernel/osf_sys.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.120/linux/arch/alpha/kernel/process.c linux/arch/alpha/kernel/process.c
@@ -75,58 +75,34 @@
 	return 0;
 }
 
-#ifdef __SMP__
-/* This is being executed in task 0 'user space'. */
-#define resched_needed() 1
-int
-cpu_idle(void *unused)
+static void __attribute__((noreturn))
+do_cpu_idle(void)
 {
-	extern volatile int smp_commenced;
-
-	current->priority = -100;
+	/* An endless idle loop with no priority at all.  */
+	current->priority = 0;
 	while (1) {
+		check_pgt_cache();
 		run_task_queue(&tq_scheduler);
-		/* endless idle loop with no priority at all */
-		current->counter = -100;
-		if (!smp_commenced || resched_needed()) {
-			schedule();
-		}
+		current->counter = 0;
+		schedule();
 	}
 }
 
-asmlinkage int
-sys_idle(void)
+#ifdef __SMP__
+void
+cpu_idle(void *unused)
 {
-        if(current->pid != 0)
-                return -EPERM;
-
-        cpu_idle(NULL);
-        return 0;
+	do_cpu_idle();
 }
-
-#else /* __SMP__ */
+#endif
 
 asmlinkage int
 sys_idle(void)
 {
-	int ret = -EPERM;
-
-	lock_kernel();
-	if (current->pid != 0)
-		goto out;
-
-	/* endless idle loop with no priority at all */
-	current->counter = -100;
-	for (;;) {
-		check_pgt_cache();
-		schedule();
-	}
-	ret = 0;
-out:
-	unlock_kernel();
-	return ret;
+	if (current->pid == 0)
+        	do_cpu_idle();
+	return -EPERM;
 }
-#endif /* __SMP__ */
 
 void
 generic_kill_arch (int mode, char *restart_cmd)
@@ -154,7 +130,7 @@
 				cpup->ipc_buffer[0] = 0;
 			} else {
 				flags |=  0x00030000UL; /* "warm bootstrap" */
-				strncpy(cpup->ipc_buffer, restart_cmd,
+				strncpy((char *)cpup->ipc_buffer, restart_cmd,
 					sizeof(cpup->ipc_buffer));
 			}
 		}

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