aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jarno <aurelien@aurel32.net>2009-09-15 00:30:41 +0200
committerAurelien Jarno <aurelien@aurel32.net>2009-09-15 00:30:41 +0200
commitbdebf0094c7e147daac27236b5388910e9deb6a4 (patch)
tree4b85f3ac114e5d693c84a17af6b7427f75172503
parent530942382809bfda7aa19d5f9007a6e31f0594e0 (diff)
downloadqemu-bdebf0094c7e147daac27236b5388910e9deb6a4.zip
qemu-bdebf0094c7e147daac27236b5388910e9deb6a4.tar.gz
qemu-bdebf0094c7e147daac27236b5388910e9deb6a4.tar.bz2
Fix Linux task preemption on Versatile board
Backport from master: 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 <dan@codesourcery.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
-rw-r--r--hw/arm_sysctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/hw/arm_sysctl.c b/hw/arm_sysctl.c
index bb005c8..cf5d46e 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, ticks_per_sec);
case 0x60: /* MISC */
return 0;
case 0x84: /* PROCID0 */