4 * Copyright 2004 Develer S.r.l. (http://www.develer.com/)
5 * This file is part of DevLib - See README.devlib for information.
8 * \brief Monitor to check for stack overflows
12 * \author Giovanni Bajo <rasky@develer.com>
17 *#* Revision 1.4 2006/02/24 01:17:05 bernie
18 *#* Update for new emulator.
20 *#* Revision 1.3 2005/11/04 16:20:02 bernie
21 *#* Fix reference to README.devlib in header.
23 *#* Revision 1.2 2005/04/11 19:10:28 bernie
24 *#* Include top-level headers from cfg/ subdir.
26 *#* Revision 1.1 2004/10/03 20:39:03 bernie
29 *#* Revision 1.1 2004/09/30 23:19:30 rasky
30 *#* Estratto il monitor degli stack da proc.c in due file a parte: monitor.c/h
31 *#* Rinominata monitor_debug_stacks in monitor_report
35 #ifndef KERN_MONITOR_H
36 #define KERN_MONITOR_H
39 #include <config_kern.h>
41 #if CONFIG_KERN_MONITOR
44 * Start the kernel monitor. It is a special process which checks every second the stacks of the
45 * running processes trying to detect stack overflows.
47 * \param stacksize Size of stack in chars
48 * \param stack Pointer to the stack that will be used by the monitor
50 * \note The stack is provided by the caller so that there is no wasted space if the monitor
53 void monitor_start(size_t stacksize, cpustack_t *stack);
57 * Manually check if a given stack has overflown. This is used to check for stacks
58 * of processes handled externally form the kernel, or for other stacks (for instance
59 * the interrupt supervisor stack).
61 * \note For this function to work, the stack must have been filled at startup with
62 * CONFIG_KERN_STACKFILLCODE.
64 size_t monitor_checkStack(cpustack_t *stack_base, size_t stack_size);
67 /*! Print a report of the stack status through kdebug */
68 void monitor_report(void);
71 #endif /* CONFIG_KERN_MONITOR */
72 #endif /* KERN_MONITOR_H */