diff options
author | Mark Johnston <markj@FreeBSD.org> | 2022-03-01 14:39:35 +0000 |
---|---|---|
committer | Mark Johnston <markj@FreeBSD.org> | 2022-03-01 14:39:35 +0000 |
commit | 84369dd52369cbae28970dca20a53d3de1719907 (patch) | |
tree | e3a955d98735dba92e2e173a0969395aca06b0da /sys/i386/i386/machdep.c | |
parent | c3d830cf7c71614d21f57c24039de219e4a90538 (diff) | |
download | src-84369dd52369cbae28970dca20a53d3de1719907.tar.gz src-84369dd52369cbae28970dca20a53d3de1719907.zip |
x86: Probe the TSC frequency earlier
This lets us use the TSC to implement early DELAY, limiting the use of
the sometimes-unreliable 8254 PIT.
PR: 262155
Reviewed by: emaste
Tested by: emaste, mike tancsa <mike@sentex.net>, Stefan Hegnauer <stefan.hegnauer@gmx.ch>
MFC after: 1 month
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D34367
Diffstat (limited to 'sys/i386/i386/machdep.c')
-rw-r--r-- | sys/i386/i386/machdep.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index ee6752861c9e..6913c0691fd4 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -188,6 +188,8 @@ struct kva_md_info kmi; static struct trapframe proc0_tf; struct pcpu __pcpu[MAXCPU]; +static void i386_clock_source_init(void); + struct mtx icu_lock; struct mem_range_softc mem_range_softc; @@ -198,11 +200,18 @@ extern struct sysentvec elf32_freebsd_sysvec; /* Default init_ops implementation. */ struct init_ops init_ops = { - .early_clock_source_init = i8254_init, + .early_clock_source_init = i386_clock_source_init, .early_delay = i8254_delay, }; static void +i386_clock_source_init(void) +{ + i8254_init(); + tsc_init(); +} + +static void cpu_startup(dummy) void *dummy; { |