nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section()

This commit is contained in:
Gregory Nutt
2016-02-14 08:17:46 -06:00
parent 2244ed46bc
commit 6e3107650d
69 changed files with 368 additions and 819 deletions
+3 -3
View File
@@ -46,7 +46,7 @@
#include <debug.h>
#ifdef CONFIG_RTC
# include <arch/irq.h>
# include <nuttx/irq.h>
#endif
#include <nuttx/arch.h>
@@ -256,9 +256,9 @@ void clock_synchronize(void)
/* Re-initialize the time value to match the RTC */
flags = irqsave();
flags = enter_critical_section();
clock_inittime();
irqrestore(flags);
leave_critical_section(flags);
}
#endif
+3 -3
View File
@@ -45,7 +45,7 @@
#include <debug.h>
#include <nuttx/arch.h>
#include <arch/irq.h>
#include <nuttx/irq.h>
#include "clock/clock.h"
@@ -109,7 +109,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
* possible.
*/
flags = irqsave();
flags = enter_critical_section();
/* Get the elapsed time since power up (in milliseconds). This is a
* bias value that we need to use to correct the base time.
@@ -146,7 +146,7 @@ int clock_settime(clockid_t clock_id, FAR const struct timespec *tp)
up_rtc_settime(tp);
}
#endif
irqrestore(flags);
leave_critical_section(flags);
sdbg("basetime=(%ld,%lu) bias=(%ld,%lu)\n",
(long)g_basetime.tv_sec, (unsigned long)g_basetime.tv_nsec,
+3 -6
View File
@@ -41,6 +41,7 @@
#include <stdint.h>
#include <nuttx/irq.h>
#include <nuttx/arch.h>
#include <nuttx/clock.h>
@@ -53,10 +54,6 @@
#undef clock_systimer
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -115,9 +112,9 @@ systime_t clock_systimer(void)
/* 64-bit accesses are not atomic on most architectures. */
flags = irqsave();
flags = enter_critical_section();
sample = g_system_timer;
irqrestore(flags);
leave_critical_section(flags);
return sample;
# else /* CONFIG_SYSTEM_TIME64 */