| @@ -1,35 +1,37 @@ | | | @@ -1,35 +1,37 @@ |
1 | /* $NetBSD: printf.c,v 1.3 2011/07/21 11:04:24 joerg Exp $ */ | | 1 | /* $NetBSD: printf.c,v 1.4 2014/02/23 07:49:04 martin Exp $ */ |
2 | /*- | | 2 | /*- |
3 | * Copyright (c) 1998 Robert Nordier | | 3 | * Copyright (c) 1998 Robert Nordier |
4 | * All rights reserved. | | 4 | * All rights reserved. |
5 | * Copyright (c) 2006 M. Warner Losh | | 5 | * Copyright (c) 2006 M. Warner Losh |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms are freely | | 8 | * Redistribution and use in source and binary forms are freely |
9 | * permitted provided that the above copyright notice and this | | 9 | * permitted provided that the above copyright notice and this |
10 | * paragraph and the following disclaimer are duplicated in all | | 10 | * paragraph and the following disclaimer are duplicated in all |
11 | * such forms. | | 11 | * such forms. |
12 | * | | 12 | * |
13 | * This software is provided "AS IS" and without any express or | | 13 | * This software is provided "AS IS" and without any express or |
14 | * implied warranties, including, without limitation, the implied | | 14 | * implied warranties, including, without limitation, the implied |
15 | * warranties of merchantability and fitness for a particular | | 15 | * warranties of merchantability and fitness for a particular |
16 | * purpose. | | 16 | * purpose. |
17 | * | | 17 | * |
18 | * $FreeBSD: src/sys/boot/mips/emips/libemips/printf.c,v 1.2 2006/10/20 09:12:05 imp Exp $ | | 18 | * $FreeBSD: src/sys/boot/mips/emips/libemips/printf.c,v 1.2 2006/10/20 09:12:05 imp Exp $ |
19 | */ | | 19 | */ |
20 | | | 20 | |
21 | #include <lib/libsa/stand.h> | | 21 | #include <lib/libsa/stand.h> |
22 | | | 22 | |
| | | 23 | void xputchar(int); |
| | | 24 | |
23 | void | | 25 | void |
24 | xputchar(int ch) | | 26 | xputchar(int ch) |
25 | { | | 27 | { |
26 | if (ch == '\n') | | 28 | if (ch == '\n') |
27 | putchar('\r'); | | 29 | putchar('\r'); |
28 | putchar(ch); | | 30 | putchar(ch); |
29 | } | | 31 | } |
30 | | | 32 | |
31 | void | | 33 | void |
32 | printf(const char *fmt,...) | | 34 | printf(const char *fmt,...) |
33 | { | | 35 | { |
34 | va_list ap; | | 36 | va_list ap; |
35 | const char *hex = "0123456789abcdef"; | | 37 | const char *hex = "0123456789abcdef"; |