From b2799996d38ec620c852137f82638132aaa616c0 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 9 May 2007 17:49:45 +0000 Subject: 2007-05-09 Joel Sherrill * console/debugputs.c, include/bsp.h, startup/spurious.c: Remove debug print methods that are redundant with prntk and replace their use with printk. --- c/src/lib/libbsp/sparc/erc32/ChangeLog | 6 ++ c/src/lib/libbsp/sparc/erc32/console/debugputs.c | 31 ---------- c/src/lib/libbsp/sparc/erc32/include/bsp.h | 2 - c/src/lib/libbsp/sparc/erc32/startup/spurious.c | 74 +++++++++--------------- 4 files changed, 33 insertions(+), 80 deletions(-) (limited to 'c/src') diff --git a/c/src/lib/libbsp/sparc/erc32/ChangeLog b/c/src/lib/libbsp/sparc/erc32/ChangeLog index eb7814cfc3..ef90fa1946 100644 --- a/c/src/lib/libbsp/sparc/erc32/ChangeLog +++ b/c/src/lib/libbsp/sparc/erc32/ChangeLog @@ -1,3 +1,9 @@ +2007-05-09 Joel Sherrill + + * console/debugputs.c, include/bsp.h, startup/spurious.c: Remove debug + print methods that are redundant with prntk and replace their use + with printk. + 2007-05-03 Joel Sherrill * startup/linkcmds: Handle .data.* sections diff --git a/c/src/lib/libbsp/sparc/erc32/console/debugputs.c b/c/src/lib/libbsp/sparc/erc32/console/debugputs.c index 5f4a5a8f76..67037e397e 100644 --- a/c/src/lib/libbsp/sparc/erc32/console/debugputs.c +++ b/c/src/lib/libbsp/sparc/erc32/console/debugputs.c @@ -79,37 +79,6 @@ 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; - - ERC32_Disable_interrupt( ERC32_INTERRUPT_UART_A_RX_TX, old_level ); - for ( s = string ; *s ; s++ ) - console_outbyte_polled( 0, *s ); - - console_outbyte_polled( 0, '\r' ); - console_outbyte_polled( 0, '\n' ); - ERC32_Restore_interrupt( ERC32_INTERRUPT_UART_A_RX_TX, old_level ); -} - /* * To support printk */ diff --git a/c/src/lib/libbsp/sparc/erc32/include/bsp.h b/c/src/lib/libbsp/sparc/erc32/include/bsp.h index 627d26addc..8d9b020baf 100644 --- a/c/src/lib/libbsp/sparc/erc32/include/bsp.h +++ b/c/src/lib/libbsp/sparc/erc32/include/bsp.h @@ -104,8 +104,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/erc32/startup/spurious.c b/c/src/lib/libbsp/sparc/erc32/startup/spurious.c index 6f4d46d37e..308fd3b1f8 100644 --- a/c/src/lib/libbsp/sparc/erc32/startup/spurious.c +++ b/c/src/lib/libbsp/sparc/erc32/startup/spurious.c @@ -16,21 +16,7 @@ */ #include - -#include - -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 /* * 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(ERC32_MEC.First_Failing_Address, &line[27]); - DEBUG_puts( line ); + printk("data access exception at 0x%08x\n", + ERC32_MEC.First_Failing_Address ); break; case 0x0A: - DEBUG_puts( "tag overflow" ); + printk( "tag overflow\n" ); break; /* @@ -95,49 +75,49 @@ rtems_isr bsp_spurious_handler( */ case ERC32_TRAP_TYPE( ERC32_INTERRUPT_MASKED_ERRORS ): - DEBUG_puts( "ERC32_INTERRUPT_MASKED_ERRORS" ); + printk( "ERC32_INTERRUPT_MASKED_ERRORS\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_1 ): - DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_1" ); + printk( "ERC32_INTERRUPT_EXTERNAL_1\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_2 ): - DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_2" ); + printk( "ERC32_INTERRUPT_EXTERNAL_2\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_A_RX_TX ): - DEBUG_puts( "ERC32_INTERRUPT_UART_A_RX_TX" ); + printk( "ERC32_INTERRUPT_UART_A_RX_TX\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_B_RX_TX ): - DEBUG_puts( "ERC32_INTERRUPT_UART_A_RX_TX" ); + printk( "ERC32_INTERRUPT_UART_A_RX_TX\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR ): - DEBUG_puts( "ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR" ); + printk( "ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_ERROR ): - DEBUG_puts( "ERC32_INTERRUPT_UART_ERROR" ); + printk( "ERC32_INTERRUPT_UART_ERROR\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_DMA_ACCESS_ERROR ): - DEBUG_puts( "ERC32_INTERRUPT_DMA_ACCESS_ERROR" ); + printk( "ERC32_INTERRUPT_DMA_ACCESS_ERROR\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_DMA_TIMEOUT ): - DEBUG_puts( "ERC32_INTERRUPT_DMA_TIMEOUT" ); + printk( "ERC32_INTERRUPT_DMA_TIMEOUT\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_3 ): - DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_3" ); + printk( "ERC32_INTERRUPT_EXTERNAL_3\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_4 ): - DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_4" ); + printk( "ERC32_INTERRUPT_EXTERNAL_4\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER ): - DEBUG_puts( "ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER" ); + printk( "ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_REAL_TIME_CLOCK ): - DEBUG_puts( "ERC32_INTERRUPT_REAL_TIME_CLOCK" ); + printk( "ERC32_INTERRUPT_REAL_TIME_CLOCK\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_5 ): - DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_5" ); + printk( "ERC32_INTERRUPT_EXTERNAL_5\n" ); break; case ERC32_TRAP_TYPE( ERC32_INTERRUPT_WATCHDOG_TIMEOUT ): - DEBUG_puts( "ERC32_INTERRUPT_WATCHDOG_TIMEOUT" ); + printk( "ERC32_INTERRUPT_WATCHDOG_TIMEOUT\n" ); break; default: -- cgit v1.2.3