Gregory Nutt
e238c8b090
sched/clock/clock_systimer.c: Change the way that the 64-bit time is sampled. Previously, we disabled interrupts before sampling the 64-bit timer since the uint64_t access is not atomic on most CPUs. However, disabling (local) interrupts does not work in the SMP case. In that case, the timer interrupt will be running on only one of the CPUs; disabling interrupts on a different CPU will provide no protection from timer rollover. To work around this, logic was added that samples 64-bit timer is sampled twice and if 32-bit rollover was detected between samples, then loops until there is no rollover.
2018-01-15 11:05:45 -06:00
Masayuki Ishikawa
0ecef4dbcb
clock_systimer: Replace critical section APIs with spinlock APIs. (64bit only)
...
If SMP=n or SMP=y && SPINLOCK_IRQ=n, this works in the same way as before.
If SMP=y && SPINLOCK_IRQ=y, performance will be improved.
Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2018-01-15 15:08:11 +09:00
Rajan Gill
0d8e191d69
sched/clock: Correct calculation for the case of Tickless mode with a 32-bit timer. In that case, the calculation was returning millisecond accuracy. That is not good when the timer accuracy is < 1 msec.
2016-11-19 09:55:21 -06:00
Gregory Nutt
246773faa7
Rename CONFIG_SCHED_TIMEKEEPING to CONFIG_CLOCK_TIMEKEEPING. That is a better compartmentalized name.
2016-07-11 06:54:02 -06:00
Max Neklyudov
8db29071da
timekeeping: initial implementation
2016-07-10 16:14:25 -06:00
Gregory Nutt
6e3107650d
nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section()
2016-02-14 08:17:46 -06:00
Gregory Nutt
84d4cb007b
clock_systimer: 64-bit timer accesses are not atomic. Noted by Freddie Chopin.
2016-01-22 12:24:36 -06:00
Gregory Nutt
032ad1b70b
Remove clock_systimer32 and clock_systimer64. There is now only clock_systimer
2016-01-21 16:49:24 -06:00
Gregory Nutt
a4f5254cbe
Fix a typo introduced into the last commit
2016-01-21 13:48:35 -06:00
Gregory Nutt
f348e68069
Update to use 64-bit timer when available
2016-01-21 11:54:26 -06:00
Gregory Nutt
d9f960e97b
Fix a problem in clock_systimer64 that occurs when (1) the 64-bit system time is enabled, and (2) the value of CONFIG_USEC_PER_TICK is less than 1 millisconds (such as when using the tickless mode of operation). In that case, the convertion of time to 64-bit millisecond value in clock_systmer64() causes some bad times to be returned. Time was converted to milliseconds, then to configured ticks. Precision was lost in the millisecond convertion.
...
The fix is to first convert time to a 64-bit microsecond value, then to the configured tick value.
Noted by David Sidrane.
2015-02-13 06:13:47 -06:00
Gregory Nutt
da29907ac9
Update TODO list + cosmetic changes to clock_systimer.c
2014-10-03 11:21:35 -06:00
Gregory Nutt
8d43a6bdcd
Fix build error with CONFIG_SYSTEM_TIME64
2014-10-03 10:20:46 -06:00
Gregory Nutt
2029236ed0
Back out and replace recent kludges for errno and clock_systimer. There is a cleaner way
2014-08-30 14:26:56 -06:00
Gregory Nutt
d4b56eb3cc
Move clock functions from sched/ to sched/clock
2014-08-08 14:43:02 -06:00