summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-09 17:49:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2007-05-09 17:49:53 +0000
commit94bbe8573056c52573166a67e539ff149bbfcaf1 (patch)
tree09491b929fe507672601dd2543531b192d744d61 /c
parent2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-94bbe8573056c52573166a67e539ff149bbfcaf1.tar.bz2
2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* console/debugputs.c, include/bsp.h, leon_smc91111/leon_smc91111.c, startup/spurious.c: Remove debug print methods that are redundant with prntk and replace their use with printk.
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/sparc/leon2/ChangeLog6
-rw-r--r--c/src/lib/libbsp/sparc/leon2/console/debugputs.c32
-rw-r--r--c/src/lib/libbsp/sparc/leon2/include/bsp.h2
-rw-r--r--c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c2
-rw-r--r--c/src/lib/libbsp/sparc/leon2/startup/spurious.c62
5 files changed, 28 insertions, 76 deletions
diff --git a/c/src/lib/libbsp/sparc/leon2/ChangeLog b/c/src/lib/libbsp/sparc/leon2/ChangeLog
index 0a71c13c13..6e2743d928 100644
--- a/c/src/lib/libbsp/sparc/leon2/ChangeLog
+++ b/c/src/lib/libbsp/sparc/leon2/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>
+
+ * console/debugputs.c, include/bsp.h, leon_smc91111/leon_smc91111.c,
+ startup/spurious.c: Remove debug print methods that are redundant
+ with prntk and replace their use with printk.
+
2007-05-03 Joel Sherrill <joel@OARcorp.com>
* startup/linkcmds: Handle .data.* sections
diff --git a/c/src/lib/libbsp/sparc/leon2/console/debugputs.c b/c/src/lib/libbsp/sparc/leon2/console/debugputs.c
index 97b339f716..b418696054 100644
--- a/c/src/lib/libbsp/sparc/leon2/console/debugputs.c
+++ b/c/src/lib/libbsp/sparc/leon2/console/debugputs.c
@@ -75,35 +75,3 @@ int console_inbyte_nonblocking( int port )
return -1;
}
-
-/*
- * DEBUG_puts
- *
- * This should be safe in the event of an error. It attempts to insure
- * that no TX empty interrupts occur while it is doing polled IO. Then
- * it restores the state of that external interrupt.
- *
- * Input parameters:
- * string - pointer to debug output string
- *
- * Output parameters: NONE
- *
- * Return values: NONE
- */
-
-void DEBUG_puts(
- char *string
-)
-{
- char *s;
- uint32_t old_level;
-
- LEON_Disable_interrupt( LEON_INTERRUPT_UART_1_RX_TX, old_level );
- LEON_REG.UART_Control_1 = LEON_REG_UART_CTRL_TE;
- for ( s = string ; *s ; s++ )
- console_outbyte_polled( 0, *s );
-
- console_outbyte_polled( 0, '\r' );
- console_outbyte_polled( 0, '\n' );
- LEON_Restore_interrupt( LEON_INTERRUPT_UART_1_RX_TX, old_level );
-}
diff --git a/c/src/lib/libbsp/sparc/leon2/include/bsp.h b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
index 7d344a1880..bec62f7193 100644
--- a/c/src/lib/libbsp/sparc/leon2/include/bsp.h
+++ b/c/src/lib/libbsp/sparc/leon2/include/bsp.h
@@ -96,8 +96,6 @@ rtems_isr_entry set_vector( /* returns old vector */
int type /* RTEMS or RAW intr */
);
-void DEBUG_puts( char *string );
-
void BSP_fatal_return( void );
void bsp_spurious_initialize( void );
diff --git a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c b/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
index 6862b194cb..ad30f968ee 100644
--- a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
+++ b/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
@@ -53,7 +53,7 @@ int rtems_smc91111_driver_attach_leon2(struct rtems_bsdnet_ifconfig *config)
leon_scmv91111_configuration.ctl_rspeed = 100;
/* activate io area */
- DEBUG_puts("Activating Leon2 io port\n");
+ printk("Activating Leon2 io port\n");
/*configure pio */
*((volatile unsigned int *)0x80000000) |= 0x10f80000;
*((volatile unsigned int *)0x800000A8) |=
diff --git a/c/src/lib/libbsp/sparc/leon2/startup/spurious.c b/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
index daef70d882..02b420541a 100644
--- a/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
+++ b/c/src/lib/libbsp/sparc/leon2/startup/spurious.c
@@ -16,21 +16,7 @@
*/
#include <bsp.h>
-
-#include <string.h>
-
-static const char digits[16] = "0123456789abcdef";
-
-/* Simple integer-to-string conversion */
-
-void itos(uint32_t u, char *s)
-{
- int i;
-
- for (i=0; i<8; i++) {
- s[i] = digits[(u >> (28 - (i*4))) & 0x0f];
- }
-}
+#include <rtems/bspIo.h>
/*
* bsp_spurious_handler
@@ -43,16 +29,11 @@ rtems_isr bsp_spurious_handler(
CPU_Interrupt_frame *isf
)
{
- char line[ 80 ];
uint32_t real_trap;
real_trap = SPARC_REAL_TRAP_NUMBER(trap);
- strcpy(line, "Unexpected trap (0x ) at address 0x ");
- line[ 19 ] = digits[ real_trap >> 4 ];
- line[ 20 ] = digits[ real_trap & 0xf ];
- itos(isf->tpc, &line[36]);
- DEBUG_puts( line );
+ printk( "Unexpected trap (0x%2d) at address 0x%08x\n", real_trap, isf->tpc);
switch (real_trap) {
@@ -61,33 +42,32 @@ rtems_isr bsp_spurious_handler(
*/
case 0x00:
- DEBUG_puts( "reset" );
+ printk( "reset\n" );
break;
case 0x01:
- DEBUG_puts( "instruction access exception" );
+ printk( "instruction access exception\n" );
break;
case 0x02:
- DEBUG_puts( "illegal instruction" );
+ printk( "illegal instruction\n" );
break;
case 0x03:
- DEBUG_puts( "privileged instruction" );
+ printk( "privileged instruction\n" );
break;
case 0x04:
- DEBUG_puts( "fp disabled" );
+ printk( "fp disabled\n" );
break;
case 0x07:
- DEBUG_puts( "memory address not aligned" );
+ printk( "memory address not aligned\n" );
break;
case 0x08:
- DEBUG_puts( "fp exception" );
+ printk( "fp exception\n" );
break;
case 0x09:
- strcpy(line, "data access exception at 0x " );
- itos(LEON_REG.Failed_Address, &line[27]);
- DEBUG_puts( line );
+ printk("data access exception at 0x%08x\n",
+ LEON_REG.First_Failing_Address );
break;
case 0x0A:
- DEBUG_puts( "tag overflow" );
+ printk( "tag overflow\n" );
break;
/*
@@ -95,31 +75,31 @@ rtems_isr bsp_spurious_handler(
*/
case LEON_TRAP_TYPE( LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR ):
- DEBUG_puts( "LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR" );
+ printk( "LEON_INTERRUPT_CORRECTABLE_MEMORY_ERROR\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_2_RX_TX ):
- DEBUG_puts( "LEON_INTERRUPT_UART_2_RX_TX" );
+ printk( "LEON_INTERRUPT_UART_2_RX_TX\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_UART_1_RX_TX ):
- DEBUG_puts( "LEON_INTERRUPT_UART_1_RX_TX" );
+ printk( "LEON_INTERRUPT_UART_1_RX_TX\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_0 ):
- DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_0" );
+ printk( "LEON_INTERRUPT_EXTERNAL_0\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_1 ):
- DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_1" );
+ printk( "LEON_INTERRUPT_EXTERNAL_1\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_2 ):
- DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_2" );
+ printk( "LEON_INTERRUPT_EXTERNAL_2\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_EXTERNAL_3 ):
- DEBUG_puts( "LEON_INTERRUPT_EXTERNAL_3" );
+ printk( "LEON_INTERRUPT_EXTERNAL_3\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER1 ):
- DEBUG_puts( "LEON_INTERRUPT_TIMER1" );
+ printk( "LEON_INTERRUPT_TIMER1\n" );
break;
case LEON_TRAP_TYPE( LEON_INTERRUPT_TIMER2 ):
- DEBUG_puts( "LEON_INTERRUPT_TIMER2" );
+ printk( "LEON_INTERRUPT_TIMER2\n" );
break;
default: