From 0eeba5822b3ff0e76ae0fd0272536d371d272d7d Mon Sep 17 00:00:00 2001 From: bernie Date: Mon, 25 Aug 2008 18:54:02 +0000 Subject: [PATCH] Remove plenty of legacy names marked as OBSOLETE git-svn-id: https://src.develer.com/svnoss/bertos/trunk@1696 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/cfg/cfg_kern.h | 3 --- bertos/cfg/compiler.h | 1 - bertos/cfg/log.h | 3 --- bertos/cfg/macros.h | 3 --- bertos/cpu/irq.h | 6 ------ bertos/cpu/power.h | 4 ++-- bertos/drv/buzzer.c | 2 +- bertos/drv/timer.c | 16 +++++++--------- bertos/drv/timer.h | 5 +---- bertos/kern/idle.c | 2 +- bertos/kern/proc.c | 4 ++-- bertos/kern/proc.h | 3 --- bertos/kern/proc_test.c | 4 ++-- 13 files changed, 16 insertions(+), 40 deletions(-) diff --git a/bertos/cfg/cfg_kern.h b/bertos/cfg/cfg_kern.h index eae0ef74..e828bce7 100644 --- a/bertos/cfg/cfg_kern.h +++ b/bertos/cfg/cfg_kern.h @@ -67,7 +67,4 @@ /// 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 */ diff --git a/bertos/cfg/compiler.h b/bertos/cfg/compiler.h index 052565cf..7357f43f 100644 --- a/bertos/cfg/compiler.h +++ b/bertos/cfg/compiler.h @@ -283,7 +283,6 @@ #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 diff --git a/bertos/cfg/log.h b/bertos/cfg/log.h index f4906692..84d5cc63 100644 --- a/bertos/cfg/log.h +++ b/bertos/cfg/log.h @@ -132,9 +132,6 @@ #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 diff --git a/bertos/cfg/macros.h b/bertos/cfg/macros.h index 638118b5..69c40485 100644 --- a/bertos/cfg/macros.h +++ b/bertos/cfg/macros.h @@ -166,9 +166,6 @@ /** 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. * diff --git a/bertos/cpu/irq.h b/bertos/cpu/irq.h index 22d11e1f..0d0d4686 100644 --- a/bertos/cpu/irq.h +++ b/bertos/cpu/irq.h @@ -252,10 +252,6 @@ #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. * @@ -269,6 +265,4 @@ IRQ_RESTORE(__flags); \ } while (0) - - #endif /* CPU_IRQ_H */ diff --git a/bertos/cpu/power.h b/bertos/cpu/power.h index 035495d4..b4550ad6 100644 --- a/bertos/cpu/power.h +++ b/bertos/cpu/power.h @@ -40,7 +40,7 @@ #include #include -#if CONFIG_KERNEL +#if CONFIG_KERN #include #endif @@ -66,7 +66,7 @@ */ INLINE void cpu_relax(void) { -#if CONFIG_KERNEL +#if CONFIG_KERN proc_yield(); #endif diff --git a/bertos/drv/buzzer.c b/bertos/drv/buzzer.c index 86e1c01c..8cac8123 100644 --- a/bertos/drv/buzzer.c +++ b/bertos/drv/buzzer.c @@ -155,7 +155,7 @@ void buz_init(void) 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); } diff --git a/bertos/drv/timer.c b/bertos/drv/timer.c index c0106d85..285d67c5 100644 --- a/bertos/drv/timer.c +++ b/bertos/drv/timer.c @@ -63,8 +63,8 @@ /* * 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 @@ -74,12 +74,10 @@ #include #endif -#if CONFIG_KERNEL - #if CONFIG_KERN_SIGNALS - #include /* sig_wait(), sig_check() */ - #include /* proc_current() */ - #include /* BV() */ - #endif +#if defined (CONFIG_KERN_SIGNALS) && CONFIG_KERN_SIGNALS + #include /* sig_wait(), sig_check() */ + #include /* proc_current() */ + #include /* BV() */ #endif @@ -182,7 +180,7 @@ Timer *timer_abort(Timer *timer) 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; diff --git a/bertos/drv/timer.h b/bertos/drv/timer.h index 6ae1907e..9e3e2b30 100644 --- a/bertos/drv/timer.h +++ b/bertos/drv/timer.h @@ -249,12 +249,9 @@ Timer *timer_abort(Timer *timer); /** 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) { diff --git a/bertos/kern/idle.c b/bertos/kern/idle.c index 116328ec..ecbe5915 100644 --- a/bertos/kern/idle.c +++ b/bertos/kern/idle.c @@ -40,7 +40,7 @@ #include -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 diff --git a/bertos/kern/proc.c b/bertos/kern/proc.c index 6bd5fdf4..577f0db4 100644 --- a/bertos/kern/proc.c +++ b/bertos/kern/proc.c @@ -148,10 +148,10 @@ void proc_init(void) * \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 diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index 6a4aff8b..6f1a8af5 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -65,7 +65,6 @@ struct Process *proc_new_with_name(const char* name, void (*entry)(void), iptr_t void proc_exit(void); void proc_yield(void); -#define proc_switch proc_yield /* OBSOLETE */ int proc_testSetup(void); int proc_testRun(void); @@ -188,8 +187,6 @@ INLINE void proc_permit(void) #endif #endif -#define CONFIG_PROC_DEFSTACKSIZE CONFIG_KERN_MINSTACKSIZE // OBSOLETE - /* Memory fill codes to help debugging */ #if CONFIG_KERN_MONITOR #include diff --git a/bertos/kern/proc_test.c b/bertos/kern/proc_test.c index 32fde7e0..414f2115 100644 --- a/bertos/kern/proc_test.c +++ b/bertos/kern/proc_test.c @@ -66,8 +66,8 @@ static void proc_test2(void) } } -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)]; /** -- 2.25.1