source: trunk/kernel/kern/printk.h @ 2

Last change on this file since 2 was 1, checked in by alain, 8 years ago

First import

File size: 4.1 KB
Line 
1/*
2 * printk.h - Kernel Log & debug messages API definition.
3 *
4 * authors  Alain Greiner (2016)
5 *
6 * Copyright (c) UPMC Sorbonne Universites
7 *
8 * This file is part of ALMOS-MKH.
9 *
10 * ALMOS-MKH is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; version 2.0 of the License.
13 *
14 * ALMOS-MKH is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with ALMOS-MKH; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 */
23
24///////////////////////////////////////////////////////////////////////////////////
25// The printk.c and printk.h files define the functions used by the kernel
26// to display messages on the kernel text terminal, using a busy waiting
27// policy if required : these functions does not use the TXT kernel thread,
28// and does not deschedule if TXT peripheral is not available.
29// These functions use the generic TXT device to call the proper implementation
30// dependant TXT driver.
31///////////////////////////////////////////////////////////////////////////////////
32
33#ifndef _PRINTK_H
34#define _PRINTK_H
35
36///////////////////////////////////////////////////////////////////////////////////
37//       Access functions to kernel terminal TTY0
38///////////////////////////////////////////////////////////////////////////////////
39
40extern void         printk( char* format, ... );
41
42extern void         nolock_printk( char* format, ... );
43
44extern void         user_printk( char* format, ... );
45
46///////////////////////////////////////////////////////////////////////////////////
47//       Conditionnal debug macros
48///////////////////////////////////////////////////////////////////////////////////
49
50#if CONFIG_CORE_DEBUG
51#define core_dmsg(...)   printk(__VA__ARGS__)
52#else
53#define core_dmsg(...)
54#endif
55
56#if CONFIG_DQDT_DEBUG
57#define dqdt_dmsg(...)   printk(__VA__ARGS__)
58#else
59#define dqdt_dmsg(...)
60#endif
61
62#if CONFIG_ELF_DEBUG
63#define elf_dmsg(...)   printk(__VA__ARGS__)
64#else
65#define elf_dmsg(...)
66#endif
67
68#if CONFIG_FORK_DEBUG
69#define fork_dmsg(...)   printk(__VA__ARGS__)
70#else
71#define fork_dmsg(...)
72#endif
73
74#if CONFIG_EXEC_DEBUG
75#define exec_dmsg(...)   printk(__VA__ARGS__)
76#else
77#define exec_dmsg(...)
78#endif
79
80#if CONFIG_ICU_DEBUG
81#define icu_dmsg(...)   printk(__VA__ARGS__)
82#else
83#define icu_dmsg(...)
84#endif
85
86#if CONFIG_IOC_DEBUG
87#define ioc_dmsg(...)   printk(__VA__ARGS__)
88#else
89#define ioc_dmsg(...)
90#endif
91
92#if CONFIG_KINIT_DEBUG
93#define kinit_dmsg(...) printk(__VA_ARGS__)
94#else
95#define kinit_dmsg(...)
96#endif
97
98#if CONFIG_KMEM_DEBUG
99#define kmem_dmsg(...) printk(__VA_ARGS__)
100#else
101#define kmem_dmsg(...)
102#endif
103
104#if CONFIG_MMC_DEBUG
105#define mmc_dmsg(...)   printk(__VA__ARGS__)
106#else
107#define mmc_dmsg(...)
108#endif
109
110#if CONFIG_NIC_DEBUG
111#define nic_dmsg(...)   printk(__VA__ARGS__)
112#else
113#define nic_dmsg(...)
114#endif
115
116#if CONFIG_PIC_DEBUG
117#define pic_dmsg(...)   printk(__VA__ARGS__)
118#else
119#define pic_dmsg(...)
120#endif
121
122#if CONFIG_PROCESS_DEBUG
123#define process_dmsg(...)   printk(__VA__ARGS__)
124#else
125#define process_dmsg(...)
126#endif
127
128#if CONFIG_RPC_DEBUG
129#define rpc_dmsg(...)   printk(__VA__ARGS__)
130#else
131#define rpc_dmsg(...)
132#endif
133
134#if CONFIG_SCHED_DEBUG
135#define sched_dmsg(...)   printk(__VA__ARGS__)
136#else
137#define sched_dmsg(...)
138#endif
139
140#if CONFIG_THREAD_DEBUG
141#define thread_dmsg(...)   printk(__VA__ARGS__)
142#else
143#define thread_dmsg(...)
144#endif
145
146#if CONFIG_TXT_DEBUG
147#define txt_dmsg(...)   printk(__VA__ARGS__)
148#else
149#define txt_dmsg(...)
150#endif
151
152#if CONFIG_VFS_DEBUG
153#define vfs_dmsg(...)   printk(__VA__ARGS__)
154#else
155#define vfs_dmsg(...)
156#endif
157
158#if CONFIG_VMM_DEBUG
159#define vmm_dmsg(...)   printk(__VA__ARGS__)
160#else
161#define vmm_dmsg(...)
162#endif
163
164
165#endif  // _PRINTK_H
166
167// Local Variables:
168// tab-width: 4
169// c-basic-offset: 4
170// c-file-offsets:((innamespace . 0)(inline-open . 0))
171// indent-tabs-mode: nil
172// End:
173// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
174
Note: See TracBrowser for help on using the repository browser.