From 780863007da71287d29bf2ee0867bcf2f1512b89 Mon Sep 17 00:00:00 2001 From: Adrian-Ken Rueegsegger Date: Thu, 2 Jul 2015 12:10:32 +0200 Subject: [PATCH] hw_x86_64: Use PAUSE instruction in wait_for_interrupt Add spin loop hint by means of the PAUSE instruction since wait_for_interrupt is called in a busy loop. This should improve processor performance and reduce power consumption. Note: HLT cannot be used since it is a privileged instruction and the idle thread is executed in userspace. --- repos/base-hw/src/core/include/spec/x86/cpu_support.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/base-hw/src/core/include/spec/x86/cpu_support.h b/repos/base-hw/src/core/include/spec/x86/cpu_support.h index 534e96ac18..ff6a7abda4 100644 --- a/repos/base-hw/src/core/include/spec/x86/cpu_support.h +++ b/repos/base-hw/src/core/include/spec/x86/cpu_support.h @@ -404,7 +404,7 @@ class Genode::Cpu /** * Wait for the next interrupt as cheap as possible */ - static void wait_for_interrupt() { } + static void wait_for_interrupt() { asm volatile ("pause"); } /** * Return wether to retry an undefined user instruction after this call