summaryrefslogtreecommitdiffstats
path: root/arch/alpha/kernel/process.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-17 13:25:08 +0000
commit59223edaa18759982db0a8aced0e77457d10c68e (patch)
tree89354903b01fa0a447bffeefe00df3044495db2e /arch/alpha/kernel/process.c
parentdb7d4daea91e105e3859cf461d7e53b9b77454b2 (diff)
Merge with Linux 2.3.6. Sorry, this isn't tested on silicon, I don't
have a MIPS box at hand.
Diffstat (limited to 'arch/alpha/kernel/process.c')
-rw-r--r--arch/alpha/kernel/process.c49
1 files changed, 31 insertions, 18 deletions
diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
index 93d8db602..1993ed3b4 100644
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -58,10 +58,10 @@ static struct fs_struct init_fs = INIT_FS;
static struct file * init_fd_array[NR_OPEN] = { NULL, };
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS;
-struct mm_struct init_mm = INIT_MM;
+struct mm_struct init_mm = INIT_MM(init_mm);
union task_union init_task_union __attribute__((section("init_task")))
- = { task: INIT_TASK };
+ = { task: INIT_TASK(init_task_union.task) };
/*
* No need to acquire the kernel lock, we're entirely local..
@@ -75,33 +75,46 @@ sys_sethae(unsigned long hae, unsigned long a1, unsigned long a2,
return 0;
}
-static void __attribute__((noreturn))
-do_cpu_idle(void)
+#ifdef __SMP__
+void
+cpu_idle(void *unused)
{
/* An endless idle loop with no priority at all. */
current->priority = 0;
+ current->counter = -100;
+
while (1) {
- check_pgt_cache();
- run_task_queue(&tq_scheduler);
- current->counter = 0;
- schedule();
+ /* FIXME -- EV6 and LCA45 know how to power down
+ the CPU. */
+
+ /* Although we are an idle CPU, we do not want to
+ get into the scheduler unnecessarily. */
+ if (current->need_resched) {
+ schedule();
+ check_pgt_cache();
+ }
}
}
-
-#ifdef __SMP__
-void
-cpu_idle(void *unused)
-{
- do_cpu_idle();
-}
#endif
asmlinkage int
sys_idle(void)
{
- if (current->pid == 0)
- do_cpu_idle();
- return -EPERM;
+ if (current->pid != 0)
+ return -EPERM;
+
+ /* An endless idle loop with no priority at all. */
+ current->priority = 0;
+ current->counter = -100;
+ init_idle();
+
+ while (1) {
+ /* FIXME -- EV6 and LCA45 know how to power down
+ the CPU. */
+
+ schedule();
+ check_pgt_cache();
+ }
}
void