Changeset e995f3a1 in rtems


Ignore:
Timestamp:
Aug 6, 1998, 3:27:08 PM (22 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
e70a8f16
Parents:
c23118b
Message:

Changed debug enable macros to support individually enabling different
types of debug information.

Removed call to rtems_panic which was based on checking a variable which
was no longer being set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/dmv177/sonic/sonic.c

    rc23118b re995f3a1  
    1 #define SONIC_DEBUG
    21/*
    32 *******************************************************************
     
    4140#include <ka9q/trace.h>
    4241#include <ka9q/commands.h>
     42
     43/*
     44 * Debug levels
     45 *
     46 */
     47
     48#define SONIC_DEBUG_NONE             0x0000
     49#define SONIC_DEBUG_ALL              0xFFFF
     50#define SONIC_DEBUG_PRINT_REGISTERS  0x0001
     51#define SONIC_DEBUG_MEMORY           0x0002
     52
     53#define SONIC_DEBUG      SONIC_DEBUG_ALL
    4354
    4455/*
     
    250261      break;
    251262  }
    252 #ifdef SONIC_DEBUG
     263#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
    253264  printf( "sonic_allocate %d bytes at %p\n", nbytes, p );
    254265#endif
     
    700711       */
    701712      for (i = 0 ; i < 2 ; i++) {
    702         if (sonic_read_register( rp, SONIC_REG_RRP ) == sonic_read_register( rp, SONIC_REG_RSA ))
     713        if (sonic_read_register( rp, SONIC_REG_RRP ) ==
     714            sonic_read_register( rp, SONIC_REG_RSA ))
    703715          sonic_write_register(
    704716            rp,
     
    910922  ReceiveDescriptor_t *rda;
    911923  unsigned char *hwaddr;
    912   rtems_status_code sc;
    913924  rtems_isr_entry old_handler;
    914925  TransmitDescriptorPointer_t otdp, tdp;
     
    937948  dp->tdaActiveCount = 0;
    938949  dp->tdaTail = sonic_allocate (dp->tdaCount * sizeof *tdp);
     950#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
     951  printf( "tdaTail = %p\n", dp->tdaTail );
     952#endif
    939953  otdp = tdp = dp->tdaTail;
    940954  for (i = 0 ; i < dp->tdaCount ; i++) {
     
    961975
    962976  rda = sonic_allocate (dp->rdaCount * sizeof *rda);
     977#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
     978  printf( "rda area = %p\n", rda );
     979#endif
    963980  ordp = rdp = rda;
    964981  for (i = 0 ; i < dp->rdaCount ; i++) {
     
    9851002   * area big enough to hold the CAM descriptor area.
    9861003   */
     1004
    9871005  dp->rsa = sonic_allocate ((dp->rdaCount + RRA_EXTRA_COUNT) * sizeof *dp->rsa);
    988 #ifdef SONIC_DEBUG
     1006#if (SONIC_DEBUG & SONIC_DEBUG_MEMORY)
    9891007  printf( "rsa area = %p\n", dp->rsa );
    9901008#endif
     
    11511169  sonic_write_register( rp, SONIC_REG_IMR, 0 );
    11521170  old_handler = set_vector(sonic_interrupt_handler, dp->vector, 0);
    1153   if (sc != RTEMS_SUCCESSFUL)
    1154     rtems_panic ("Can't attach SONIC interrupt handler: %s\n",
    1155               rtems_status_text (sc));
    11561171
    11571172  /*
     
    13031318}
    13041319
    1305 #ifdef SONIC_DEBUG
     1320#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
    13061321#include <stdio.h>
    13071322
     
    13811396  volatile unsigned32 *p = base;
    13821397
    1383 #ifdef SONIC_DEBUG
    1384   printf( "%p ", &p[regno] );
    1385   printf( "Write 0x%04x to %s (0x%02x)\n", value, SONIC_Reg_name[regno], regno );
     1398#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
     1399  printf( "%p Write 0x%04x to %s (0x%02x)\n",
     1400      &p[regno], value, SONIC_Reg_name[regno], regno );
    13861401  fflush( stdout );
    13871402#endif
     
    13981413
    13991414  value = p[regno];
    1400 #ifdef SONIC_DEBUG
    1401   printf( "%p ", &p[regno] );
    1402   printf( "Read 0x%04x from %s (0x%02x)\n", value, SONIC_Reg_name[regno], regno );
     1415#if (SONIC_DEBUG & SONIC_DEBUG_PRINT_REGISTERS)
     1416  printf( "%p Read 0x%04x from %s (0x%02x)\n",
     1417      &p[regno], value, SONIC_Reg_name[regno], regno );
    14031418  fflush( stdout );
    14041419#endif
Note: See TracChangeset for help on using the changeset viewer.