kernel: preemptive and cooperative scheduler refactoring.
[bertos.git] / bertos / kern / preempt.c
index f068a8a82c24d314d159e84a045422de18b55475..078724b42a8e38095fb93e3c6e226d2e2b5e2d70 100644 (file)
  * 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 <bernie@codewiz.org>
- * -->
- *
- * \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 <bernie@codewiz.org>
- * \author Stefano Fedrigo <aleph@develer.com>
- */
-
-#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;
-}