/// Module logging format.
#define KERN_LOG_FORMAT LOG_FMT_VERBOSE
-#define CONFIG_KERN_PREEMPTIVE CONFIG_KERN_PREEMPT // OBSOLETE
-#define CONFIG_KERNEL CONFIG_KERN // OBSOLETE
-
#endif /* CFG_KERN_H */
#ifndef UNUSED_ARG
#define UNUSED_ARG(type,arg) type arg
#endif
-#define UNUSED UNUSED_ARG /* OBSOLETE */
#ifndef UNUSED_VAR
#define UNUSED_VAR(type,name) type name
#endif
#define LOG_FMT_TERSE 0
/* \} */
-#define LOG_SILENT LOG_FMT_TERSE /* OBSOLETE */
-#define LOG_VERBOSE LOG_FMT_VERBOSE /* OBSOLETE */
-
#if LOG_FORMAT == LOG_FMT_VERBOSE
#define LOG_PRINT(str_level, str,...) kprintf("%s():%d:%s: " str, __func__, __LINE__, str_level, ## __VA_ARGS__)
#elif LOG_FORMAT == LOG_FMT_TERSE
/** Round up \a x to an even multiple of the 2's power \a pad. */
#define ROUND_UP2(x, pad) (((x) + ((pad) - 1)) & ~((pad) - 1))
-/* OBSOLETE */
-#define ROUND2 ROUND_UP2
-
/**
* \name Integer round macros.
*
#define IRQ_ASSERT_DISABLED() do {} while(0)
#endif
-// OBSOLETE names
-#define ASSERT_IRQ_ENABLED() IRQ_ASSERT_ENABLED()
-#define ASSERT_IRQ_DISABLED() IRQ_ASSERT_DISABLED()
-
/**
* Execute \a CODE atomically with respect to interrupts.
*
IRQ_RESTORE(__flags); \
} while (0)
-
-
#endif /* CPU_IRQ_H */
#include <cfg/cfg_kern.h>
#include <cfg/cfg_wdt.h>
-#if CONFIG_KERNEL
+#if CONFIG_KERN
#include <kern/proc.h>
#endif
*/
INLINE void cpu_relax(void)
{
-#if CONFIG_KERNEL
+#if CONFIG_KERN
proc_yield();
#endif
BUZZER_HW_INIT;
/* Init software interrupt. */
- timer_set_event_softint(&buz_timer, (Hook)buz_softint, 0);
+ timer_setSoftint(&buz_timer, (Hook)buz_softint, 0);
MOD_INIT(buzzer);
}
/*
* 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_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;
/** Set the timer so that it calls an user hook when it expires */
INLINE void timer_setSoftint(Timer *timer, Hook func, iptr_t user_data)
{
- event_initSoftInt(&timer->expire, func, user_data);
+ event_initSoftint(&timer->expire, func, user_data);
}
-// OBSOLETE
-#define timer_set_event_softint timer_setSoftint
-
/** Set the timer delay (the time before the event will be triggered) */
INLINE void timer_setDelay(Timer *timer, ticks_t delay)
{
#include <cfg/module.h>
-static cpustack_t idle_stack[CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)];
+static cpustack_t idle_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpustack_t)];
/**
* The idle process
* \return Process structure of new created process
* if successful, NULL otherwise.
*/
-struct Process *proc_new_with_name(UNUSED(const char *, name), void (*entry)(void), iptr_t data, size_t stack_size, cpustack_t *stack_base)
+struct Process *proc_new_with_name(UNUSED_ARG(const char *, name), void (*entry)(void), iptr_t data, size_t stack_size, cpustack_t *stack_base)
{
Process *proc;
- const size_t PROC_SIZE_WORDS = ROUND2(sizeof(Process), sizeof(cpustack_t)) / sizeof(cpustack_t);
+ const size_t PROC_SIZE_WORDS = ROUND_UP2(sizeof(Process), sizeof(cpustack_t)) / sizeof(cpustack_t);
#if CONFIG_KERN_HEAP
bool free_stack = false;
#endif
void proc_exit(void);
void proc_yield(void);
-#define proc_switch proc_yield /* OBSOLETE */
int proc_testSetup(void);
int proc_testRun(void);
#endif
#endif
-#define CONFIG_PROC_DEFSTACKSIZE CONFIG_KERN_MINSTACKSIZE // OBSOLETE
-
/* Memory fill codes to help debugging */
#if CONFIG_KERN_MONITOR
#include <cpu/types.h>
}
}
-static cpustack_t proc_test1_stack[CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)];
-static cpustack_t proc_test2_stack[CONFIG_PROC_DEFSTACKSIZE / sizeof(cpustack_t)];
+static cpustack_t proc_test1_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpustack_t)];
+static cpustack_t proc_test2_stack[CONFIG_KERN_MINSTACKSIZE / sizeof(cpustack_t)];
/**