Changeset b279999 in rtems


Ignore:
Timestamp:
May 9, 2007, 5:49:45 PM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
94bbe857
Parents:
0bb47ebd
Message:

2007-05-09 Joel Sherrill <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.
Location:
c/src/lib/libbsp/sparc/erc32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/sparc/erc32/ChangeLog

    r0bb47ebd rb279999  
     12007-05-09      Joel Sherrill <joel.sherrill@OARcorp.com>
     2
     3        * console/debugputs.c, include/bsp.h, startup/spurious.c: Remove debug
     4        print methods that are redundant with prntk and replace their use
     5        with printk.
     6
    172007-05-03      Joel Sherrill <joel@OARcorp.com>
    28
  • c/src/lib/libbsp/sparc/erc32/console/debugputs.c

    r0bb47ebd rb279999  
    8181
    8282/*
    83  *  DEBUG_puts
    84  *
    85  *  This should be safe in the event of an error.  It attempts to insure
    86  *  that no TX empty interrupts occur while it is doing polled IO.  Then
    87  *  it restores the state of that external interrupt.
    88  *
    89  *  Input parameters:
    90  *    string  - pointer to debug output string
    91  *
    92  *  Output parameters:  NONE
    93  *
    94  *  Return values:      NONE
    95  */
    96 
    97 void DEBUG_puts(
    98   char *string
    99 )
    100 {
    101   char *s;
    102   uint32_t   old_level;
    103 
    104   ERC32_Disable_interrupt( ERC32_INTERRUPT_UART_A_RX_TX, old_level );
    105     for ( s = string ; *s ; s++ )
    106       console_outbyte_polled( 0, *s );
    107 
    108     console_outbyte_polled( 0, '\r' );
    109     console_outbyte_polled( 0, '\n' );
    110   ERC32_Restore_interrupt( ERC32_INTERRUPT_UART_A_RX_TX, old_level );
    111 }
    112 
    113 /*
    11483 *  To support printk
    11584 */
  • c/src/lib/libbsp/sparc/erc32/include/bsp.h

    r0bb47ebd rb279999  
    105105);
    106106
    107 void DEBUG_puts( char *string );
    108 
    109107void BSP_fatal_return( void );
    110108
  • c/src/lib/libbsp/sparc/erc32/startup/spurious.c

    r0bb47ebd rb279999  
    1717
    1818#include <bsp.h>
    19 
    20 #include <string.h>
    21 
    22 static const char digits[16] = "0123456789abcdef";
    23 
    24 /* Simple integer-to-string conversion */
    25 
    26 void itos(uint32_t   u, char *s)
    27 {
    28   int i;
    29 
    30   for (i=0; i<8; i++) {
    31     s[i] =  digits[(u >> (28 - (i*4))) & 0x0f];
    32   }
    33 }
     19#include <rtems/bspIo.h>
    3420
    3521/*
     
    4430)
    4531{
    46   char line[ 80 ];
    4732  uint32_t         real_trap;
    4833
    4934  real_trap = SPARC_REAL_TRAP_NUMBER(trap);
    5035
    51   strcpy(line, "Unexpected trap (0x  ) at address 0x        ");
    52   line[ 19 ] = digits[ real_trap >> 4 ];
    53   line[ 20 ] = digits[ real_trap & 0xf ];
    54   itos(isf->tpc, &line[36]);
    55   DEBUG_puts( line );
     36  printk( "Unexpected trap (0x%2d) at address 0x%08x\n", real_trap, isf->tpc);
    5637
    5738  switch (real_trap) {
     
    6243
    6344    case 0x00:
    64       DEBUG_puts( "reset" );
     45      printk( "reset\n" );
    6546      break;
    6647    case 0x01:
    67       DEBUG_puts( "instruction access exception" );
     48      printk( "instruction access exception\n" );
    6849      break;
    6950    case 0x02:
    70       DEBUG_puts( "illegal instruction" );
     51      printk( "illegal instruction\n" );
    7152      break;
    7253    case 0x03:
    73       DEBUG_puts( "privileged instruction" );
     54      printk( "privileged instruction\n" );
    7455      break;
    7556    case 0x04:
    76       DEBUG_puts( "fp disabled" );
     57      printk( "fp disabled\n" );
    7758      break;
    7859    case 0x07:
    79       DEBUG_puts( "memory address not aligned" );
     60      printk( "memory address not aligned\n" );
    8061      break;
    8162    case 0x08:
    82       DEBUG_puts( "fp exception" );
     63      printk( "fp exception\n" );
    8364      break;
    8465    case 0x09:
    85       strcpy(line, "data access exception at 0x        " );
    86       itos(ERC32_MEC.First_Failing_Address, &line[27]);
    87       DEBUG_puts( line );
     66      printk("data access exception at 0x%08x\n",
     67        ERC32_MEC.First_Failing_Address );
    8868      break;
    8969    case 0x0A:
    90       DEBUG_puts( "tag overflow" );
     70      printk( "tag overflow\n" );
    9171      break;
    9272
     
    9676
    9777    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_MASKED_ERRORS ):
    98       DEBUG_puts( "ERC32_INTERRUPT_MASKED_ERRORS" );
     78      printk( "ERC32_INTERRUPT_MASKED_ERRORS\n" );
    9979      break;
    10080    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_1 ):
    101       DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_1" );
     81      printk( "ERC32_INTERRUPT_EXTERNAL_1\n" );
    10282      break;
    10383    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_2 ):
    104       DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_2" );
     84      printk( "ERC32_INTERRUPT_EXTERNAL_2\n" );
    10585      break;
    10686    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_A_RX_TX ):
    107       DEBUG_puts( "ERC32_INTERRUPT_UART_A_RX_TX" );
     87      printk( "ERC32_INTERRUPT_UART_A_RX_TX\n" );
    10888      break;
    10989    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_B_RX_TX ):
    110       DEBUG_puts( "ERC32_INTERRUPT_UART_A_RX_TX" );
     90      printk( "ERC32_INTERRUPT_UART_A_RX_TX\n" );
    11191      break;
    11292    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR ):
    113       DEBUG_puts( "ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR" );
     93      printk( "ERC32_INTERRUPT_CORRECTABLE_MEMORY_ERROR\n" );
    11494      break;
    11595    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_UART_ERROR ):
    116       DEBUG_puts( "ERC32_INTERRUPT_UART_ERROR" );
     96      printk( "ERC32_INTERRUPT_UART_ERROR\n" );
    11797      break;
    11898    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_DMA_ACCESS_ERROR ):
    119       DEBUG_puts( "ERC32_INTERRUPT_DMA_ACCESS_ERROR" );
     99      printk( "ERC32_INTERRUPT_DMA_ACCESS_ERROR\n" );
    120100      break;
    121101    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_DMA_TIMEOUT ):
    122       DEBUG_puts( "ERC32_INTERRUPT_DMA_TIMEOUT" );
     102      printk( "ERC32_INTERRUPT_DMA_TIMEOUT\n" );
    123103      break;
    124104    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_3 ):
    125       DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_3" );
     105      printk( "ERC32_INTERRUPT_EXTERNAL_3\n" );
    126106      break;
    127107    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_4 ):
    128       DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_4" );
     108      printk( "ERC32_INTERRUPT_EXTERNAL_4\n" );
    129109      break;
    130110    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER ):
    131       DEBUG_puts( "ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER" );
     111      printk( "ERC32_INTERRUPT_GENERAL_PURPOSE_TIMER\n" );
    132112      break;
    133113    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_REAL_TIME_CLOCK ):
    134       DEBUG_puts( "ERC32_INTERRUPT_REAL_TIME_CLOCK" );
     114      printk( "ERC32_INTERRUPT_REAL_TIME_CLOCK\n" );
    135115      break;
    136116    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_EXTERNAL_5 ):
    137       DEBUG_puts( "ERC32_INTERRUPT_EXTERNAL_5" );
     117      printk( "ERC32_INTERRUPT_EXTERNAL_5\n" );
    138118      break;
    139119    case ERC32_TRAP_TYPE( ERC32_INTERRUPT_WATCHDOG_TIMEOUT ):
    140       DEBUG_puts( "ERC32_INTERRUPT_WATCHDOG_TIMEOUT" );
     120      printk( "ERC32_INTERRUPT_WATCHDOG_TIMEOUT\n" );
    141121      break;
    142122
Note: See TracChangeset for help on using the changeset viewer.