From a063d95f4b2a6f94d09ba563f9f89ba9f6ad2c6e Mon Sep 17 00:00:00 2001 From: cheloha Date: Sat, 10 Sep 2022 01:30:14 +0000 Subject: [PATCH] amd64, i386: lapic_initclocks: install i8254 before lapic_startclock() In the future, the clock interrupt code will need a working timecounter to do its job. In lapic_initclocks(), call i8254_inittimecounter_simple() before lapic_startclock(). The i8254 may be be a piece of junk, but one timecounter is better than none. --- sys/arch/amd64/amd64/lapic.c | 5 ++--- sys/arch/i386/i386/lapic.c | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c index 8aa12a13045..3e850b66aab 100644 --- a/sys/arch/amd64/amd64/lapic.c +++ b/sys/arch/amd64/amd64/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.62 2022/08/25 20:43:17 cheloha Exp $ */ +/* $OpenBSD: lapic.c,v 1.63 2022/09/10 01:30:14 cheloha Exp $ */ /* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */ /*- @@ -463,9 +463,8 @@ lapic_startclock(void) void lapic_initclocks(void) { - lapic_startclock(); - i8254_inittimecounter_simple(); + lapic_startclock(); } diff --git a/sys/arch/i386/i386/lapic.c b/sys/arch/i386/i386/lapic.c index 1f18d4c7744..d3f316cb447 100644 --- a/sys/arch/i386/i386/lapic.c +++ b/sys/arch/i386/i386/lapic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lapic.c,v 1.51 2022/09/06 17:26:27 cheloha Exp $ */ +/* $OpenBSD: lapic.c,v 1.52 2022/09/10 01:30:14 cheloha Exp $ */ /* $NetBSD: lapic.c,v 1.1.2.8 2000/02/23 06:10:50 sommerfeld Exp $ */ /*- @@ -298,9 +298,8 @@ lapic_startclock(void) void lapic_initclocks(void) { - lapic_startclock(); - i8254_inittimecounter_simple(); + lapic_startclock(); } extern int gettick(void); /* XXX put in header file */ -- 2.20.1