#include "cfg/cfg_timer.h"
#include "cfg/cfg_wdt.h"
-#include "cfg/cfg_kern.h"
+#include "cfg/cfg_proc.h"
+#include "cfg/cfg_signal.h"
#include <cfg/os.h>
#include <cfg/debug.h>
#include <cfg/module.h>
#include <cpu/attr.h>
#include <cpu/types.h>
#include <cpu/irq.h>
+#include <cpu/power.h> // cpu_relax()
/*
* Include platform-specific binding code if we're hosted.
/*
* Sanity check for config parameters required by this module.
*/
-#if !defined(CONFIG_KERNEL) || ((CONFIG_KERNEL != 0) && CONFIG_KERNEL != 1)
- #error CONFIG_KERNEL must be set to either 0 or 1 in config.h
+#if !defined(CONFIG_KERN) || ((CONFIG_KERN != 0) && CONFIG_KERN != 1)
+ #error CONFIG_KERN must be set to either 0 or 1 in config.h
#endif
#if !defined(CONFIG_WATCHDOG) || ((CONFIG_WATCHDOG != 0) && CONFIG_WATCHDOG != 1)
#error CONFIG_WATCHDOG must be set to either 0 or 1 in config.h
#include <drv/wdt.h>
#endif
-#if CONFIG_KERNEL
- #if CONFIG_KERN_SIGNALS
- #include <kern/signal.h> /* sig_wait(), sig_check() */
- #include <kern/proc.h> /* proc_current() */
- #include <cfg/macros.h> /* BV() */
- #endif
+#if defined (CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
+ #include <kern/signal.h> /* sig_wait(), sig_check() */
+ #include <kern/proc.h> /* proc_current() */
+ #include <cfg/macros.h> /* BV() */
#endif
void timer_add(Timer *timer)
{
Timer *node;
- cpuflags_t flags;
+ cpu_flags_t flags;
/* Inserting timers twice causes mayhem. */
void timer_delayTicks(ticks_t delay)
{
/* We shouldn't sleep with interrupts disabled */
- ASSERT_IRQ_ENABLED();
+ IRQ_ASSERT_ENABLED();
#if defined(CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS
Timer t;
/* Busy wait */
while (timer_clock() - start < delay)
- {
-#if CONFIG_WATCHDOG
- wdt_reset();
-#endif
- }
+ cpu_relax();
#endif /* !CONFIG_KERN_SIGNALS */
}