From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MmpXV-0000bK-G1 for qemu-devel@nongnu.org; Sun, 13 Sep 2009 09:54:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MmpXQ-0000YT-VC for qemu-devel@nongnu.org; Sun, 13 Sep 2009 09:54:49 -0400 Received: from [199.232.76.173] (port=51189 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MmpXQ-0000YP-Ru for qemu-devel@nongnu.org; Sun, 13 Sep 2009 09:54:44 -0400 Received: from nan.false.org ([208.75.86.248]:57201) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MmpXQ-0000fs-FY for qemu-devel@nongnu.org; Sun, 13 Sep 2009 09:54:44 -0400 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id E295910E8A for ; Sun, 13 Sep 2009 13:54:42 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id AFC4E1072B for ; Sun, 13 Sep 2009 13:54:42 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1MmpXN-0006RD-I2 for qemu-devel@nongnu.org; Sun, 13 Sep 2009 09:54:41 -0400 Date: Sun, 13 Sep 2009 09:54:41 -0400 From: Daniel Jacobowitz Message-ID: <20090913135441.GA24216@caradoc.them.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: [Qemu-devel] [PATCH] Fix Linux task preemption on Versatile board List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Recent versions of the Linux kernel will not preempt CPU-intensive tasks unless the clock used by sched_clock() works. On -M versatilepb that's the 24MHz timer in the system controller. It's a very simple timer, so implement it. Signed-off-by: Daniel Jacobowitz --- hw/arm_sysctl.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c index 686c1cc..26300ef 100644 --- a/hw/arm_sysctl.c +++ b/hw/arm_sysctl.c @@ -7,6 +7,8 @@ * This code is licenced under the GPL. */ +#include "hw.h" +#include "qemu-timer.h" #include "sysbus.h" #include "primecell.h" #include "sysemu.h" @@ -71,8 +73,7 @@ static uint32_t arm_sysctl_read(void *opaque, target_phys_addr_t offset) case 0x58: /* BOOTCS */ return 0; case 0x5c: /* 24MHz */ - /* ??? not implemented. */ - return 0; + return muldiv64(qemu_get_clock(vm_clock), 24000000, get_ticks_per_sec()); case 0x60: /* MISC */ return 0; case 0x84: /* PROCID0 */ -- Daniel Jacobowitz CodeSourcery