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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd

Reply via email to