summaryrefslogtreecommitdiffstats
path: root/sys/pc98
diff options
context:
space:
mode:
authorroyger <royger@FreeBSD.org>2014-03-11 10:20:42 +0000
committerroyger <royger@FreeBSD.org>2014-03-11 10:20:42 +0000
commit467e743960e4cc864b1c9be42fb2be7852f0ebb0 (patch)
treea6c082deb8c080bacb519b882baaa752822f1a89 /sys/pc98
parent064afe26b0b317ff63aad248bbe3d26fd11f91b8 (diff)
downloadFreeBSD-src-467e743960e4cc864b1c9be42fb2be7852f0ebb0.zip
FreeBSD-src-467e743960e4cc864b1c9be42fb2be7852f0ebb0.tar.gz
xen: implement an early timer for Xen PVH
When running as a PVH guest, there's no emulated i8254, so we need to use the Xen PV timer as the early source for DELAY. This change allows for different implementations of the early DELAY function and implements a Xen variant for it. Approved by: gibbs Sponsored by: Citrix Systems R&D dev/xen/timer/timer.c: dev/xen/timer/timer.h: - Implement Xen early delay functions using the PV timer and declare them. x86/include/init.h: - Add hooks for early clock source initialization and early delay functions. i386/i386/machdep.c: pc98/pc98/machdep.c: amd64/amd64/machdep.c: - Set early delay hooks to use the i8254 on bare metal. - Use clock_init (that will in turn make use of init_ops) to initialize the early clock source. amd64/include/clock.h: i386/include/clock.h: - Declare i8254_delay and clock_init. i386/xen/clock.c: - Rename DELAY to i8254_delay. x86/isa/clock.c: - Introduce clock_init that will take care of initializing the early clock by making use of the init_ops hooks. - Move non ISA related delay functions to the newly introduced delay file. x86/x86/delay.c: - Add moved delay related functions. - Implement generic DELAY function that will use the init_ops hooks. x86/xen/pv.c: - Set PVH hooks for the early delay related functions in init_ops. conf/files.amd64: conf/files.i386: conf/files.pc98: - Add delay.c to the kernel build.
Diffstat (limited to 'sys/pc98')
-rw-r--r--sys/pc98/pc98/machdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index b6cdcdc..ab978de 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -129,6 +129,7 @@ __FBSDID("$FreeBSD$");
#include <machine/sigframe.h>
#include <machine/specialreg.h>
#include <machine/vm86.h>
+#include <x86/init.h>
#ifdef PERFMON
#include <machine/perfmon.h>
#endif
@@ -220,6 +221,12 @@ struct mtx icu_lock;
struct mem_range_softc mem_range_softc;
+ /* Default init_ops implementation. */
+ struct init_ops init_ops = {
+ .early_clock_source_init = i8254_init,
+ .early_delay = i8254_delay,
+ };
+
static void
cpu_startup(dummy)
void *dummy;
@@ -2267,7 +2274,7 @@ init386(first)
* Initialize the i8254 before the console so that console
* initialization can use DELAY().
*/
- i8254_init();
+ clock_init();
/*
* Initialize the console before we print anything out.
OpenPOWER on IntegriCloud