d5866993a129372c105c3c267f4823355fa808c2
[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  * All Rights Reserved.
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.1  2004/05/23 17:27:00  bernie
19  * Import kern/ subdirectory.
20  *
21  */
22
23 #ifndef KERN_PROC_H
24 #define KERN_PROC_H
25
26 #include "compiler.h"
27 #include "cpu.h"
28 #include "config_kern.h"
29
30 /* Fwd decl */
31 struct Process;
32
33 /* Task scheduling services */
34 void proc_init(void);
35 struct Process *proc_new(void (*entry)(void), size_t stacksize, cpustack_t *stack);
36 void proc_exit(void);
37 void proc_switch(void);
38 void proc_test(void);
39 struct Process* proc_current(void);
40
41 #if CONFIG_KERN_PREEMPTIVE
42         #define FORBID proc_forbid()
43         #define PERMIT proc_permit()
44 #else
45         #define FORBID
46         #define PERMIT
47 #endif
48
49 #endif /* KERN_PROC_H */
50