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.4 2004/07/30 14:24:16 rasky
19 * Task switching con salvataggio perfetto stato di interrupt (SR)
20 * Kernel monitor per dump informazioni su stack dei processi
22 * Revision 1.3 2004/07/14 14:18:09 rasky
23 * Merge da SC: Rimosso timer dentro il task, che รจ uno spreco di memoria per troppi task
25 * Revision 1.2 2004/06/03 11:27:09 bernie
26 * Add dual-license information.
28 * Revision 1.1 2004/05/23 17:27:00 bernie
29 * Import kern/ subdirectory.
31 * Revision 1.3 2004/05/14 12:52:13 rasky
32 * Importato supporto kernel per AVR da Stefano
34 * Revision 1.2 2004/04/28 16:13:49 rasky
35 * proc_schedule() is now semi-private (used only within the kernel)
37 * Revision 1.1 2004/04/26 18:02:40 rasky
38 * Importato microkernel
40 * Revision 1.1 2004/04/04 17:40:26 aleph
41 * Add multithreading kernel
50 #include "config_kern.h"
51 #include <mware/list.h>
53 typedef struct Process
55 Node link; /*!< Link Process into scheduler lists */
56 cpustack_t *stack; /*!< Per-process SP */
58 #if CONFIG_KERN_SIGNALS
59 sigset_t sig_wait; /*!< Signals the process is waiting for */
60 sigset_t sig_recv; /*!< Received signals */
64 uint16_t flags; /*!< Flags */
65 cpustack_t *stack_base; /*!< Base of process stack */
66 size_t stack_size; /*!< Size of process stack */
69 #if CONFIG_KERN_MONITOR
73 cpustack_t* stack_base;
82 * \name Flags for Process.flags
85 #define PF_FREESTACK BV(0) /*!< Free the stack when process dies */
89 /*! Track running processes */
90 extern REGISTER Process *CurrentProcess;
92 /*! Track ready processes */
93 extern REGISTER List ProcReadyList;
97 * Enqueue a task in the ready list
99 #define SCHED_ENQUEUE(proc) ADDTAIL(&ProcReadyList, &(proc)->link)
101 /*! Schedule to another process *without* adding the current to the ready list */
102 void proc_schedule(void);
104 #endif /* KERN_PROC_P_H */