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 Process scheduler (public interface).
13 * \author Bernardo Innocenti <bernie@develer.com>
18 *#* Revision 1.9 2005/04/11 19:10:28 bernie
19 *#* Include top-level headers from cfg/ subdir.
21 *#* Revision 1.8 2004/11/16 22:37:14 bernie
22 *#* Replace IPTR with iptr_t.
24 *#* Revision 1.7 2004/10/19 08:54:55 bernie
25 *#* Define forbid_cnt.
27 *#* Revision 1.6 2004/10/03 20:44:18 bernie
28 *#* Remove stale declarations (moved to monitor.h).
30 *#* Revision 1.2 2004/06/03 11:27:09 bernie
31 *#* Add dual-license information.
33 *#* Revision 1.1 2004/05/23 17:27:00 bernie
34 *#* Import kern/ subdirectory.
41 #include <cfg/compiler.h>
43 #include <cfg/config_kern.h>
48 /* Task scheduling services */
50 struct Process *proc_new_with_name(const char* name, void (*entry)(void), iptr_t data, size_t stacksize, cpustack_t *stack);
52 #if !CONFIG_KERN_MONITOR
53 #define proc_new(entry,data,size,stack) proc_new_with_name(NULL,(entry),(data),(size),(stack))
55 #define proc_new(entry,data,size,stack) proc_new_with_name(#entry,(entry),(data),(size),(stack))
59 void proc_switch(void);
61 struct Process* proc_current(void);
62 iptr_t proc_current_user_data(void);
63 void proc_rename(struct Process* proc, const char* name);
65 #if CONFIG_KERN_PREEMPTIVE
66 void proc_forbid(void);
67 void proc_permit(void);
69 INLINE void proc_forbid(void) { /* nop */ }
70 INLINE void proc_permit(void) { /* nop */ }
74 * Execute a block of \a CODE atomically with respect to task scheduling.
76 #define PROC_ATOMIC(CODE) \
83 #endif /* KERN_PROC_H */