root/arch/sparc/prom/printf.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. prom_printf

   1 /* $Id: printf.c,v 1.5 1996/04/04 16:31:07 tridge 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/config.h>
  12 #include <linux/kernel.h>
  13 
  14 #include <asm/openprom.h>
  15 #include <asm/oplib.h>
  16 
  17 static char ppbuf[1024];
  18 
  19 void
  20 prom_printf(char *fmt, ...)
     /* [previous][next][first][last][top][bottom][index][help] */
  21 {
  22         va_list args;
  23         char ch, *bptr;
  24         int i;
  25 
  26         va_start(args, fmt);
  27         i = vsprintf(ppbuf, fmt, args);
  28 
  29         bptr = ppbuf;
  30 
  31 #if CONFIG_AP1000
  32         ap_write(1,bptr,strlen(bptr));
  33 #else
  34         while((ch = *(bptr++)) != 0) {
  35                 if(ch == '\n')
  36                         prom_putchar('\r');
  37 
  38                 prom_putchar(ch);
  39         }
  40 #endif
  41         va_end(args);
  42         return;
  43 }

/* [previous][next][first][last][top][bottom][index][help] */