1. 16 2月, 2009 2 次提交
    • P
      timecompare: generic infrastructure to map between two time bases · a75244c3
      Patrick Ohly 提交于
      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: NJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: NPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a75244c3
    • P
      clocksource: allow usage independent of timekeeping.c · a038a353
      Patrick Ohly 提交于
      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: NJohn Stultz <johnstul@us.ibm.com>
      Signed-off-by: NPatrick Ohly <patrick.ohly@intel.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a038a353
  2. 15 2月, 2009 6 次提交
  3. 14 2月, 2009 32 次提交