aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2010-08-03 12:12:47 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2010-08-04 07:02:32 -0400
commit76fdf67bb5415a8e97bfecf81bf0c0d64bf7a552 (patch)
treef948a07a3490eafc7c45f34ca4828a7628414075 /arch
parentac93f62179ecb82739ab7c76857c4ae44e0cb83f (diff)
CRIS: Avoid compilation warning for puts
Rename to aputs. Also, simplify code by moving some common code out to macros. Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/cris/boot/compressed/misc.c65
1 files changed, 25 insertions, 40 deletions
diff --git a/arch/cris/boot/compressed/misc.c b/arch/cris/boot/compressed/misc.c
index 47bc190ba6d4..548d886b03d3 100644
--- a/arch/cris/boot/compressed/misc.c
+++ b/arch/cris/boot/compressed/misc.c
@@ -106,7 +106,7 @@ static unsigned outcnt = 0; /* bytes in output buffer */
106 106
107static void flush_window(void); 107static void flush_window(void);
108static void error(char *m); 108static void error(char *m);
109static void puts(const char *); 109static void aputs(const char *s);
110 110
111extern char *input_data; /* lives in head.S */ 111extern char *input_data; /* lives in head.S */
112 112
@@ -137,52 +137,37 @@ static inline void serout(const char *s, reg_scope_instances regi_ser)
137 137
138 REG_WR(ser, regi_ser, rw_dout, dout); 138 REG_WR(ser, regi_ser, rw_dout, dout);
139} 139}
140#define SEROUT(S, N) \
141 do { \
142 serout(S, regi_ser ## N); \
143 s++; \
144 } while (0)
145#else
146#define SEROUT(S, N) do { \
147 while (!(*R_SERIAL ## N ## _STATUS & (1 << 5))) \
148 ; \
149 *R_SERIAL ## N ## _TR_DATA = *s++; \
150 } while (0)
140#endif 151#endif
141 152
142static void puts(const char *s) 153static void aputs(const char *s)
143{ 154{
144#ifndef CONFIG_ETRAX_DEBUG_PORT_NULL 155#ifndef CONFIG_ETRAX_DEBUG_PORT_NULL
145 while (*s) { 156 while (*s) {
146#ifdef CONFIG_ETRAX_DEBUG_PORT0 157#ifdef CONFIG_ETRAX_DEBUG_PORT0
147#ifdef CONFIG_ETRAX_ARCH_V32 158 SEROUT(s, 0);
148 serout(s, regi_ser0);
149#else
150 while (!(*R_SERIAL0_STATUS & (1 << 5)))
151 ;
152 *R_SERIAL0_TR_DATA = *s++;
153#endif
154#endif 159#endif
155#ifdef CONFIG_ETRAX_DEBUG_PORT1 160#ifdef CONFIG_ETRAX_DEBUG_PORT1
156#ifdef CONFIG_ETRAX_ARCH_V32 161 SEROUT(s, 1);
157 serout(s, regi_ser1);
158#else
159 while (!(*R_SERIAL1_STATUS & (1 << 5)))
160 ;
161 *R_SERIAL1_TR_DATA = *s++;
162#endif
163#endif 162#endif
164#ifdef CONFIG_ETRAX_DEBUG_PORT2 163#ifdef CONFIG_ETRAX_DEBUG_PORT2
165#ifdef CONFIG_ETRAX_ARCH_V32 164 SEROUT(s, 2);
166 serout(s, regi_ser2);
167#else
168 while (!(*R_SERIAL2_STATUS & (1 << 5)))
169 ;
170 *R_SERIAL2_TR_DATA = *s++;
171#endif
172#endif 165#endif
173#ifdef CONFIG_ETRAX_DEBUG_PORT3 166#ifdef CONFIG_ETRAX_DEBUG_PORT3
174#ifdef CONFIG_ETRAX_ARCH_V32 167 SEROUT(s, 3);
175 serout(s, regi_ser3);
176#else
177 while (!(*R_SERIAL3_STATUS & (1 << 5)))
178 ;
179 *R_SERIAL3_TR_DATA = *s++;
180#endif 168#endif
181#endif
182 *s++;
183 } 169 }
184/* CONFIG_ETRAX_DEBUG_PORT_NULL */ 170#endif /* CONFIG_ETRAX_DEBUG_PORT_NULL */
185#endif
186} 171}
187 172
188void *memset(void *s, int c, size_t n) 173void *memset(void *s, int c, size_t n)
@@ -233,9 +218,9 @@ static void flush_window(void)
233 218
234static void error(char *x) 219static void error(char *x)
235{ 220{
236 puts("\n\n"); 221 aputs("\n\n");
237 puts(x); 222 aputs(x);
238 puts("\n\n -- System halted\n"); 223 aputs("\n\n -- System halted\n");
239 224
240 while(1); /* Halt */ 225 while(1); /* Halt */
241} 226}
@@ -378,14 +363,14 @@ void decompress_kernel(void)
378 __asm__ volatile ("move $vr,%0" : "=rm" (revision)); 363 __asm__ volatile ("move $vr,%0" : "=rm" (revision));
379 if (revision < compile_rev) { 364 if (revision < compile_rev) {
380#ifdef CONFIG_ETRAX_ARCH_V32 365#ifdef CONFIG_ETRAX_ARCH_V32
381 puts("You need an ETRAX FS to run Linux 2.6/crisv32\n"); 366 aputs("You need at least ETRAX FS to run Linux 2.6/crisv32\n");
382#else 367#else
383 puts("You need an ETRAX 100LX to run linux 2.6\n"); 368 aputs("You need an ETRAX 100LX to run linux 2.6/crisv10\n");
384#endif 369#endif
385 while(1); 370 while(1);
386 } 371 }
387 372
388 puts("Uncompressing Linux...\n"); 373 aputs("Uncompressing Linux...\n");
389 gunzip(); 374 gunzip();
390 puts("Done. Now booting the kernel\n"); 375 aputs("Done. Now booting the kernel\n");
391} 376}