diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2007-03-01 06:56:43 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2007-03-04 14:02:37 -0500 |
commit | 36a885306fdf7bb557c773309c993bfb2d0d693c (patch) | |
tree | 643b246c90653c9451ff7fecff74a79c3de8042c /arch/mips/mips-boards/sim/sim_printf.c | |
parent | ca471c86043f4a8b01cba02ba2d3431fddcaf606 (diff) |
[MIPS] Fix and cleanup the mess that a dozen prom_printf variants are.
early_printk is a so much saner thing.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/mips-boards/sim/sim_printf.c')
-rw-r--r-- | arch/mips/mips-boards/sim/sim_printf.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/arch/mips/mips-boards/sim/sim_printf.c b/arch/mips/mips-boards/sim/sim_printf.c deleted file mode 100644 index 3ee5a0b501a6..000000000000 --- a/arch/mips/mips-boards/sim/sim_printf.c +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | /* | ||
2 | * Carsten Langgaard, carstenl@mips.com | ||
3 | * Copyright (C) 1999,2000 MIPS Technologies, Inc. All rights reserved. | ||
4 | * | ||
5 | * This program is free software; you can distribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License (Version 2) as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
12 | * for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along | ||
15 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | ||
17 | * | ||
18 | * Putting things on the screen/serial line using YAMONs facilities. | ||
19 | */ | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/kernel.h> | ||
22 | #include <linux/serial_reg.h> | ||
23 | #include <linux/spinlock.h> | ||
24 | #include <asm/io.h> | ||
25 | #include <asm/system.h> | ||
26 | |||
27 | static inline unsigned int serial_in(int offset) | ||
28 | { | ||
29 | return inb(0x3f8 + offset); | ||
30 | } | ||
31 | |||
32 | static inline void serial_out(int offset, int value) | ||
33 | { | ||
34 | outb(value, 0x3f8 + offset); | ||
35 | } | ||
36 | |||
37 | int putPromChar(char c) | ||
38 | { | ||
39 | while ((serial_in(UART_LSR) & UART_LSR_THRE) == 0) | ||
40 | ; | ||
41 | |||
42 | serial_out(UART_TX, c); | ||
43 | |||
44 | return 1; | ||
45 | } | ||
46 | |||
47 | char getPromChar(void) | ||
48 | { | ||
49 | while (!(serial_in(UART_LSR) & 1)) | ||
50 | ; | ||
51 | |||
52 | return serial_in(UART_RX); | ||
53 | } | ||
54 | |||
55 | void prom_printf(char *fmt, ...) | ||
56 | { | ||
57 | va_list args; | ||
58 | int l; | ||
59 | char *p, *buf_end; | ||
60 | char buf[1024]; | ||
61 | |||
62 | va_start(args, fmt); | ||
63 | l = vsprintf(buf, fmt, args); /* hopefully i < sizeof(buf) */ | ||
64 | va_end(args); | ||
65 | |||
66 | buf_end = buf + l; | ||
67 | |||
68 | for (p = buf; p < buf_end; p++) { | ||
69 | /* Crude cr/nl handling is better than none */ | ||
70 | if (*p == '\n') | ||
71 | putPromChar('\r'); | ||
72 | putPromChar(*p); | ||
73 | } | ||
74 | } | ||