Sistema l'errore da me commesso in fase di conversione...
[bertos.git] / kern / monitor.h
1 /**
2  * \file
3  * <!--
4  * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
5  * This file is part of DevLib - See README.devlib for information.
6  * -->
7  *
8  * \brief Monitor to check for stack overflows
9  *
10  * \version $Id$
11  *
12  * \author Giovanni Bajo <rasky@develer.com>
13  */
14
15 /*#*
16  *#* $Log$
17  *#* Revision 1.5  2006/07/19 12:56:27  bernie
18  *#* Convert to new Doxygen style.
19  *#*
20  *#* Revision 1.4  2006/02/24 01:17:05  bernie
21  *#* Update for new emulator.
22  *#*
23  *#* Revision 1.3  2005/11/04 16:20:02  bernie
24  *#* Fix reference to README.devlib in header.
25  *#*
26  *#* Revision 1.2  2005/04/11 19:10:28  bernie
27  *#* Include top-level headers from cfg/ subdir.
28  *#*
29  *#* Revision 1.1  2004/10/03 20:39:03  bernie
30  *#* Import in DevLib.
31  *#*
32  *#* Revision 1.1  2004/09/30 23:19:30  rasky
33  *#* Estratto il monitor degli stack da proc.c in due file a parte: monitor.c/h
34  *#* Rinominata monitor_debug_stacks in monitor_report
35  *#*
36  *#*/
37
38 #ifndef KERN_MONITOR_H
39 #define KERN_MONITOR_H
40
41 #include <cfg/cpu.h>
42 #include <config_kern.h>
43
44 #if CONFIG_KERN_MONITOR
45
46 /**
47  * Start the kernel monitor. It is a special process which checks every second the stacks of the
48  * running processes trying to detect stack overflows.
49  *
50  * \param stacksize Size of stack in chars
51  * \param stack Pointer to the stack that will be used by the monitor
52  *
53  * \note The stack is provided by the caller so that there is no wasted space if the monitor
54  * is not used.
55  */
56 void monitor_start(size_t stacksize, cpustack_t *stack);
57
58
59 /**
60  * Manually check if a given stack has overflown. This is used to check for stacks
61  * of processes handled externally form the kernel, or for other stacks (for instance
62  * the interrupt supervisor stack).
63  *
64  * \note For this function to work, the stack must have been filled at startup with
65  * CONFIG_KERN_STACKFILLCODE.
66  */
67 size_t monitor_checkStack(cpustack_t *stack_base, size_t stack_size);
68
69
70 /** Print a report of the stack status through kdebug */
71 void monitor_report(void);
72
73
74 #endif /* CONFIG_KERN_MONITOR */
75 #endif /* KERN_MONITOR_H */