MCPcopy Create free account
hub / github.com/F-Stack/f-stack / comp_smp_tsc

Function comp_smp_tsc

freebsd/x86/x86/tsc.c:433–453  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431#define N 1000
432
433static void
434comp_smp_tsc(void *arg)
435{
436 uint64_t *tsc;
437 int64_t d1, d2;
438 u_int cpu = PCPU_GET(cpuid);
439 u_int i, j, size;
440
441 size = (mp_maxid + 1) * 3;
442 for (i = 0, tsc = arg; i < N; i++, tsc += size)
443 CPU_FOREACH(j) {
444 if (j == cpu)
445 continue;
446 d1 = tsc[cpu * 3 + 1] - tsc[j * 3];
447 d2 = tsc[cpu * 3 + 2] - tsc[j * 3 + 1];
448 if (d1 <= 0 || d2 <= 0) {
449 smp_tsc = 0;
450 return;
451 }
452 }
453}
454
455static void
456adj_smp_tsc(void *arg)

Callers

nothing calls this directly

Calls 1

CPU_FOREACHFunction · 0.85

Tested by

no test coverage detected