Skip to contentSkip to conversation

RTC subsystem and fractions of seconds

DISCUSSION Philippe De Muyter 1 participant 1 message Jan 6, 2007

lore
Share & tools
lore
#0 lore raw

Hi all,

A comment in driver/rtc/hctosys says :

/* IMPORTANT: the RTC only stores whole seconds. It is arbitrary
* whether it stores the most close value or the value with partial
* seconds truncated. However, it is important that we use it to store
* the truncated value. This is because otherwise it is necessary,
* in an rtc sync function, to read both xtime.tv_sec and
* xtime.tv_nsec. On some processors (i.e. ARM), an atomic read
* of >32bits is not possible. So storing the most close value would
* slow down the sync API. So here we have the truncated value and
* the best guess is to add 0.5s.
*/

I work with ST m41t81 rtc's. Those rtc's actually have a 1/100th of second register. Should the generic rtc interface not support that ?

Philippe