From b0f865c1f3c699f9a91e761ba2d84991da5d2aab Mon Sep 17 00:00:00 2001 From: Marcel Moolenaar Date: Fri, 17 Oct 2003 02:24:59 +0000 Subject: [PATCH] Implement cpu_idle() on ia64. We put the processor in a lightweight halt state that minimizes power consumption while still preserving cache and TLB coherency. Halting the processor is not conditional at this time. Tested with UP and SMP kernels. --- sys/ia64/ia64/machdep.c | 10 +++++++++- sys/kern/kern_idle.c | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index 765f85f7021a..c53367193d76 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -272,12 +272,20 @@ cpu_boot(int howto) } void -cpu_halt(void) +cpu_halt() { ia64_efi_runtime->ResetSystem(EfiResetWarm, EFI_SUCCESS, 0, 0); } +void +cpu_idle() +{ + struct ia64_pal_result res; + + res = ia64_call_pal_static(PAL_HALT_LIGHT, 0, 0, 0); +} + void cpu_reset() { diff --git a/sys/kern/kern_idle.c b/sys/kern/kern_idle.c index b4d43af0f042..10219653d189 100644 --- a/sys/kern/kern_idle.c +++ b/sys/kern/kern_idle.c @@ -112,7 +112,7 @@ idle_proc(void *dummy) " for a process"); #endif -#ifdef __i386__ +#if defined(__i386__) || defined(__ia64__) cpu_idle(); #endif }