584358d8455db4b193b521fb1779b31b9ba1ec38
[bertos.git] / kern / proc.h
1 /*!
2  * \file
3  * <!--
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.
7  * -->
8  *
9  * \brief Process scheduler (public interface).
10  *
11  * \version $Id$
12  *
13  * \author Bernardo Innocenti <bernie@develer.com>
14  */
15
16 /*
17  * $Log$
18  * Revision 1.2  2004/06/03 11:27:09  bernie
19  * Add dual-license information.
20  *
21  * Revision 1.1  2004/05/23 17:27:00  bernie
22  * Import kern/ subdirectory.
23  *
24  */
25
26 #ifndef KERN_PROC_H
27 #define KERN_PROC_H
28
29 #include "compiler.h"
30 #include "cpu.h"
31 #include "config_kern.h"
32
33 /* Fwd decl */
34 struct Process;
35
36 /* Task scheduling services */
37 void proc_init(void);
38 struct Process *proc_new(void (*entry)(void), size_t stacksize, cpustack_t *stack);
39 void proc_exit(void);
40 void proc_switch(void);
41 void proc_test(void);
42 struct Process* proc_current(void);
43
44 #if CONFIG_KERN_PREEMPTIVE
45         #define FORBID proc_forbid()
46         #define PERMIT proc_permit()
47 #else
48         #define FORBID
49         #define PERMIT
50 #endif
51
52 #endif /* KERN_PROC_H */
53