1. 16 Feb, 2009 2 commits
    • Patrick Ohly's avatar
      timecompare: generic infrastructure to map between two time bases · a75244c3
      Patrick Ohly authored
      Mapping from a struct timecounter to a time returned by functions like
      ktime_get_real() is implemented. This is sufficient to use this code
      in a network device driver which wants to support hardware time
      stamping and transformation of hardware time stamps to system time.
      
      The interface could have been made more versatile by not depending on
      a time counter, but this wasn't done to avoid writing glue code
      elsewhere.
      
      The method implemented here is the one used and analyzed under the name
      "assisted PTP" in the LCI PTP paper:
      http://www.linuxclustersinstitute.org/conferences/archive/2008/PDF/Ohly_92221.pdfAcked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a75244c3
    • Patrick Ohly's avatar
      clocksource: allow usage independent of timekeeping.c · a038a353
      Patrick Ohly authored
      So far struct clocksource acted as the interface between time/timekeeping.c
      and hardware. This patch generalizes the concept so that a similar
      interface can also be used in other contexts. For that it introduces
      new structures and related functions *without* touching the existing
      struct clocksource.
      
      The reasons for adding these new structures to clocksource.[ch] are
      * the APIs are clearly related
      * struct clocksource could be cleaned up to use the new structs
      * avoids proliferation of files with similar names (timesource.h?
        timecounter.h?)
      
      As outlined in the discussion with John Stultz, this patch adds
      * struct cyclecounter: stateless API to hardware which counts clock cycles
      * struct timecounter: stateful utility code built on a cyclecounter which
        provides a nanosecond counter
      * only the function to read the nanosecond counter; deltas are used internally
        and not exposed to users of timecounter
      
      The code does no locking of the shared state. It must be called at least
      as often as the cycle counter wraps around to detect these wrap arounds.
      Both is the responsibility of the timecounter user.
      Acked-by: default avatarJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: default avatarPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a038a353
  2. 15 Feb, 2009 6 commits
  3. 13 Feb, 2009 32 commits