summaryrefslogtreecommitdiff
path: root/sys/arch/alpha/include
diff options
context:
space:
mode:
authorthorpej <thorpej@NetBSD.org>2020-09-29 01:33:00 +0000
committerthorpej <thorpej@NetBSD.org>2020-09-29 01:33:00 +0000
commit1d2fa3820cf52bcdacbe74abc426eabf9f2dbd32 (patch)
tree9ed55a9aa536e12f2519862de95f2ca8a2759c74 /sys/arch/alpha/include
parent668c6a0e5f47ba4fd6c6f9b1855c5e2c5c18a668 (diff)
Improve time keeping and host CPU usage when running in Qemu:
- clockattach(): Allow multiple calls when running in Qemu. Anything after this first one is ignored, but this gives us a change to use a clock source provided by the VM directly, rather than relying on a more expensive hardware emulation. - Add cpu_initclocks_secondary(), to handle clock setup on secondary CPUs, if needed. - Allow us to use the WTINT PALcode call in cpu_idle() to idle in a lower power state (Qemu's PALcode supports this). - Use the Qemu per-cpu set-alarm-rel call as the hardclock interrupt source. In Qemu environments, reduce hz to 50 (rather than the default 1024) to give the clock a snowball's chance when running on a host system with hz=100. XXX We have to manually re-calculate tick and tickadj. There should be MI code to do this for us. Also in Qemu environments, let hardclock() drive the sched clock by setting schedhz=0.
Diffstat (limited to 'sys/arch/alpha/include')
-rw-r--r--sys/arch/alpha/include/cpu.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/alpha/include/cpu.h b/sys/arch/alpha/include/cpu.h
index 06acb46f14c..a6a24fa4259 100644
--- a/sys/arch/alpha/include/cpu.h
+++ b/sys/arch/alpha/include/cpu.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.h,v 1.97 2020/09/25 03:40:11 thorpej Exp $ */
+/* $NetBSD: cpu.h,v 1.98 2020/09/29 01:33:00 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -242,7 +242,11 @@ int badaddr(void *, size_t);
void * cpu_uarea_alloc(bool);
bool cpu_uarea_free(void *);
-#define cpu_idle() /* nothing */
+void cpu_idle_wtint(void);
+extern void (*cpu_idle_fn)(void);
+#define cpu_idle() (*cpu_idle_fn)()
+
+void cpu_initclocks_secondary(void);
#endif /* _KERNEL */
#endif /* _ALPHA_CPU_H_ */