Fix reference to README.devlib in header.
[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.3  2005/11/04 16:20:02  bernie
18  *#* Fix reference to README.devlib in header.
19  *#*
20  *#* Revision 1.2  2005/04/11 19:10:28  bernie
21  *#* Include top-level headers from cfg/ subdir.
22  *#*
23  *#* Revision 1.1  2004/10/03 20:39:03  bernie
24  *#* Import in DevLib.
25  *#*
26  *#* Revision 1.1  2004/09/30 23:19:30  rasky
27  *#* Estratto il monitor degli stack da proc.c in due file a parte: monitor.c/h
28  *#* Rinominata monitor_debug_stacks in monitor_report
29  *#*
30  *#*/
31
32 #ifndef KERN_MONITOR_H
33 #define KERN_MONITOR_H
34
35 #include <cfg/cpu.h>
36 #include <cfg/config_kern.h>
37
38 #if CONFIG_KERN_MONITOR
39
40 /*!
41  * Start the kernel monitor. It is a special process which checks every second the stacks of the
42  * running processes trying to detect stack overflows.
43  *
44  * \param stacksize Size of stack in chars
45  * \param stack Pointer to the stack that will be used by the monitor
46  *
47  * \note The stack is provided by the caller so that there is no wasted space if the monitor
48  * is not used.
49  */
50 void monitor_start(size_t stacksize, cpustack_t *stack);
51
52
53 /*!
54  * Manually check if a given stack has overflown. This is used to check for stacks
55  * of processes handled externally form the kernel, or for other stacks (for instance
56  * the interrupt supervisor stack).
57  *
58  * \note For this function to work, the stack must have been filled at startup with
59  * CONFIG_KERN_STACKFILLCODE.
60  */
61 size_t monitor_check_stack(cpustack_t* stack_base, size_t stack_size);
62
63
64 /*! Print a report of the stack status through kdebug */
65 void monitor_report(void);
66
67
68 #endif /* CONFIG_KERN_MONITOR */
69 #endif /* KERN_MONITOR_H */