2 * include/linux/kernel_debugger.h
4 * Copyright (C) 2008 Google, Inc.
6 * This software is licensed under the terms of the GNU General Public
7 * License version 2, as published by the Free Software Foundation, and
8 * may be copied, distributed, and modified under those terms.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
16 #ifndef _LINUX_KERNEL_DEBUGGER_H_
17 #define _LINUX_KERNEL_DEBUGGER_H_
20 int (*printf)(void *cookie, const char *fmt, ...);
24 /* kernel_debugger() is called from IRQ context and should
25 * use the kdbg_ctxt.printf to write output (do NOT call
26 * printk, do operations not safe from IRQ context, etc).
28 * kdbg_ctxt.printf will return -1 if there is not enough
29 * buffer space or if you are being aborted. In this case
30 * you must return as soon as possible.
32 * Return non-zero if more data is available -- if buffer
33 * space ran and you had to stop, but could print more,
36 * Additional calls where cmd is "more" will be made if
37 * the additional data is desired.
39 int kernel_debugger(struct kdbg_ctxt *ctxt, char *cmd);