fix to allow usb modules to compile
[linux-2.4.21-pre4.git] / arch / ppc / xmon / subr_prf.c
1 /*
2  * BK Id: SCCS/s.subr_prf.c 1.10 12/27/01 10:38:52 trini
3  */
4 /*
5  * Written by Cort Dougan to replace the version originally used
6  * by Paul Mackerras, which came from NetBSD and thus had copyright
7  * conflicts with Linux.
8  *
9  * This file makes liberal use of the standard linux utility
10  * routines to reduce the size of the binary.  We assume we can
11  * trust some parts of Linux inside the debugger.
12  *   -- Cort (cort@cs.nmt.edu)
13  *
14  * Copyright (C) 1999 Cort Dougan.
15  */
16
17 #include <linux/kernel.h>
18 #include <linux/string.h>
19 #include <stdarg.h>
20 #include "nonstdio.h"
21
22 extern int xmon_write(void *, void *, int);
23
24 void
25 xmon_vfprintf(void *f, const char *fmt, va_list ap)
26 {
27         static char xmon_buf[2048];
28         int n;
29
30         n = vsprintf(xmon_buf, fmt, ap);
31         xmon_write(f, xmon_buf, n);
32 }
33
34 void
35 xmon_printf(const char *fmt, ...)
36 {
37         va_list ap;
38
39         va_start(ap, fmt);
40         xmon_vfprintf(stdout, fmt, ap);
41         va_end(ap);
42 }
43
44 void
45 xmon_fprintf(void *f, const char *fmt, ...)
46 {
47         va_list ap;
48
49         va_start(ap, fmt);
50         xmon_vfprintf(f, fmt, ap);
51         va_end(ap);
52 }
53
54 void
55 xmon_puts(char *s)
56 {
57         xmon_write(stdout, s, strlen(s));
58 }