diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-01-17 21:21:12 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-01-17 21:21:12 +0100 |
commit | a05bab362f66ddd6fa65f2e7cda9eaaa0217ec08 (patch) | |
tree | ccd2fdef5230d2d5369619e6e7f84b389928ad3d /sys/src/9/pc64 | |
parent | 999e98b9b856ae4fc75b3ad33783488e33cdd426 (diff) |
pc, pc64: add minimal HPET driver to measure LAPIC and TSC frequencies
This adds the new function pointer PCArch.clockinit(),
which is a timer dependent initialization routine.
It also takes over the job of guesscpuhz(). This way, the
architecture ident code can switch between different
timers (i8253, HPET and XEN timer).
Diffstat (limited to 'sys/src/9/pc64')
-rw-r--r-- | sys/src/9/pc64/dat.h | 2 | ||||
-rw-r--r-- | sys/src/9/pc64/fns.h | 1 | ||||
-rw-r--r-- | sys/src/9/pc64/main.c | 3 | ||||
-rw-r--r-- | sys/src/9/pc64/pc64 | 2 | ||||
-rw-r--r-- | sys/src/9/pc64/squidboy.c | 2 |
5 files changed, 7 insertions, 3 deletions
diff --git a/sys/src/9/pc64/dat.h b/sys/src/9/pc64/dat.h index b597f8988..1d581f371 100644 --- a/sys/src/9/pc64/dat.h +++ b/sys/src/9/pc64/dat.h @@ -221,6 +221,7 @@ struct Mach int lastintr; int loopconst; + int aalcycles; int cpumhz; uvlong cyclefreq; /* Frequency of user readable cycle counter */ @@ -278,6 +279,7 @@ struct PCArch void (*introff)(void); void (*intron)(void); + void (*clockinit)(void); void (*clockenable)(void); uvlong (*fastclock)(uvlong*); void (*timerset)(uvlong); diff --git a/sys/src/9/pc64/fns.h b/sys/src/9/pc64/fns.h index 90d831e3a..01a1959d3 100644 --- a/sys/src/9/pc64/fns.h +++ b/sys/src/9/pc64/fns.h @@ -52,7 +52,6 @@ u64int getcr4(void); u64int getxcr0(void); u64int getdr6(void); char* getconf(char*); -void guesscpuhz(int); void halt(void); void mwait(void*); int i8042auxcmd(int); diff --git a/sys/src/9/pc64/main.c b/sys/src/9/pc64/main.c index e68220d5f..17a766137 100644 --- a/sys/src/9/pc64/main.c +++ b/sys/src/9/pc64/main.c @@ -183,10 +183,11 @@ main(void) quotefmtinstall(); screeninit(); print("\nPlan 9\n"); - i8253init(); cpuidentify(); meminit0(); archinit(); + if(arch->clockinit) + arch->clockinit(); meminit(); ramdiskinit(); confinit(); diff --git a/sys/src/9/pc64/pc64 b/sys/src/9/pc64/pc64 index ed3c76e7a..3250e9a45 100644 --- a/sys/src/9/pc64/pc64 +++ b/sys/src/9/pc64/pc64 @@ -94,7 +94,7 @@ link misc pci pcipc archgeneric devkbd i8259 i8253 - archacpi mp apic squidboy ec + archacpi mp apic squidboy ec hpet archmp mp apic squidboy mtrr diff --git a/sys/src/9/pc64/squidboy.c b/sys/src/9/pc64/squidboy.c index dda4f257f..f7882820b 100644 --- a/sys/src/9/pc64/squidboy.c +++ b/sys/src/9/pc64/squidboy.c @@ -16,6 +16,8 @@ squidboy(Apic* apic) machinit(); mmuinit(); cpuidentify(); + if(arch->clockinit) + arch->clockinit(); cpuidprint(); syncclock(); active.machs[m->machno] = 1; |