4 * Copyright 2001,2004 Develer S.r.l. (http://www.develer.com/)
5 * Copyright 1999,2000,2001 Bernardo Innocenti <bernie@develer.com>
9 * \brief Internal scheduler structures and definitions for processes.
13 * \author Bernardo Innocenti <bernie@develer.com>
18 * Revision 1.1 2004/05/23 17:27:00 bernie
19 * Import kern/ subdirectory.
21 * Revision 1.3 2004/05/14 12:52:13 rasky
22 * Importato supporto kernel per AVR da Stefano
24 * Revision 1.2 2004/04/28 16:13:49 rasky
25 * proc_schedule() is now semi-private (used only within the kernel)
27 * Revision 1.1 2004/04/26 18:02:40 rasky
28 * Importato microkernel
30 * Revision 1.1 2004/04/04 17:40:26 aleph
31 * Add multithreading kernel
40 #include "config_kern.h"
41 #include <mware/list.h>
42 #include <drv/timer.h>
45 typedef struct Process
47 Node link; /*!< Link Process into scheduler lists */
48 cpustack_t *stack; /*!< Per-process SP */
50 #if CONFIG_KERN_SIGNALS
51 sigset_t sig_wait; /*!< Signals the process is waiting for */
52 sigset_t sig_recv; /*!< Received signals */
56 struct Timer proc_timer; /*!< Process own timer */
60 uint16_t flags; /*!< Flags */
61 cpustack_t *stack_base; /*!< Base of process stack */
62 size_t stack_size; /*!< Size of process stack */
68 * \name Flags for Process.flags
71 #define PF_FREESTACK BV(0) /*!< Free the stack when process dies */
75 /*! Track running processes */
76 extern REGISTER Process *CurrentProcess;
78 /*! Track ready processes */
79 extern REGISTER List ProcReadyList;
83 * Enqueue a task in the ready list
85 #define SCHED_ENQUEUE(proc) ADDTAIL(&ProcReadyList, &(proc)->link)
87 /*! Schedule to another process *without* adding the current to the ready list */
88 void proc_schedule(void);
90 #endif /* KERN_PROC_P_H */