X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fkern%2Fpreempt.c;h=078724b42a8e38095fb93e3c6e226d2e2b5e2d70;hb=81e5735ef14ab87f0d95a2c87bb895296dfaf886;hp=f068a8a82c24d314d159e84a045422de18b55475;hpb=87302355709b6d5ac0592024b84207ba86baa82e;p=bertos.git diff --git a/bertos/kern/preempt.c b/bertos/kern/preempt.c index f068a8a8..078724b4 100644 --- a/bertos/kern/preempt.c +++ b/bertos/kern/preempt.c @@ -26,55 +26,7 @@ * 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 realtime multitasking scheduler. - * Context switching is only done cooperatively. - * - * \version $Id: proc.c 1616 2008-08-10 19:41:26Z bernie $ - * \author Bernie Innocenti - * \author Stefano Fedrigo - */ - -#include "proc_p.h" -#include "proc.h" - - -/* - * The time sharing scheduler forces a task switch when the current - * process has exhausted its quantum. - */ -uint16_t Quantum; - -/** - * Disable preemptive task switching. + * \note This file is deprecated and kept only for backward compatibility. * - * The scheduler maintains a per-process nesting counter. Task switching is - * effectively re-enabled only when the number of calls to proc_permit() - * matches the number of calls to proc_forbid(). - * - * Calling functions that could sleep while task switching is disabled - * is dangerous, although supported. Preemptive task switching is - * resumed while the process is sleeping and disabled again as soon as - * it wakes up again. - * - * \sa proc_permit() - */ -void proc_forbid(void) -{ - /* No need to protect against interrupts here. */ - ++CurrentProcess->forbid_cnt; -} - -/** - * Re-enable preemptive task switching. - * - * \sa proc_forbid() + * --> */ -void proc_permit(void) -{ - /* No need to protect against interrupts here. */ - --CurrentProcess->forbid_cnt; -}