On Thu, 14 Dec 2023, Anders Magnusson wrote:
As for the high frequency clock in the VAX, I'm not sure it is used at all
by NetBSD. But it's been quite a while since I was digging around, and if
someone knows it is being used, I'd be happy to hear. But I think we have
several problems that should be sorted. And for me, the first one would be
to understand how on earth we can be spending so much time in system mode
when we do anything.
I'm quite sure that all VAXen that have a hires clock uses it in time
difference calculations.
There are two of them; the ICR version and the clock chip version. See clock.c
for more info.
Thanks for the pointer. Hmm, indeed we have this:
#if VAX46 || VAXANY
static struct timecounter vax_diag_tc = {
.tc_get_timecount = vax_diag_get_counter,
.tc_counter_mask = ~0u,
.tc_frequency = 1000000,
.tc_name = "diagtimer",
.tc_quality = 100,
};
#endif
but the frequency recorded in this structure does not correspond to one in
hardware, which is 2^26/68.26s => 983136Hz, according to the KA46 spec. I
need to rebuild the kernel anyway as sadly GENERIC doesn't have the TC-USB
option enabled, so I'll see if fixing the frequency changes things anyhow.