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.3 2004/07/14 14:18:09 rasky
19 * Merge da SC: Rimosso timer dentro il task, che รจ uno spreco di memoria per troppi task
21 * Revision 1.2 2004/06/03 11:27:09 bernie
22 * Add dual-license information.
24 * Revision 1.1 2004/05/23 17:27:00 bernie
25 * Import kern/ subdirectory.
27 * Revision 1.3 2004/05/14 12:52:13 rasky
28 * Importato supporto kernel per AVR da Stefano
30 * Revision 1.2 2004/04/28 16:13:49 rasky
31 * proc_schedule() is now semi-private (used only within the kernel)
33 * Revision 1.1 2004/04/26 18:02:40 rasky
34 * Importato microkernel
36 * Revision 1.1 2004/04/04 17:40:26 aleph
37 * Add multithreading kernel
46 #include "config_kern.h"
47 #include <mware/list.h>
50 typedef struct Process
52 Node link; /*!< Link Process into scheduler lists */
53 cpustack_t *stack; /*!< Per-process SP */
55 #if CONFIG_KERN_SIGNALS
56 sigset_t sig_wait; /*!< Signals the process is waiting for */
57 sigset_t sig_recv; /*!< Received signals */
61 uint16_t flags; /*!< Flags */
62 cpustack_t *stack_base; /*!< Base of process stack */
63 size_t stack_size; /*!< Size of process stack */
69 * \name Flags for Process.flags
72 #define PF_FREESTACK BV(0) /*!< Free the stack when process dies */
76 /*! Track running processes */
77 extern REGISTER Process *CurrentProcess;
79 /*! Track ready processes */
80 extern REGISTER List ProcReadyList;
84 * Enqueue a task in the ready list
86 #define SCHED_ENQUEUE(proc) ADDTAIL(&ProcReadyList, &(proc)->link)
88 /*! Schedule to another process *without* adding the current to the ready list */
89 void proc_schedule(void);
91 #endif /* KERN_PROC_P_H */