Skip to content
  • Philippe Gerum's avatar
    lib/cobalt: dovetail: use clock_gettime() vcall for reading timestamps · 43cc4443
    Philippe Gerum authored and Jan Kiszka's avatar Jan Kiszka committed
    
    
    Dovetail enables out-of-band access to the vDSO-based clock_gettime()
    vcall from applications. If present, select this method instead of
    relying on the hardware tick counter for CLOCK_MONOTONIC,
    CLOCK_MONOTONIC_RAW, CLOCK_REALTIME and CLOCK_HOST_REALTIME.
    
    At binding time, receiving a null hardware clock frequency from the
    core means that we should obtain timestamps directly from the
    vDSO-based clock_gettime() vcall (see cobalt_use_legacy_tsc()).
    
    In this mode, Cobalt shares the in-band kernel's idea of time for all
    common clocks such as CLOCK_MONOTONIC* and CLOCK_REALTIME. As a
    result, CLOCK_HOST_REALTIME refers to the common CLOCK_REALTIME clock.
    Furthermore, libcobalt's clock_settime(CLOCK_REALTIME) is delegated to
    the underlying *libc, which means the caller may switch to secondary
    mode.
    
    Signed-off-by: default avatarPhilippe Gerum <rpm@xenomai.org>
    43cc4443