1/* 2 * BK Id: SCCS/s.subr_prf.c 1.8 12/01/01 20:09:07 benh 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 22extern int xmon_write(void *, void *, int); 23 24void 25xmon_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 34void 35xmon_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 44void 45xmon_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 54void 55xmon_puts(char *s) 56{ 57 xmon_write(stdout, s, strlen(s)); 58} 59