]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
pvclock: Add 'struct pvclock' API
authorAdam Fenn <adam@fenn.io>
Sat, 7 Aug 2021 20:01:46 +0000 (13:01 -0700)
committerKonstantin Belousov <kib@FreeBSD.org>
Sat, 14 Aug 2021 12:57:54 +0000 (15:57 +0300)
commit0b3382b863f3195d88b99f94d5af7fe4a7b9726a
tree181d031d6709c06313a7d8c69c3751ea18f2424d
parent346f5a0c483b7c159efd7c8faf4a18f3e3f77158
pvclock: Add 'struct pvclock' API

Consolidate more hypervisor-agnostic functionality behind a new 'struct
pvclock' API.

This should also make it easier to subsequently add hypervisor-agnostic
vDSO timekeeping support.

Also, perform some clean-up:
    - Remove 'pvclock_get_last_cycles()'; do not allow external access
      to 'pvclock_last_systime' since this is not necessary.
    - Consolidate/simplify wall and system time reading codepaths.
    - Ensure correct ordering within wall and system time reading
      codepaths via 'atomic(9)' and 'rdtsc_ordered()' rather than via
      'rmb()'.
    - Remove some extra newlines.

Sponsored by: Juniper Networks, Inc.
Sponsored by: Klara, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D31418
sys/x86/include/pvclock.h
sys/x86/x86/pvclock.c