ia64/linux-2.6.18-xen.hg

annotate arch/sparc/prom/printf.c @ 912:dd42cdb0ab89

[IA64] Build blktap2 driver by default in x86 builds.

add CONFIG_XEN_BLKDEV_TAP2=y to buildconfigs/linux-defconfig_xen_ia64.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author Isaku Yamahata <yamahata@valinux.co.jp>
date Mon Jun 29 12:09:16 2009 +0900 (2009-06-29)
parents 831230e53067
children
rev   line source
ian@0 1 /*
ian@0 2 * printf.c: Internal prom library printf facility.
ian@0 3 *
ian@0 4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
ian@0 5 * Copyright (c) 2002 Pete Zaitcev (zaitcev@yahoo.com)
ian@0 6 *
ian@0 7 * We used to warn all over the code: DO NOT USE prom_printf(),
ian@0 8 * and yet people do. Anton's banking code was outputing banks
ian@0 9 * with prom_printf for most of the 2.4 lifetime. Since an effective
ian@0 10 * stick is not available, we deployed a carrot: an early printk
ian@0 11 * through PROM by means of -p boot option. This ought to fix it.
ian@0 12 * USE printk; if you need, deploy -p.
ian@0 13 */
ian@0 14
ian@0 15 #include <linux/kernel.h>
ian@0 16
ian@0 17 #include <asm/openprom.h>
ian@0 18 #include <asm/oplib.h>
ian@0 19
ian@0 20 static char ppbuf[1024];
ian@0 21
ian@0 22 void
ian@0 23 prom_write(const char *buf, unsigned int n)
ian@0 24 {
ian@0 25 char ch;
ian@0 26
ian@0 27 while (n != 0) {
ian@0 28 --n;
ian@0 29 if ((ch = *buf++) == '\n')
ian@0 30 prom_putchar('\r');
ian@0 31 prom_putchar(ch);
ian@0 32 }
ian@0 33 }
ian@0 34
ian@0 35 void
ian@0 36 prom_printf(char *fmt, ...)
ian@0 37 {
ian@0 38 va_list args;
ian@0 39 int i;
ian@0 40
ian@0 41 va_start(args, fmt);
ian@0 42 i = vscnprintf(ppbuf, sizeof(ppbuf), fmt, args);
ian@0 43 va_end(args);
ian@0 44
ian@0 45 prom_write(ppbuf, i);
ian@0 46 }