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>
This commit is contained in:
parent
57b6dec74d
commit
0ecef4dbcb
@ -120,9 +120,9 @@ systime_t clock_systimer(void)
|
||||
|
||||
/* 64-bit accesses are not atomic on most architectures. */
|
||||
|
||||
flags = enter_critical_section();
|
||||
flags = spin_lock_irqsave();
|
||||
sample = g_system_timer;
|
||||
leave_critical_section(flags);
|
||||
spin_unlock_irqrestore(flags);
|
||||
return sample;
|
||||
|
||||
# else /* CONFIG_SYSTEM_TIME64 */
|
||||
|
Loading…
Reference in New Issue
Block a user