2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>

* console/debugputs.c, include/bsp.h, startup/spurious.c: Remove debug
	print methods that are redundant with prntk and replace their use
	with printk.
This commit is contained in:
Joel Sherrill
2007-05-09 17:49:45 +00:00
parent 0bb47ebd65
commit b2799996d3
4 changed files with 33 additions and 80 deletions

View File

@@ -1,3 +1,9 @@
2007-05-09 Joel Sherrill <joel.sherrill@OARcorp.com>
* 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 <joel@OARcorp.com>
* startup/linkcmds: Handle .data.* sections

View File

@@ -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
*/

View File

@@ -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 );

View File

@@ -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(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: