From f35b6066ecdeffcc8998dd566b5246bdcf43c548 Mon Sep 17 00:00:00 2001 From: arighi Date: Mon, 19 Apr 2010 16:03:37 +0000 Subject: [PATCH] kernel: preemptive and cooperative scheduler refactoring. Cooperative and preemptive scheduler share almost the same code. Everything can be merged into bertos/kern/proc.c. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3466 38d2e660-2303-0410-9eaa-f027e97ec537 --- bertos/drv/timer.c | 2 +- bertos/kern/coop.c | 83 +------ bertos/kern/preempt.c | 204 +----------------- bertos/kern/preempt.h | 54 ----- bertos/kern/proc.c | 198 ++++++++++++++++- bertos/kern/proc.h | 48 +---- bertos/kern/proc_p.h | 71 +++--- doc/STATUS | 2 +- examples/at91sam7/at91sam7s.mk | 4 +- examples/at91sam7/at91sam7x.mk | 2 - examples/avr-kern/avr-kern_wiz.mk | 2 - .../kernel-core_avr/kernel-core_avr_wiz.mk | 1 - .../kernel-only_arm/kernel-only_arm_wiz.mk | 3 +- examples/demo/demo.mk | 2 - examples/lm3s1968/lm3s1968.mk | 2 - examples/lpc2378/lpc2378.mk | 2 - test/run_tests.sh | 1 - 17 files changed, 248 insertions(+), 433 deletions(-) delete mode 100644 bertos/kern/preempt.h diff --git a/bertos/drv/timer.c b/bertos/drv/timer.c index dfc27aef..d380e5f1 100644 --- a/bertos/drv/timer.c +++ b/bertos/drv/timer.c @@ -52,7 +52,7 @@ #include #include // cpu_relax() -#include // proc_decQuantun() +#include // proc_decQuantun() /* * Include platform-specific binding code if we're hosted. diff --git a/bertos/kern/coop.c b/bertos/kern/coop.c index c5cab0ed..078724b4 100644 --- a/bertos/kern/coop.c +++ b/bertos/kern/coop.c @@ -26,86 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2001, 2004, 2008 Develer S.r.l. (http://www.develer.com/) - * Copyright 1999, 2000, 2001, 2008 Bernie Innocenti - * --> - * - * \brief Simple cooperative multitasking scheduler. - * - * \version $Id$ - * \author Bernie Innocenti - * \author Stefano Fedrigo - */ - -#include "proc_p.h" -#include "proc.h" - -// Log settings for cfg/log.h. -#define LOG_LEVEL KERN_LOG_LEVEL -#define LOG_FORMAT KERN_LOG_FORMAT -#include - -#include -#include -#include -#include - -/** - * Define function prototypes exported outside. - * - * Required to silent gcc "no previous prototype" warnings. - */ -void coop_yield(void); -void coop_switch(void); -void coop_wakeup(Process *proc); - -static void coop_switchTo(Process *proc) -{ - Process *old_process = current_process; - - SCHED_ENQUEUE(current_process); - current_process = proc; - proc_switchTo(current_process, old_process); -} - -/** - * Give the control of the CPU to another process. - * - * \note Assume the current process has been already added to a wait queue. + * \note This file is deprecated and kept only for backward compatibility. * - * \warning This should be considered an internal kernel function, even if it - * is allowed, usage from application code is strongly discouraged. - */ -void coop_switch(void) -{ - ATOMIC(proc_schedule()); -} - -/** - * Immediately wakeup a process, dispatching it to the CPU. - */ -void coop_wakeup(Process *proc) -{ - ASSERT(proc_preemptAllowed()); - ASSERT(current_process); - IRQ_ASSERT_DISABLED(); - - if (prio_proc(proc) >= prio_curr()) - coop_switchTo(proc); - else - SCHED_ENQUEUE_HEAD(proc); -} - -/** - * Co-operative context switch + * --> */ -void coop_yield(void) -{ - Process *proc; - - IRQ_DISABLE; - proc = (struct Process *)list_remHead(&proc_ready_list); - if (proc) - coop_switchTo(proc); - IRQ_ENABLE; -} diff --git a/bertos/kern/preempt.c b/bertos/kern/preempt.c index bdb6d3c9..078724b4 100644 --- a/bertos/kern/preempt.c +++ b/bertos/kern/preempt.c @@ -26,207 +26,7 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2008 Bernie Innocenti - * Copyright 2009 Andrea Righi - * --> - * - * \brief Simple preemptive multitasking scheduler. - * - * Preemption is explicitly regulated at the exit of each interrupt service - * routine (ISR). Each task obtains a time quantum as soon as it is scheduled - * on the CPU and its quantum is decremented at each clock tick. The frequency - * of the timer determines the system tick granularity and CONFIG_KERN_QUANTUM - * the time sharing interval. - * - * When the quantum expires the handler proc_needPreempt() checks if the - * preemption is enabled and in this case preempt_schedule() is called, that - * possibly replaces the current running thread with a different one. - * - * The preemption can be disabled or enabled via proc_forbid() and - * proc_permit() primitives. This is implemented using a global atomic counter. - * When the counter is greater than 0 the task cannot be preempted; only when - * the counter reaches 0 the task can be preempted again. - * - * Preemption-disabled sections may be nested. The preemption will be - * re-enabled when the outermost preemption-disabled section completes. - * - * The voluntary preemption still happens via proc_switch() or proc_yield(). - * The first one assumes the current process has been already added to a - * private wait queue (e.g., on a semaphore or a signal), while the second one - * takes care of adding the process into the ready queue. - * - * Context switch is done by CPU-dependent support routines. In case of a - * voluntary preemption the context switch routine must take care of - * saving/restoring only the callee-save registers (the voluntary-preemption is - * actually a function call). The kernel-preemption always happens inside a - * signal/interrupt context and it must take care of saving all registers. For - * this, in the entry point of each ISR the caller-save registers must be - * saved. In the ISR exit point, if the context switch must happen, we switch - * to user-context and call the same voluntary context switch routine that take - * care of saving/restoring also the callee-save registers. On resume from the - * switch, the interrupt exit point moves back to interrupt-context, resumes - * the caller-save registers (saved in the ISR entry point) and return from the - * interrupt-context. - * - * \note Thread priority (if enabled by CONFIG_KERN_PRI) defines the order in - * the \p proc_ready_list and the capability to deschedule a running process. A - * low-priority thread can't preempt a high-priority thread. - * - * A high-priority process can preempt a low-priority process immediately (it - * will be descheduled and replaced in the interrupt exit point). Processes - * running at the same priority can be descheduled when they expire the time - * quantum. - * - * \note Sleeping while preemption is disabled fallbacks to a busy-wait sleep. - * Voluntary preemption when preemption is disabled raises a kernel bug. - * - * \author Bernie Innocenti - * \author Andrea Righi - */ - -#include "cfg/cfg_proc.h" - -#include "proc_p.h" -#include "proc.h" - -#include -#include -#include // CPU_IDLE -#include // IRQ_DISABLE()... -#include -#include -#include // CONFIG_DEPEND() - -// Check config dependencies -CONFIG_DEPEND(CONFIG_KERN_PREEMPT, CONFIG_KERN); - -MOD_DEFINE(preempt) - -/* Global preemption nesting counter */ -cpu_atomic_t preempt_count; - -/* - * The time sharing interval: when a process is scheduled on a CPU it gets an - * amount of CONFIG_KERN_QUANTUM clock ticks. When these ticks expires and - * preemption is enabled a new process is selected to run. - */ -int _proc_quantum; - -/** - * Define function prototypes exported outside. + * \note This file is deprecated and kept only for backward compatibility. * - * Required to silent gcc "no previous prototype" warnings. - */ -void preempt_yield(void); -int preempt_needPreempt(void); -void preempt_preempt(void); -void preempt_switch(void); -void preempt_wakeup(Process *proc); -void preempt_init(void); - -static void preempt_switchTo(Process *proc) -{ - Process *old_process = current_process; - - SCHED_ENQUEUE(current_process); - _proc_quantum = CONFIG_KERN_QUANTUM; - current_process = proc; - proc_switchTo(current_process, old_process); -} - -/** - * Call the scheduler and eventually replace the current running process. - */ -static void preempt_schedule(void) -{ - _proc_quantum = CONFIG_KERN_QUANTUM; - proc_schedule(); -} - -/** - * Check if we need to schedule another task - */ -int preempt_needPreempt(void) -{ - if (UNLIKELY(current_process == NULL)) - return 0; - if (!proc_preemptAllowed()) - return 0; - if (LIST_EMPTY(&proc_ready_list)) - return 0; - return _proc_quantum ? prio_next() > prio_curr() : - prio_next() >= prio_curr(); -} - -/** - * Preempt the current task. - */ -void preempt_preempt(void) -{ - IRQ_ASSERT_DISABLED(); - ASSERT(current_process); - - /* Perform the kernel preemption */ - LOG_INFO("preempting %p:%s\n", current_process, proc_currentName()); - /* We are inside a IRQ context, so ATOMIC is not needed here */ - SCHED_ENQUEUE(current_process); - preempt_schedule(); -} - -/** - * Give the control of the CPU to another process. - * - * \note Assume the current process has been already added to a wait queue. - * - * \warning This should be considered an internal kernel function, even if it - * is allowed, usage from application code is strongly discouraged. - */ -void preempt_switch(void) -{ - ASSERT(proc_preemptAllowed()); - - ATOMIC(preempt_schedule()); -} - -/** - * Immediately wakeup a process, dispatching it to the CPU. - */ -void preempt_wakeup(Process *proc) -{ - ASSERT(proc_preemptAllowed()); - ASSERT(current_process); - IRQ_ASSERT_DISABLED(); - - if (prio_proc(proc) >= prio_curr()) - preempt_switchTo(proc); - else - SCHED_ENQUEUE_HEAD(proc); -} - -/** - * Voluntarily release the CPU. + * --> */ -void preempt_yield(void) -{ - Process *proc; - - /* - * Voluntary preemption while preemption is disabled is considered - * illegal, as not very useful in practice. - * - * ASSERT if it happens. - */ - ASSERT(proc_preemptAllowed()); - IRQ_ASSERT_ENABLED(); - - IRQ_DISABLE; - proc = (struct Process *)list_remHead(&proc_ready_list); - if (proc) - preempt_switchTo(proc); - IRQ_ENABLE; -} - -void preempt_init(void) -{ - MOD_INIT(preempt); -} diff --git a/bertos/kern/preempt.h b/bertos/kern/preempt.h deleted file mode 100644 index 9688e6c3..00000000 --- a/bertos/kern/preempt.h +++ /dev/null @@ -1,54 +0,0 @@ -/** - * \file - * - * - * \brief Preeptive kernel funtion interfaces. - * - * \author Francesco Sacchi - */ - -#ifndef KERN_PREEMPT_H -#define KERN_PREEMPT_H - -#include - -#if CONFIG_KERN_PREEMPT - INLINE void proc_decQuantum(void) - { - extern int _proc_quantum; - if (_proc_quantum > 0) - _proc_quantum--; - } -#else /* !CONFIG_KERN_PREEMPT */ - #define proc_decQuantum() /* NOP */ -#endif /* CONFIG_KERN_PREEMPT */ - -#endif /* KERN_PREEMPT_H */ diff --git a/bertos/kern/proc.c b/bertos/kern/proc.c index a18fc404..781bd553 100644 --- a/bertos/kern/proc.c +++ b/bertos/kern/proc.c @@ -26,14 +26,63 @@ * invalidate any other reasons why the executable file might be covered by * the GNU General Public License. * - * Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/) - * Copyright 1999, 2000, 2001, 2008 Bernie Innocenti + * \brief Simple preemptive multitasking scheduler. + * + * Preemption is explicitly regulated at the exit of each interrupt service + * routine (ISR). Each task obtains a time quantum as soon as it is scheduled + * on the CPU and its quantum is decremented at each clock tick. The frequency + * of the timer determines the system tick granularity and CONFIG_KERN_QUANTUM + * the time sharing interval. + * + * When the quantum expires the handler proc_needPreempt() checks if the + * preemption is enabled and in this case proc_schedule() is called, that + * possibly replaces the current running thread with a different one. + * + * The preemption can be disabled or enabled via proc_forbid() and + * proc_permit() primitives. This is implemented using a global atomic counter. + * When the counter is greater than 0 the task cannot be preempted; only when + * the counter reaches 0 the task can be preempted again. + * + * Preemption-disabled sections may be nested. The preemption will be + * re-enabled when the outermost preemption-disabled section completes. + * + * The voluntary preemption still happens via proc_switch() or proc_yield(). + * The first one assumes the current process has been already added to a + * private wait queue (e.g., on a semaphore or a signal), while the second one + * takes care of adding the process into the ready queue. + * + * Context switch is done by CPU-dependent support routines. In case of a + * voluntary preemption the context switch routine must take care of + * saving/restoring only the callee-save registers (the voluntary-preemption is + * actually a function call). The kernel-preemption always happens inside a + * signal/interrupt context and it must take care of saving all registers. For + * this, in the entry point of each ISR the caller-save registers must be + * saved. In the ISR exit point, if the context switch must happen, we switch + * to user-context and call the same voluntary context switch routine that take + * care of saving/restoring also the callee-save registers. On resume from the + * switch, the interrupt exit point moves back to interrupt-context, resumes + * the caller-save registers (saved in the ISR entry point) and return from the + * interrupt-context. + * + * \note Thread priority (if enabled by CONFIG_KERN_PRI) defines the order in + * the \p proc_ready_list and the capability to deschedule a running process. A + * low-priority thread can't preempt a high-priority thread. + * + * A high-priority process can preempt a low-priority process immediately (it + * will be descheduled and replaced in the interrupt exit point). Processes + * running at the same priority can be descheduled when they expire the time + * quantum. + * + * \note Sleeping while preemption is disabled fallbacks to a busy-wait sleep. + * Voluntary preemption when preemption is disabled raises a kernel bug. + * * --> * - * \brief Simple cooperative multitasking scheduler. + * \brief Simple cooperative and preemptive multitasking scheduler. * * \author Bernie Innocenti * \author Stefano Fedrigo + * \author Andrea Righi */ #include "proc_p.h" @@ -98,6 +147,36 @@ static List zombie_list; #endif /* CONFIG_KERN_HEAP */ +/* + * Check if the process context switch can be performed directly by the + * architecture-dependent asm_switch_context() or if it must be delayed + * because we're in the middle of an ISR. + * + * Return true if asm_switch_context() can be executed, false + * otherwise. + * + * NOTE: if an architecture does not implement IRQ_RUNNING() this function + * always returns true. + */ +#define CONTEXT_SWITCH_FROM_ISR() (!IRQ_RUNNING()) + +/* + * Save context of old process and switch to new process. + */ +static void proc_context_switch(Process *next, Process *prev) +{ + cpu_stack_t *dummy; + + if (UNLIKELY(next == prev)) + return; + /* + * If there is no old process, we save the old stack pointer into a + * dummy variable that we ignore. In fact, this happens only when the + * old process has just exited. + */ + asm_switch_context(&next->stack, prev ? &prev->stack : &dummy); +} + static void proc_initStruct(Process *proc) { /* Avoid warning for unused argument. */ @@ -423,7 +502,7 @@ void proc_exit(void) /** * Call the scheduler and eventually replace the current running process. */ -void proc_schedule(void) +static void proc_schedule(void) { Process *old_process = current_process; @@ -454,7 +533,116 @@ void proc_schedule(void) IRQ_DISABLE; } if (CONTEXT_SWITCH_FROM_ISR()) - proc_switchTo(current_process, old_process); + proc_context_switch(current_process, old_process); /* This RET resumes the execution on the new process */ LOG_INFO("resuming %p:%s\n", current_process, proc_currentName()); } + +#if CONFIG_KERN_PREEMPT +/* Global preemption nesting counter */ +cpu_atomic_t preempt_count; + +/* + * The time sharing interval: when a process is scheduled on a CPU it gets an + * amount of CONFIG_KERN_QUANTUM clock ticks. When these ticks expires and + * preemption is enabled a new process is selected to run. + */ +int _proc_quantum; + +/** + * Check if we need to schedule another task + */ +bool proc_needPreempt(void) +{ + if (UNLIKELY(current_process == NULL)) + return false; + if (!proc_preemptAllowed()) + return false; + if (LIST_EMPTY(&proc_ready_list)) + return false; + return preempt_quantum() ? prio_next() > prio_curr() : + prio_next() >= prio_curr(); +} + +/** + * Preempt the current task. + */ +void proc_preempt(void) +{ + IRQ_ASSERT_DISABLED(); + ASSERT(current_process); + + /* Perform the kernel preemption */ + LOG_INFO("preempting %p:%s\n", current_process, proc_currentName()); + /* We are inside a IRQ context, so ATOMIC is not needed here */ + SCHED_ENQUEUE(current_process); + preempt_reset_quantum(); + proc_schedule(); +} +#endif /* CONFIG_KERN_PREEMPT */ + +/* Immediately switch to a particular process */ +static void proc_switchTo(Process *proc) +{ + Process *old_process = current_process; + + SCHED_ENQUEUE(current_process); + preempt_reset_quantum(); + current_process = proc; + proc_context_switch(current_process, old_process); +} + +/** + * Give the control of the CPU to another process. + * + * \note Assume the current process has been already added to a wait queue. + * + * \warning This should be considered an internal kernel function, even if it + * is allowed, usage from application code is strongly discouraged. + */ +void proc_switch(void) +{ + ASSERT(proc_preemptAllowed()); + ATOMIC( + preempt_reset_quantum(); + proc_schedule(); + ); +} + +/** + * Immediately wakeup a process, dispatching it to the CPU. + */ +void proc_wakeup(Process *proc) +{ + ASSERT(proc_preemptAllowed()); + ASSERT(current_process); + IRQ_ASSERT_DISABLED(); + + if (prio_proc(proc) >= prio_curr()) + proc_switchTo(proc); + else + SCHED_ENQUEUE_HEAD(proc); +} + +/** + * Voluntarily release the CPU. + */ +void proc_yield(void) +{ + Process *proc; + + /* + * Voluntary preemption while preemption is disabled is considered + * illegal, as not very useful in practice. + * + * ASSERT if it happens. + */ + ASSERT(proc_preemptAllowed()); + IRQ_ASSERT_ENABLED(); + + IRQ_DISABLE; + proc = (struct Process *)list_remHead(&proc_ready_list); + if (proc) + proc_switchTo(proc); + IRQ_ENABLE; +} diff --git a/bertos/kern/proc.h b/bertos/kern/proc.h index bacd052b..9b4fe140 100644 --- a/bertos/kern/proc.h +++ b/bertos/kern/proc.h @@ -37,7 +37,7 @@ * * $WIZ$ module_name = "kernel" * $WIZ$ module_configuration = "bertos/cfg/cfg_proc.h" - * $WIZ$ module_depends = "switch_ctx", "coop", "preempt" + * $WIZ$ module_depends = "switch_ctx" * $WIZ$ module_supports = "not atmega103" */ @@ -51,11 +51,7 @@ #include // Node, PriNode #include - -#if CONFIG_KERN_PREEMPT - #include // ASSERT() - #include -#endif +#include // ASSERT() #include // cpu_stack_t #include // CPU_SAVED_REGS_CNT @@ -146,41 +142,19 @@ void proc_exit(void); * Public scheduling class methods. */ void proc_yield(void); -void proc_preempt(void); -int proc_needPreempt(void); -void proc_wakeup(Process *proc); -/** - * Dummy function that defines unimplemented scheduler class methods. - */ -INLINE void __proc_noop(void) +#if CONFIG_KERN_PREEMPT +bool proc_needPreempt(void); +void proc_preempt(void); +#else +INLINE bool proc_needPreempt(void) { + return false; } -#if CONFIG_KERN_PREEMPT - /** - * Preemptive scheduler public methods. - */ - #define preempt_yield proc_yield - #define preempt_needPreempt proc_needPreempt - #define preempt_preempt proc_preempt - /** - * Preemptive scheduler: private methods. - */ - #define preempt_switch proc_switch - #define preempt_wakeup proc_wakeup -#else - /** - * Co-operative scheduler: public methods. - */ - #define coop_yield proc_yield - #define proc_needPreempt __proc_noop - #define proc_preempt __proc_noop - /** - * Co-operative scheduler: private methods. - */ - #define coop_switch proc_switch - #define coop_wakeup proc_wakeup +INLINE void proc_preempt(void) +{ +} #endif void proc_rename(struct Process *proc, const char *name); diff --git a/bertos/kern/proc_p.h b/bertos/kern/proc_p.h index 56c81081..64fabb12 100644 --- a/bertos/kern/proc_p.h +++ b/bertos/kern/proc_p.h @@ -50,19 +50,6 @@ #include // struct Process -/* - * Check if the process context switch can be performed directly by the - * architecture-dependent asm_switch_context() or if it must be delayed - * because we're in the middle of an ISR. - * - * Return true if asm_switch_context() can be executed, false - * otherwise. - * - * NOTE: if an architecture does not implement IRQ_RUNNING() this function - * always returns true. - */ -#define CONTEXT_SWITCH_FROM_ISR() (!IRQ_RUNNING()) - #ifndef asm_switch_context /** * CPU dependent context switching routines. @@ -73,23 +60,6 @@ EXTERN_C void asm_switch_context(cpu_stack_t **new_sp, cpu_stack_t **save_sp); #endif -/* - * Save context of old process and switch to new process. - */ -INLINE void proc_switchTo(Process *next, Process *prev) -{ - cpu_stack_t *dummy; - - if (UNLIKELY(next == prev)) - return; - /* - * If there is no old process, we save the old stack pointer into a - * dummy variable that we ignore. In fact, this happens only when the - * old process has just exited. - */ - asm_switch_context(&next->stack, prev ? &prev->stack : &dummy); -} - /** * \name Flags for Process.flags. * \{ @@ -191,11 +161,8 @@ void proc_entry(void); /* Schedule another process *without* adding the current one to the ready list. */ void proc_switch(void); -/* Low level scheduling routine. */ -void proc_schedule(void); - -/* Low level context switch routine. */ -void proc_switchTo(Process *next, Process *prev); +/* Immediately schedule a particular process bypassing the scheduler. */ +void proc_wakeup(Process *proc); /* Initialize a scheduler class. */ void proc_schedInit(void); @@ -214,4 +181,38 @@ void proc_schedInit(void); void monitor_rename(Process *proc, const char *name); #endif /* CONFIG_KERN_MONITOR */ +#if CONFIG_KERN_PREEMPT +INLINE int preempt_quantum(void) +{ + extern int _proc_quantum; + return _proc_quantum; +} + +INLINE void proc_decQuantum(void) +{ + extern int _proc_quantum; + if (_proc_quantum > 0) + _proc_quantum--; +} + +INLINE void preempt_reset_quantum(void) +{ + extern int _proc_quantum; + _proc_quantum = CONFIG_KERN_QUANTUM; +} +#else /* !CONFIG_KERN_PREEMPT */ +INLINE int preempt_quantum(void) +{ + return 0; +} + +INLINE void proc_decQuantum(void) +{ +} + +INLINE void preempt_reset_quantum(void) +{ +} +#endif /* CONFIG_KERN_PREEMPT */ + #endif /* KERN_PROC_P_H */ diff --git a/doc/STATUS b/doc/STATUS index d91fd337..c437d00d 100644 --- a/doc/STATUS +++ b/doc/STATUS @@ -50,7 +50,7 @@ Since the system simply waits for external events to happen we decided to implem Currently the kernel code is very stable. Kernel features : - \li \link coop.c Cooperative \endlink round-robin scheduling. + \li \link preempt.c Cooperative and preemptive \endlink round-robin scheduling. \li \link monitor.h Stack process monitor \endlink, useful to prevent stack overflows. \li \link msg.h Inter-process messaging system \endlink (with very low overhead). \li \link sem.h Binary semaphores \endlink. diff --git a/examples/at91sam7/at91sam7s.mk b/examples/at91sam7/at91sam7s.mk index 0586ba45..451e4e90 100644 --- a/examples/at91sam7/at91sam7s.mk +++ b/examples/at91sam7/at91sam7s.mk @@ -28,8 +28,6 @@ at91sam7s_CSRC = \ bertos/mware/sprintf.c \ bertos/kern/kfile.c \ bertos/kern/proc.c \ - bertos/kern/coop.c \ - bertos/kern/preempt.c \ bertos/kern/proc_test.c \ bertos/kern/signal_test.c \ bertos/kern/monitor.c \ @@ -43,7 +41,7 @@ at91sam7s_CPPASRC = \ at91sam7s_PREFIX = arm-none-eabi- -at91sam7s_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug +at91sam7s_CPPAFLAGS = -O0 -g -gdwarf-2 -g at91sam7s_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7S256__ -D'CPU_FREQ=(48023000UL)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -Iexamples/at91sam7 -Ibertos/cpu/arm at91sam7s_LDFLAGS = -nostartfiles -T bertos/cpu/arm/scripts/at91sam7_256_rom.ld -Wl,--no-warn-mismatch at91sam7s_CPU = arm7tdmi diff --git a/examples/at91sam7/at91sam7x.mk b/examples/at91sam7/at91sam7x.mk index 11a6c5ed..fe48a2ea 100644 --- a/examples/at91sam7/at91sam7x.mk +++ b/examples/at91sam7/at91sam7x.mk @@ -29,8 +29,6 @@ at91sam7x_CSRC = \ bertos/struct/heap.c \ bertos/kern/kfile.c \ bertos/kern/proc.c \ - bertos/kern/coop.c \ - bertos/kern/preempt.c \ bertos/kern/proc_test.c \ bertos/kern/signal_test.c \ bertos/kern/monitor.c \ diff --git a/examples/avr-kern/avr-kern_wiz.mk b/examples/avr-kern/avr-kern_wiz.mk index cf3aefbd..3f2e83ef 100644 --- a/examples/avr-kern/avr-kern_wiz.mk +++ b/examples/avr-kern/avr-kern_wiz.mk @@ -26,8 +26,6 @@ avr-kern_WIZARD_CSRC = \ bertos/struct/heap.c \ bertos/kern/monitor.c \ bertos/drv/timer.c \ - bertos/kern/coop.c \ - bertos/kern/preempt.c \ bertos/cpu/avr/drv/timer_avr.c \ bertos/kern/proc.c \ bertos/mware/formatwr.c \ diff --git a/examples/benchmark/kernel-core_avr/kernel-core_avr_wiz.mk b/examples/benchmark/kernel-core_avr/kernel-core_avr_wiz.mk index dfbbe4b1..164feb24 100644 --- a/examples/benchmark/kernel-core_avr/kernel-core_avr_wiz.mk +++ b/examples/benchmark/kernel-core_avr/kernel-core_avr_wiz.mk @@ -22,7 +22,6 @@ kernel-core_avr_SUFFIX = "" kernel-core_avr_WIZARD_CSRC = \ bertos/cpu/avr/drv/ser_avr.c \ bertos/drv/ser.c \ - bertos/kern/coop.c \ bertos/kern/proc.c \ bertos/mware/formatwr.c \ bertos/mware/hex.c \ diff --git a/examples/benchmark/kernel-only_arm/kernel-only_arm_wiz.mk b/examples/benchmark/kernel-only_arm/kernel-only_arm_wiz.mk index 7394432b..4a67ba2f 100644 --- a/examples/benchmark/kernel-only_arm/kernel-only_arm_wiz.mk +++ b/examples/benchmark/kernel-only_arm/kernel-only_arm_wiz.mk @@ -20,7 +20,6 @@ kernel-only_arm_SUFFIX = "" # Files automatically generated by the wizard. DO NOT EDIT, USE kernel-only_arm_USER_CSRC INSTEAD! kernel-only_arm_WIZARD_CSRC = \ - bertos/kern/coop.c \ bertos/kern/proc.c \ bertos/kern/sem.c \ bertos/kern/signal.c \ @@ -71,7 +70,7 @@ kernel-only_arm_ASRC = $(kernel-only_arm_CPU_ASRC) $(kernel-only_arm_WIZARD_ASRC # CPU specific flags and options, defined in the CPU definition files. # Automatically generated by the wizard. PLEASE DO NOT EDIT! -kernel-only_arm_CPU_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug +kernel-only_arm_CPU_CPPAFLAGS = -O0 -g -gdwarf-2 -g kernel-only_arm_CPU_CPPFLAGS = -O0 -g3 -gdwarf-2 -fverbose-asm -Ibertos/cpu/arm/ -D__ARM_AT91SAM7X256__ kernel-only_arm_PROGRAMMER_CPU = at91sam7 kernel-only_arm_STOPFLASH_SCRIPT = bertos/prg_scripts/arm/stopopenocd.sh diff --git a/examples/demo/demo.mk b/examples/demo/demo.mk index 838b8a94..1e687b5b 100644 --- a/examples/demo/demo.mk +++ b/examples/demo/demo.mk @@ -56,8 +56,6 @@ demo_CSRC = \ bertos/mware/resource.c \ bertos/mware/sprintf.c \ bertos/struct/heap.c \ - bertos/kern/coop.c \ - bertos/kern/preempt.c \ bertos/kern/irq.c \ bertos/kern/proc.c \ bertos/kern/proc_test.c \ diff --git a/examples/lm3s1968/lm3s1968.mk b/examples/lm3s1968/lm3s1968.mk index 4d71d0da..63be128c 100644 --- a/examples/lm3s1968/lm3s1968.mk +++ b/examples/lm3s1968/lm3s1968.mk @@ -39,8 +39,6 @@ lm3s1968_CSRC = \ bertos/kern/monitor.c \ bertos/kern/proc_test.c \ bertos/kern/proc.c \ - bertos/kern/coop.c \ - bertos/kern/preempt.c \ bertos/kern/signal.c \ bertos/cpu/cortex-m3/drv/gpio_lm3s.c \ bertos/cpu/cortex-m3/drv/clock_lm3s.c \ diff --git a/examples/lpc2378/lpc2378.mk b/examples/lpc2378/lpc2378.mk index e5a3bc74..59ec1cb6 100644 --- a/examples/lpc2378/lpc2378.mk +++ b/examples/lpc2378/lpc2378.mk @@ -21,8 +21,6 @@ lpc2378_USER_CSRC = \ bertos/cpu/arm/drv/timer_lpc2.c \ bertos/mware/event.c \ bertos/kern/proc.c \ - bertos/kern/coop.c \ - bertos/kern/preempt.c \ bertos/kern/proc_test.c \ bertos/kern/monitor.c \ bertos/mware/sprintf.c \ diff --git a/test/run_tests.sh b/test/run_tests.sh index 71a25d31..d79f46fe 100755 --- a/test/run_tests.sh +++ b/test/run_tests.sh @@ -39,7 +39,6 @@ SRC_LIST=" bertos/kern/proc.c bertos/kern/signal.c bertos/kern/sem.c - bertos/kern/coop.c bertos/kern/preempt.c bertos/mware/event.c bertos/mware/formatwr.c -- 2.25.1