[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Climate changes vs. power consumption vs. GNU Mach
From: |
Thomas Schwinge |
Subject: |
Climate changes vs. power consumption vs. GNU Mach |
Date: |
Sat, 5 May 2007 14:14:31 +0200 |
User-agent: |
Mutt/1.5.11 |
Hello!
`machine_idle' is available in `i386/i386at/model_dep.c' and is currently
used for the idle thread.
#v+
/* Conserve power on processor CPU. */
void machine_idle (int cpu)
{
assert (cpu == cpu_number ());
asm volatile ("hlt" : : : "memory");
}
#v-
What about installing the following to avoid those power-consuming
``while (TRUE);'' loops?
#v+
Index: i386/i386at/model_dep.c
===================================================================
RCS file: /cvsroot/hurd/gnumach/i386/i386at/Attic/model_dep.c,v
retrieving revision 1.9.2.12
diff -u -p -r1.9.2.12 model_dep.c
--- i386/i386at/model_dep.c 5 Feb 2007 21:09:36 -0000 1.9.2.12
+++ i386/i386at/model_dep.c 5 May 2007 11:59:46 -0000
@@ -159,7 +157,8 @@ void machine_idle (int cpu)
void halt_cpu(void)
{
asm volatile("cli");
- while(1);
+ while (TRUE)
+ machine_idle (cpu_number ());
}
/*
@@ -172,8 +171,8 @@ void halt_all_cpus(reboot)
printf("In tight loop: hit ctl-alt-del to reboot\n");
(void) spl0();
}
- for (;;)
- continue;
+ while (TRUE)
+ machine_idle (cpu_number ());
}
void exit(int rc)
#v-
Regards,
Thomas
signature.asc
Description: Digital signature
- Climate changes vs. power consumption vs. GNU Mach,
Thomas Schwinge <=