[haiku-appserver] Re: CPU-idle-loop and HALT instruction?

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Mon, 12 Dec 2005 23:11:18 +0100

On 2005-12-12 at 21:47:51 [+0100], Rudolf <drivers.be-hold@xxxxxxxxxxxx> 
wrote:
> 
> Maybe (I guess) this question is off-topic here:
> 
> But can someone include HALT for the CPU-idle loop? My system overheats
> on Haiku... I can only run it for a few minutes over here because of
> that, and I really appreciate the low noise blower-setup I have
> currently.
> 
> Or, is it already in there and can I somehow enable it?


From src/system/kernel/arch/x86/arch_cpu.c:

void
arch_cpu_idle(void)
{
        switch (smp_get_num_cpus()) {
                case 0:
                        panic("You need at least 1 CPU to run Haiku\n");
                case 1:
                        asm("hlt");
                default:
                        break;
        }
}

So, if you have more than one CPU, the only thing you can do is change this 
code. There might be a reason, why it is implemented like it is, though. On 
the other hand there's also no comment that you computer will explode when 
executing "hlt" on a multi CPU machine either...

CU, Ingo

Other related posts: