[U-Boot] [RFC] Review of U-Boot timer API

Wolfgang Denk
2011-05-25T19:56:37Z

Dear "J. William Campbell",

In message <4DDD3354.8030801@comcast.net> you wrote:
>
> >> A tick is defined as the smallest increment of system time as measured by a
> >> computer system (seehttp://en.wikipedia.org/wiki/System_time):
> >>
> >> System time is measured by a system clock, which is typically
> >> implemented as a simple count of the number of ticks that have
> >> transpired since some arbitrary starting date, called the
> >> epoch.
> >>
> >> Unfortunately, this definition is obsolete, and has been for quite some
> > Do you have any proof for such a claim?
> Hi Wolfgang,
> Well, yes, in fact the same reference you used. Note that the
> statement "A tick is defined as the smallest increment of system time as
> measured by a computer system" is NOT found in
> http://en.wikipedia.org/wiki/System_time. That page is defining system

I derived this from
http://en.wikipedia.org/wiki/Tick_%28disambiguation%29: "Tick, the
smallest increment of system time as measured by a computer system"

> the current time to the nearest millisecond". Here 100 nanosecond ticks
> clearly does not refer to any "hardware" 100 ns clock that exists on the

Above definition nowhere requres that the tick must be a "hardware"
clock.

> pc. The 100 ns is a computed (dare I say virtual) "tick" value. The
> point here is that the definition of tick is yours, not wikipedia.org's.

Not quite.

But while I do now want to claim authorship for words I just copied &
pasted, I think the definition is still a good one. Let's say it's
the definition I want to see used to this discussion here :-)

> <http://en.wikipedia.org/wiki/Interrupt>.". If a tick is the smallest
> increment of system time as measured by the computer system, the "of the
> system timer interrupt" part of the statement would be unnecessary. The
> fact it IS present indicates there are other kinds of ticks present in
> the universe.

I disagree here.

> AFAIK, all timers "tick", and the definition of the tick rate is
> 1/timer resolution. The concept of "timer ticks" and "clock ticks" has
> been around forever, and exists independent of System Time. For example,
> there may be a watchdog timer on a system that does not measure time at
> all, yet the watchdog still ticks. When you read a value from a timer
> that was not the "system timer", what do you call the value you read? I
> would call it ticks, and I bet just about everybody else would too.

I have no reason to argument about this.

But we don't care about any timers that may be present or even in use
for one pourpose or anothe rin the system.

All we care about her ein this discussion is a single time, and a
single timer, and a single tick: the one that represents the system
time.

> The only reason I feel this point matters at all is that when one
> refers to a routine called "get_ticks", it is not obvious to me which
> timer ticks are being referenced. You are saying that, by definition, it
> refers to the "system clock". My feeling is that it is not obvious why
> that is so on a system that has many clocks. The name of the function or
> an argument to the function should, IMNSHO, specify which timer ticks
> are being returned.

THe reason is simply that it is the only clock that is being used
anywhere in U-Boot. We have a only one system time, or clock.

Best regards,

Wolfgang Denk

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I mean, I . . . think to understand you, I just don't know what you
are saying ... - Terry Pratchett, _Soul Music_