1 /*	$MirOS: src/sys/ddb/db_output.h,v 1.2 2013/10/31 20:06:49 tg Exp $ */
2 /*	$OpenBSD: db_output.h,v 1.14 2003/08/24 01:27:07 avsm Exp $ */
3 /*	$NetBSD: db_output.h,v 1.9 1996/04/04 05:13:50 cgd Exp $	*/
4 
5 /*
6  * Mach Operating System
7  * Copyright © 2013
8  *	Thorsten “mirabilos” Glaser <tg@mirbsd.org>
9  * Copyright (c) 1993,1992,1991,1990 Carnegie Mellon University
10  * All Rights Reserved.
11  *
12  * Permission to use, copy, modify and distribute this software and its
13  * documentation is hereby granted, provided that both the copyright
14  * notice and this permission notice appear in all copies of the
15  * software, derivative works or modified versions, and any portions
16  * thereof, and that both notices appear in supporting documentation.
17  *
18  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
19  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
20  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21  *
22  * Carnegie Mellon requests users of this software to return to
23  *
24  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
25  *  School of Computer Science
26  *  Carnegie Mellon University
27  *  Pittsburgh PA 15213-3890
28  *
29  * any improvements or extensions that they make and grant Carnegie Mellon
30  * the rights to redistribute these changes.
31  *
32  * 	Author: David B. Golub, Carnegie Mellon University
33  *	Date:	8/90
34  */
35 
36 /*
37  * Printing routines for kernel debugger.
38  */
39 void db_force_whitespace(void);
40 void db_putchar(int);
41 int db_print_position(void);
42 int db_printf(const char *, ...)
43     __attribute__((__format__(__kprintf__, 1, 2)));
44 void db_end_line(int);
45 
46 extern int db_log;
47 
48 /*
49  * This is a replacement for the non-standard %z, %n and %r printf formats
50  * in db_printf.
51  *
52  * db_format(buf, bufsize, val, format, alt, width)
53  *
54  * val is the value we want printed.
55  * format is one of DB_FORMAT_[ZRN]
56  * alt specifies if we should provide an "alternate" format (# in the printf
57  *   format).
58  * width is the field width. 0 is the same as no width specifier.
59  */
60 #define DB_FORMAT_Z	1
61 #define DB_FORMAT_R	2
62 #define DB_FORMAT_N	3
63 #define DB_FORMAT_BUF_SIZE	64	/* should be plenty for all formats */
64 char *db_format(char *, size_t, long, int, int, int);
65 
66 /* XXX - this is the wrong place, but we have no better. */
67 void db_stack_dump(void);
68