From 0ecef4dbcbcfacc96a1a0a8e7b5244be31d17491 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Mon, 15 Jan 2018 13:04:32 +0900 Subject: [PATCH] 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 --- sched/clock/clock_systimer.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sched/clock/clock_systimer.c b/sched/clock/clock_systimer.c index 1b134510922..288bcf66e7c 100644 --- a/sched/clock/clock_systimer.c +++ b/sched/clock/clock_systimer.c @@ -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 */