1/* $Id: printf.c,v 1.1.1.1 2008/10/15 03:26:19 james26_jang Exp $ 2 * printf.c: Internal prom library printf facility. 3 * 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) 5 */ 6 7/* This routine is internal to the prom library, no one else should know 8 * about or use it! It's simple and smelly anyway.... 9 */ 10 11#include <linux/kernel.h> 12 13#include <asm/openprom.h> 14#include <asm/oplib.h> 15 16static char ppbuf[1024]; 17 18void 19prom_printf(char *fmt, ...) 20{ 21 va_list args; 22 char ch, *bptr; 23 int i; 24 25 va_start(args, fmt); 26 i = vsprintf(ppbuf, fmt, args); 27 28 bptr = ppbuf; 29 30 while((ch = *(bptr++)) != 0) { 31 if(ch == '\n') 32 prom_putchar('\r'); 33 34 prom_putchar(ch); 35 } 36 va_end(args); 37 return; 38} 39