promlib.c 343 B

123456789101112131415161718192021222324
  1. #include <stdarg.h>
  2. #include <linux/kernel.h>
  3. extern void prom_putchar(char);
  4. void prom_printf(char *fmt, ...)
  5. {
  6. va_list args;
  7. char ppbuf[1024];
  8. char *bptr;
  9. va_start(args, fmt);
  10. vsprintf(ppbuf, fmt, args);
  11. bptr = ppbuf;
  12. while (*bptr != 0) {
  13. if (*bptr == '\n')
  14. prom_putchar('\r');
  15. prom_putchar(*bptr++);
  16. }
  17. va_end(args);
  18. }