Xenomai  3.1
debug.h
1 /*
2  * Copyright (C) 2010 Philippe Gerum <rpm@xenomai.org>.
3  *
4  * Xenomai is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published
6  * by the Free Software Foundation; either version 2 of the License,
7  * or (at your option) any later version.
8  *
9  * Xenomai is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with Xenomai; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
17  * 02111-1307, USA.
18  */
19 
20 #ifndef _KERNEL_COBALT_DEBUG_H
21 #define _KERNEL_COBALT_DEBUG_H
22 
23 #include <cobalt/kernel/assert.h>
24 
25 struct xnthread;
26 
27 #ifdef CONFIG_XENO_OPT_DEBUG
28 
29 int xndebug_init(void);
30 
31 void xndebug_cleanup(void);
32 
33 void xndebug_shadow_init(struct xnthread *thread);
34 
35 extern struct xnvfile_directory cobalt_debug_vfroot;
36 
37 #else /* !XENO_OPT_DEBUG */
38 
39 static inline int xndebug_init(void)
40 {
41  return 0;
42 }
43 
44 static inline void xndebug_cleanup(void)
45 {
46 }
47 
48 static inline void xndebug_shadow_init(struct xnthread *thread)
49 {
50 }
51 
52 #endif /* !XENO_OPT_DEBUG */
53 
54 #ifdef CONFIG_XENO_OPT_DEBUG_TRACE_RELAX
55 void xndebug_notify_relax(struct xnthread *thread,
56  int reason);
57 void xndebug_trace_relax(int nr, unsigned long *backtrace,
58  int reason);
59 #else
60 static inline
61 void xndebug_notify_relax(struct xnthread *thread, int reason)
62 {
63 }
64 static inline
65 void xndebug_trace_relax(int nr, unsigned long *backtrace,
66  int reason)
67 {
68  /* Simply ignore. */
69 }
70 #endif
71 
72 #endif /* !_KERNEL_COBALT_DEBUG_H */