===================================================================== A sketch on what to consider when implementing the new time framework on new architectures (like ia64, mips64, parisc, sh). ===================================================================== (See http://ftp.kernel.org/pub/linux/daemons/ntp/PPS/PPS-2.4.0-pre3.tar.bz2 for an implementation for i386) * Add new config variables to `config.in' and `defconfig' (CONFIG_NTP, CONFIG_NTP_PPS, CONFIG_NTP_PPS_SERIAL) * use `' instead of `' or `' to access kernel time. * The kernel knows how to convert kernel time to CMOS time, don't mess with time zones yourself * time is kept in nanoseconds. `do_fast_gettimeoffset()' is replaced with `do_exact_nanotime()' that returns nanoseconds passed since occurrence of the last timer interrupt. `do_slow_gettimeoffset()' is replaced with `do_poor_nanotime()' accordingly. * `do_gettimeofday()' and `do_settimeofday()' are implemented in the architecture-independent module, messing with all the status updates. The common code uses the `do_nanotime()' callback to call the architectures' code (allowing code selection during runtime or boot-up). * `set_rtc_mmss()' is called `update_rtc()' now, and it sets the complete date and time (not just minutes). A new `ktime_to_rtc()' converts kernel time to broken down time components suitable to write to CMOS RTC. `mktime()' is also architecture-independent now. The new `rtc_to_ktime()' is used after reading the RTC to get kernel time. * a new `timevar_init()' initializes all the time variables. * `struct timex' has been changed significantly while trying to preserve binary compatibility as far as possible. * time routines are in `kernel/time.c' now, and `xtime', the kernel's representation of time, is protected by `rwlock_t xtime_lock'. A new `rtc_runs_localtime' determines if time-zone corrections have to be made for RTC time updates. A new data type `l_fp', a 64bit quantity, is used for some internal time variables (needed by the NTP clock model). * a new sysctl interface allows controlling of some time variables, most notably the time zone and `rtc_runs_localtime'. While adjusting `time_tick' (the former `tick') is deprecated for NTP applications, it allows fine compensation of systematic clock errors. * When the kernel time is set, the RTC update procedure is triggered. * Old routines are implemented using POSIX-alike `do_clock_gettime()' and `do_clock_settime()'. There's also a `do_clock_getres()' that gives quite realistic (not optimistic) estimates. * `adjtimex()' has been significantly reworked, just as most of the other time-keeping routines. * Updating the RTC is controlled by new variables: `rtc_update_slave', when non-zero, controls after how many seconds the RTC has to be updated. Internally `last_rtc_update' keeps the time of the last update. Upon update the `rtc_update_slave' is cleared on success.