4 * Copyright 2001,2004 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 1999,2000,2001 Bernardo Innocenti <bernie@develer.com>
6 * This file is part of DevLib - See devlib/README for information.
9 * \brief Internal scheduler structures and definitions for processes.
13 * \author Bernardo Innocenti <bernie@develer.com>
18 * Revision 1.2 2004/06/03 11:27:09 bernie
19 * Add dual-license information.
21 * Revision 1.1 2004/05/23 17:27:00 bernie
22 * Import kern/ subdirectory.
24 * Revision 1.3 2004/05/14 12:52:13 rasky
25 * Importato supporto kernel per AVR da Stefano
27 * Revision 1.2 2004/04/28 16:13:49 rasky
28 * proc_schedule() is now semi-private (used only within the kernel)
30 * Revision 1.1 2004/04/26 18:02:40 rasky
31 * Importato microkernel
33 * Revision 1.1 2004/04/04 17:40:26 aleph
34 * Add multithreading kernel
43 #include "config_kern.h"
44 #include <mware/list.h>
45 #include <drv/timer.h>
48 typedef struct Process
50 Node link; /*!< Link Process into scheduler lists */
51 cpustack_t *stack; /*!< Per-process SP */
53 #if CONFIG_KERN_SIGNALS
54 sigset_t sig_wait; /*!< Signals the process is waiting for */
55 sigset_t sig_recv; /*!< Received signals */
59 struct Timer proc_timer; /*!< Process own timer */
63 uint16_t flags; /*!< Flags */
64 cpustack_t *stack_base; /*!< Base of process stack */
65 size_t stack_size; /*!< Size of process stack */
71 * \name Flags for Process.flags
74 #define PF_FREESTACK BV(0) /*!< Free the stack when process dies */
78 /*! Track running processes */
79 extern REGISTER Process *CurrentProcess;
81 /*! Track ready processes */
82 extern REGISTER List ProcReadyList;
86 * Enqueue a task in the ready list
88 #define SCHED_ENQUEUE(proc) ADDTAIL(&ProcReadyList, &(proc)->link)
90 /*! Schedule to another process *without* adding the current to the ready list */
91 void proc_schedule(void);
93 #endif /* KERN_PROC_P_H */