[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[microblaze-uclinux] [patch] xmbserial: enable db_print() and friends when debug
Hi,
this patch move db_print() and friends within #ifdef
CONFIG_MICROBLAZE_DEBUG_UART.
--
yashi
---
* move db_print() and friends to DEBUG_UART
xmbserial.c | 44 +++++++++++++++++++++++---------------------
1 files changed, 23 insertions(+), 21 deletions(-)
Index: linux-suzaku/arch/microblaze/kernel/xmbserial.c
===================================================================
--- linux-suzaku.orig/arch/microblaze/kernel/xmbserial.c 2004-08-16 21:15:00.024302957 +0900
+++ linux-suzaku/arch/microblaze/kernel/xmbserial.c 2004-08-16 21:20:00.034872078 +0900
@@ -107,6 +107,7 @@ static int xmbrs_serial_refcount;
#define db_print_char(x)
#endif
+#ifdef CONFIG_MICROBLAZE_DEBUG_UART
void SendByte(volatile unsigned int *baseaddr, unsigned char x)
{
while(baseaddr[XUL_STATUS_REG_OFFSET/4] & XUL_SR_TX_FIFO_FULL)
@@ -123,6 +124,28 @@ void db_print_char_fn(char x)
SendByte((unsigned int *)XPAR_DEBUG_UART_BASEADDR,x);
}
+/* Dump ASCII value of x out to debug serial port */
+void db_print_num(char x)
+{
+ int i,j;
+
+ j=x;
+
+ db_print_char((i=j/100)+'0');
+ j=j-i*100;
+ db_print_char((i=j/10)+'0');
+ j=j-i*10;
+ db_print_char((i=j)+'0');
+ db_print_char('\n');
+}
+
+void db_print(char *string)
+{
+ while(*string)
+ db_print_char(*string++);
+}
+#endif /* CONFIG_MICROBLAZE_DEBUG_UART */
+
/* Routines to clear the TX and RX FIFOs respectively, whie leaving
interrupt status unchanged */
static inline void Reset_RX_FIFO(volatile unsigned int *uartp)
@@ -155,27 +178,6 @@ static inline void EnableInterrupts(vola
uartp[XUL_CONTROL_REG_OFFSET/4] = XUL_CR_ENABLE_INTR;
}
-/* Dump ASCII value of x out to debug serial port */
-void db_print_num(char x)
-{
- int i,j;
-
- j=x;
-
- db_print_char((i=j/100)+'0');
- j=j-i*100;
- db_print_char((i=j/10)+'0');
- j=j-i*10;
- db_print_char((i=j)+'0');
- db_print_char('\n');
-}
-
-void db_print(char *string)
-{
- while(*string)
- db_print_char(*string++);
-}
-
/*
* Configuration table, UARTs to look for at startup.
*/
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@itee.uq.edu.au
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/