diff options
Diffstat (limited to 'arch/mips/au1000/common/puts.c')
-rw-r--r-- | arch/mips/au1000/common/puts.c | 77 |
1 files changed, 1 insertions, 76 deletions
diff --git a/arch/mips/au1000/common/puts.c b/arch/mips/au1000/common/puts.c index c2ae4624b77b..2705829cd466 100644 --- a/arch/mips/au1000/common/puts.c +++ b/arch/mips/au1000/common/puts.c | |||
@@ -39,7 +39,6 @@ | |||
39 | #define TIMEOUT 0xffffff | 39 | #define TIMEOUT 0xffffff |
40 | #define SLOW_DOWN | 40 | #define SLOW_DOWN |
41 | 41 | ||
42 | static const char digits[16] = "0123456789abcdef"; | ||
43 | static volatile unsigned long * const com1 = (unsigned long *)SERIAL_BASE; | 42 | static volatile unsigned long * const com1 = (unsigned long *)SERIAL_BASE; |
44 | 43 | ||
45 | 44 | ||
@@ -54,7 +53,7 @@ static inline void slow_down(void) | |||
54 | #endif | 53 | #endif |
55 | 54 | ||
56 | void | 55 | void |
57 | putch(const unsigned char c) | 56 | prom_putchar(const unsigned char c) |
58 | { | 57 | { |
59 | unsigned char ch; | 58 | unsigned char ch; |
60 | int i = 0; | 59 | int i = 0; |
@@ -69,77 +68,3 @@ putch(const unsigned char c) | |||
69 | } while (0 == (ch & TX_BUSY)); | 68 | } while (0 == (ch & TX_BUSY)); |
70 | com1[SER_DATA] = c; | 69 | com1[SER_DATA] = c; |
71 | } | 70 | } |
72 | |||
73 | void | ||
74 | puts(unsigned char *cp) | ||
75 | { | ||
76 | unsigned char ch; | ||
77 | int i = 0; | ||
78 | |||
79 | while (*cp) { | ||
80 | do { | ||
81 | ch = com1[SER_CMD]; | ||
82 | slow_down(); | ||
83 | i++; | ||
84 | if (i>TIMEOUT) { | ||
85 | break; | ||
86 | } | ||
87 | } while (0 == (ch & TX_BUSY)); | ||
88 | com1[SER_DATA] = *cp++; | ||
89 | } | ||
90 | putch('\r'); | ||
91 | putch('\n'); | ||
92 | } | ||
93 | |||
94 | void | ||
95 | fputs(const char *cp) | ||
96 | { | ||
97 | unsigned char ch; | ||
98 | int i = 0; | ||
99 | |||
100 | while (*cp) { | ||
101 | |||
102 | do { | ||
103 | ch = com1[SER_CMD]; | ||
104 | slow_down(); | ||
105 | i++; | ||
106 | if (i>TIMEOUT) { | ||
107 | break; | ||
108 | } | ||
109 | } while (0 == (ch & TX_BUSY)); | ||
110 | com1[SER_DATA] = *cp++; | ||
111 | } | ||
112 | } | ||
113 | |||
114 | |||
115 | void | ||
116 | put64(uint64_t ul) | ||
117 | { | ||
118 | int cnt; | ||
119 | unsigned ch; | ||
120 | |||
121 | cnt = 16; /* 16 nibbles in a 64 bit long */ | ||
122 | putch('0'); | ||
123 | putch('x'); | ||
124 | do { | ||
125 | cnt--; | ||
126 | ch = (unsigned char)(ul >> cnt * 4) & 0x0F; | ||
127 | putch(digits[ch]); | ||
128 | } while (cnt > 0); | ||
129 | } | ||
130 | |||
131 | void | ||
132 | put32(unsigned u) | ||
133 | { | ||
134 | int cnt; | ||
135 | unsigned ch; | ||
136 | |||
137 | cnt = 8; /* 8 nibbles in a 32 bit long */ | ||
138 | putch('0'); | ||
139 | putch('x'); | ||
140 | do { | ||
141 | cnt--; | ||
142 | ch = (unsigned char)(u >> cnt * 4) & 0x0F; | ||
143 | putch(digits[ch]); | ||
144 | } while (cnt > 0); | ||
145 | } | ||