Changeset 501


Ignore:
Timestamp:
Jul 11, 2010, 7:01:51 AM (15 years ago)
Author:
David Azarewicz
Message:

debug statement changes

Location:
GPL/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/core/memalloc.c

    r464 r501  
    22 *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
    33 *                   Takashi Iwai <tiwai@suse.de>
    4  * 
     4 *
    55 *  Generic memory allocators
    66 *
     
    209209 * Calls the memory-allocator function for the corresponding
    210210 * buffer type.
    211  * 
     211 *
    212212 * Returns zero if the buffer with the given size is allocated successfuly,
    213213 * other a negative value at error.
     
    216216                        struct snd_dma_buffer *dmab)
    217217{
    218 #ifdef DEBUG
    219218    dprintf(("snd_dma_alloc_pages with size = %d",size));
    220 #endif
    221219        if (WARN_ON(!size))
    222220                return -ENXIO;
     
    265263 * tries to allocate again.  The size actually allocated is stored in
    266264 * res_size argument.
    267  * 
     265 *
    268266 * Returns zero if the buffer with the given size is allocated successfuly,
    269267 * other a negative value at error.
     
    362360 *
    363361 * Reserves the given buffer as a reserved buffer.
    364  * 
     362 *
    365363 * Returns zero if successful, or a negative code at error.
    366364 */
  • GPL/trunk/drv32/parse.c

    r484 r501  
    3939#include <string.h>
    4040
    41 #ifdef DEBUG
    4241#define COMM_DEBUG
    43 #endif
    4442
    4543// True if the /V parameter was specified
  • GPL/trunk/drv32/read.cpp

    r268 r501  
    1111int   wrOffset= 0;
    1212char  *szprintBuf= 0;
    13 #ifdef DEBUG
    14 int   max_buf_size= 0x100000;
    15 #else
    16 int   max_buf_size= 0x10000;
    17 #endif
    1813
    1914void * __ioremap(unsigned long physaddr, unsigned long size, unsigned long flags);
     
    2520{
    2621  RPRWV __far* rp = (RPRWV __far*)_rp;
    27  
     22
    2823  char *lin;
    2924  int   transferCount= rp->Count;
    30  
     25
    3126  if( szprintBuf )
    3227  {
     
    3530    {
    3631      int diffCount;
    37      
     32
    3833      if( rdOffset > wrOffset )
    3934      {
    40         diffCount= max_buf_size - rdOffset + wrOffset;
     35        diffCount= DBG_MAX_BUF_SIZE - rdOffset + wrOffset;
    4136      } else
    4237      {
     
    4540      if( transferCount > diffCount )
    4641        transferCount= diffCount;
    47      
     42
    4843      rp->Count= transferCount;
    49       if( (rdOffset + transferCount) > max_buf_size )
     44      if( (rdOffset + transferCount) > DBG_MAX_BUF_SIZE )
    5045      {
    51         diffCount= max_buf_size - rdOffset;
     46        diffCount= DBG_MAX_BUF_SIZE - rdOffset;
    5247        memcpy( lin, szprintBuf + rdOffset, diffCount );
    5348        transferCount= transferCount - diffCount;
     
    5550      } else
    5651        diffCount= 0;
    57        
    58       if( transferCount ) 
     52
     53      if( transferCount )
    5954      {
    6055        memcpy( lin + diffCount, szprintBuf + rdOffset, transferCount );
  • GPL/trunk/drv32/strategy.c

    r458 r501  
    3838ULONG StratClose(RP __far *_rp);
    3939
    40 ULONG DiscardableInit(RPInit __far*); 
     40ULONG DiscardableInit(RPInit __far*);
    4141
    4242ULONG deviceOwner = DEV_NO_OWNER;
     
    7070    RPInit __far* rp = (RPInit __far*)_rp;
    7171    rc = DiscardableInit(rp);
    72 #ifdef DEBUG
    73     dprintf(("StratInit. cp1.rc %d", rc));
    74 #endif
     72    dprintf(("StratInit End rc=%d", rc));
    7573    return rc;
    7674}
     
    8987    BYTE   LowIRQ;
    9088    BYTE   HighIRQ;
    91     BYTE   Pin;   
     89    BYTE   Pin;
    9290};
    9391extern struct SaveIRQForSlot sISRHigh[];
     
    138136#endif
    139137  if(rp->Function == 1) {//end of shutdown
    140         OSS32_Shutdown(); 
     138        OSS32_Shutdown();
    141139  }
    142140  return(RPDONE);
  • GPL/trunk/include/dbgos2.h

    r479 r501  
    2626#define __COMMDBG_H__
    2727
    28 //#ifdef DEBUG
    29 #if 1
    3028#ifdef __cplusplus
    3129extern "C" {
    3230#endif
    3331extern int DebugLevel;
    34 
     32extern int wrOffset;
     33extern char *szprintBuf;
     34//void _cdecl DPD(int level, char *x, ...) ; /* not debugging: nothing */
    3535void _cdecl DPE(char *x, ...) ; /* not debugging: nothing */
    36 void _cdecl DPD(int level, char *x, ...) ; /* not debugging: nothing */
    3736#ifdef __cplusplus
    3837}
    3938#endif
    40 #define dprintf(a)      if(DebugLevel > 0) DPE a
     39
     40/* rprintf always prints to the log buffer, and to SIO if enabled */
     41#define rprintf(a) DPE a
     42
     43/* the dprintf functions only print if DEBUG is defined */
     44#ifdef DEBUG
     45#define DBG_MAX_BUF_SIZE 0x100000
     46#define dprintf(a)      DPE a
     47#define dprintf1(a)     if(DebugLevel > 0) DPE a
    4148#define dprintf2(a)     if(DebugLevel > 1) DPE a
    4249#define dprintf3(a)     if(DebugLevel > 2) DPE a
    43 #define DebugInt3()     ; //_asm int 3;
    44 #define DebInt3()       _asm int 3;
    45 #else // #ifdef DEBUG
     50#define DebugInt3()     ; //_asm int 3
     51//#define DebInt3()     _asm int 3;
     52#else
     53// not DEBUG
     54#define DBG_MAX_BUF_SIZE 0x10000
    4655#define dprintf(a)
     56#define dprintf1(a)
    4757#define dprintf2(a)
    4858#define dprintf3(a)
    49 #define DebugInt3()     ;
    50 #endif // #ifdef DEBUG
     59#define DebugInt3()
     60#endif
    5161
    5262#endif //__COMMDBG_H__
     63
  • GPL/trunk/lib32/debug.c

    r484 r501  
    2727
    2828#include <string.h>
     29#include <dbgos2.h>
     30
     31#define COMM_DEBUG
    2932
    3033#define CR 0x0d
     
    3437#define SIGNIFICANT_FIELD       0x0007
    3538
    36 BOOL  fLineTerminate=TRUE;
    37 int   DebugLevel = 1;
    38 
    39 extern int wrOffset;
    40 extern char *szprintBuf;
    41 extern int max_buf_size;
     39int DebugLevel;
    4240
    4341char hextab[]="0123456789ABCDEF";
     
    144142}
    145143
    146 #ifdef DEBUG
    147 #define COMM_DEBUG
    148 //------------------------- StringOut --------------------------//
    149 
    150 #define VMDHA_FIXED             0x0002
    151 
    152 extern APIRET VMAlloc(ULONG size, ULONG flags, char NEAR* *pAddr);
    153 
    154144/**
    155145 * Finds the length of a string up to cchMax.
     
    218208#endif
    219209
     210//------------------------- StringOut --------------------------//
    220211void StringOut(char *DbgStr)
    221212{
    222    int len;
     213        int len;
     214
     215        len= _strnlen( DbgStr, 1024 );
     216
    223217#ifdef COMM_DEBUG
    224    int i;
    225 #endif /* DEBUG */
    226 
    227    len= _strnlen( DbgStr, 1024 );
    228 /*
    229    while (*DbgStr)
    230       CharOut(*DbgStr++);
    231       */
    232 #ifdef COMM_DEBUG
    233    if (MAGIC_COMM_PORT)   //PS+++ If have comport - out to it
    234    {
    235        for( i= 0; i < len; i++ )
    236            CharOut( DbgStr[i] );
    237 
    238        if (fLineTerminate)
    239        {
    240            CharOut(CR);                              // append carriage return,
    241            CharOut(LF);                              // linefeed
    242        }
    243    }
     218        if (MAGIC_COMM_PORT) {
     219                int i;
     220
     221                for( i= 0; i < len; i++ ) CharOut( DbgStr[i] );
     222
     223                CharOut(CR);                              // append carriage return,
     224                CharOut(LF);                              // linefeed
     225        }
    244226#endif
    245    if( szprintBuf == 0 )
    246    {
    247       VMAlloc( max_buf_size, VMDHA_FIXED, &szprintBuf );
    248       if( szprintBuf )
    249          memset( szprintBuf, 0, max_buf_size );
    250       wrOffset= 0;
    251    }
    252    if( szprintBuf )
    253    {
    254        if( (len + wrOffset) > max_buf_size )
    255        {
    256           int cntr;
    257           cntr= max_buf_size - wrOffset;
    258           memcpy( szprintBuf +  wrOffset, DbgStr, cntr );
    259           DbgStr+= cntr;
    260           len= len - cntr;
    261           wrOffset= 0;
    262        }
    263        if( len )
    264        {
    265           memcpy( szprintBuf + wrOffset, DbgStr, len );
    266           wrOffset= wrOffset + len;
    267           if( wrOffset >= max_buf_size )
    268               wrOffset= 0;
    269        }
    270        if (fLineTerminate)
    271        {
    272 //           if( (wrOffset+1) >= max_buf_size )
    273 //               wrOffset= 0;
    274            szprintBuf[wrOffset]= CR;
    275            if( ++wrOffset >= max_buf_size )
    276                wrOffset= 0;
    277            szprintBuf[wrOffset]= LF;
    278            if( ++wrOffset >= max_buf_size )
    279                wrOffset= 0;
    280        }
    281    }
    282 }
    283 #endif
    284 
    285 #ifdef  DEBUG
     227
     228        if (szprintBuf == 0) return;
     229
     230        if( (len + wrOffset) > DBG_MAX_BUF_SIZE ) {
     231                int cntr;
     232                cntr = DBG_MAX_BUF_SIZE - wrOffset;
     233                memcpy( szprintBuf +  wrOffset, DbgStr, cntr );
     234                DbgStr += cntr;
     235                len = len - cntr;
     236                wrOffset= 0;
     237        }
     238
     239        if ( len ) {
     240                memcpy( szprintBuf + wrOffset, DbgStr, len );
     241                wrOffset= wrOffset + len;
     242                if( wrOffset >= DBG_MAX_BUF_SIZE ) wrOffset= 0;
     243        }
     244
     245        if ( (wrOffset+1) >= DBG_MAX_BUF_SIZE ) wrOffset= 0;
     246        szprintBuf[wrOffset]= CR;
     247        if ( ++wrOffset >= DBG_MAX_BUF_SIZE ) wrOffset= 0;
     248        szprintBuf[wrOffset]= LF;
     249        if ( ++wrOffset >= DBG_MAX_BUF_SIZE ) wrOffset= 0;
     250}
     251
    286252char BuildString[1024];
    287 #endif          // DEBUG
    288 
     253
     254#if 0
    289255//------------------------- PrintfOut -
    290256void _cdecl DPD(int level, char *DbgStr, ...)
    291257{
    292 #ifdef DEBUG
    293258   char *BuildPtr=BuildString;
    294259   char *pStr=(char *) DbgStr;
     
    398363   *BuildPtr=0;                                 // cauterize the string
    399364   StringOut((char *) BuildString);
    400 #endif                            //DEBUG
    401 }
    402 
     365}
     366#endif
    403367
    404368void _cdecl DPE(char *DbgStr, ...)
    405369{
    406 #ifdef DEBUG
    407370   char *BuildPtr=BuildString;
    408371   char *pStr = (char *) DbgStr;
     
    517480   *BuildPtr=0;                                 // cauterize the string
    518481   StringOut((char *) BuildString);
    519 #endif                            //DEBUG
    520482}
    521483
  • GPL/trunk/lib32/irq.c

    r479 r501  
    174174    IRQ_SLOT    *pSlot;
    175175
    176 #ifdef DEBUG
    177 //    dprintf(("enter int proc %d %d",ulSlotNo, *pulIrq));
    178 #endif
     176        //dprintf(("enter int proc %d %d",ulSlotNo, *pulIrq));
    179177
    180178    if(fSuspended)
     
    183181        //Don't pass it to the linux handler as the device doesn't respond as expected
    184182        //when suspended
    185 #ifdef DEBUG
    186183        dprintf(("Slot %d IRQ %d suspended",ulSlotNo, *pulIrq));
    187 #endif
    188184        return FALSE;
    189185    }
     
    229225                    //ok, this interrupt was intended for us; notify the 16 bits MMPM/2 driver
    230226                    OSS32_ProcessIRQ();
    231 #ifdef DEBUG
    232 //                    dprintf(("exit(1) int proc %d %d",ulSlotNo, *pulIrq));
    233 #endif
     227                                        //dprintf(("exit(1) int proc %d %d",ulSlotNo, *pulIrq));
    234228                    eoiIrq[pSlot->irqNo] = 0;
    235229                    return TRUE;
     
    238232        }
    239233    }
    240 #ifdef DEBUG
    241 //                    dprintf(("exit(0) int proc %d %d",ulSlotNo, *pulIrq));
    242 #endif
     234        //dprintf(("exit(0) int proc %d %d",ulSlotNo, *pulIrq));
    243235
    244236    return FALSE;
  • GPL/trunk/lib32/memory.cpp

    r485 r501  
    197197        *pAddr = (LINEAR)addr;
    198198        if (flags & VMDHA_USEHIGHMEM)
    199             dprintf((("allocated %X in HIGH memory\n"), size));
    200         else dprintf((("allocated %X in LOW memory\n"), size));
    201     }
    202     if ((rc == 87) &&
    203         (flags & VMDHA_USEHIGHMEM))
     199            dprintf1((("allocated %X in HIGH memory\n"), size));
     200        else dprintf1((("allocated %X in LOW memory\n"), size));
     201    }
     202    if ((rc == 87) && (flags & VMDHA_USEHIGHMEM))
    204203    {
    205204        // EARLYMEMINIT workaround
     
    280279        //only done to save size of memory block
    281280        AddBaseAddress(addr, addr, size);
    282 #ifdef DEBUG
    283281        dprintf(("get_free_dma_pages %d -> %x (phys %x)", size, (ULONG)addr, virt_to_phys((void *)addr)));
    284 #endif
    285282        ulget_free_pagesMemUsed += size;
    286 #ifdef DEBUG
    287283        dprintf(("get_free_dma_pages: total alloc size %d", ulget_free_pagesMemUsed));
    288 #endif
    289284    }
    290285
     
    331326                return 0;
    332327        }
    333 ////    dprintf(("__get_free_pages %d returned %x", order*PAGE_SIZE, addr));
     328        //dprintf(("__get_free_pages %d returned %x", order*PAGE_SIZE, addr));
    334329    if(gfp_mask & (GFP_DMA|GFP_DMAHIGHMEM))
    335330    {//must be aligned at 64kb boundary
     
    359354    }
    360355    if(addr) {
    361 #ifdef DEBUG
    362356        dprintf(("get_free_pages %d (%d) -> %x (phys %x)", allocsize, size, (ULONG)addr, virt_to_phys((void *)addr)));
    363 #endif
    364357        ulget_free_pagesMemUsed += allocsize;
    365 #ifdef DEBUG
    366358        dprintf(("get_free_pages: total alloc size %d", ulget_free_pagesMemUsed));
    367 #endif
    368359    }
    369360    return (void *)addr;
     
    382373    }
    383374    else {
    384 #ifdef DEBUG
    385375        dprintf(("free_pages %x size %d", (ULONG)addr, size));
    386 #endif
    387376        ulget_free_pagesMemUsed -= size;
    388 #ifdef DEBUG
    389377        dprintf(("free_pages: total alloc size %d", ulget_free_pagesMemUsed));
    390 #endif
    391     }
    392 ////    dprintf(("free_pages %x", addr));
     378    }
     379        //dprintf(("free_pages %x", addr));
    393380        return 0;
    394381}
     
    409396        }
    410397    if(addr) {
    411 #ifdef DEBUG
    412398        //dprintf(("vmalloc %d -> %x (phys %x)", size, addr, virt_to_phys((void *)addr)));
    413 #endif
    414399        //only done to save size of memory block
    415400        AddBaseAddress(addr, addr, size);
    416401        ulget_free_pagesMemUsed += size;
    417 #ifdef DEBUG
    418402        //dprintf(("vmalloc: total alloc size %d", ulget_free_pagesMemUsed));
    419 #endif
    420403    }
    421404    return (void *)addr;
     
    434417    }
    435418    else {
    436 #ifdef DEBUG
    437419        //dprintf(("vfree %x size %d", (ULONG)ptr, size));
    438 #endif
    439420        ulget_free_pagesMemUsed -= size;
    440 #ifdef DEBUG
    441421        //dprintf(("vfree: total alloc size %d", ulget_free_pagesMemUsed));
    442 #endif
    443422    }
    444423}
     
    474453
    475454    //round to next page boundary
    476 //    size = size + PAGE_SIZE - 1;
    477 //    size &= 0xFFFFF000;
     455        //size = size + PAGE_SIZE - 1;
     456        //size &= 0xFFFFF000;
    478457
    479458#ifdef KEE
    480459    SHORT sel;
    481460
    482 //    rc = KernVMAlloc(size, VMDHA_PHYS, (PVOID*)&addr, (PVOID*)&physaddr, &sel);
     461        //rc = KernVMAlloc(size, VMDHA_PHYS, (PVOID*)&addr, (PVOID*)&physaddr, &sel);
    483462    rc = KernVMAlloc(Length, VMDHA_PHYS, (PVOID*)&addr, (PVOID*)&PhysicalAddress, &sel);
    484463#else
     
    616595        return 0;
    617596    }
    618 ////    dprintf(("kmalloc %d returned %x", size, addr));
     597        //dprintf(("kmalloc %d returned %x", size, addr));
    619598    return addr;
    620599}
     
    634613        return;
    635614    }
    636 ////  dprintf(("kfree %x", addr));
     615        //dprintf(("kfree %x", addr));
    637616    if(IsHeapAddr(addr)) {
    638617#ifdef DEBUGHEAP
  • GPL/trunk/lib32/ossidc.cpp

    r479 r501  
    110110        return OSSERR_INIT_FAILED;
    111111    }
    112     dprintf(("\nUniaud version %s\n",UNIAUD_VERSION));
     112    rprintf(("\nUniaud version %s\n",UNIAUD_VERSION));
    113113    dprintf(("OSS32_Initialize. Start address: %X", OffsetBeginCS32));
    114 //    DebugInt3();
     114        //DebugInt3();
    115115
    116116    if(call_module_init(alsa_sound_init) != 0)       return OSSERR_INIT_FAILED;
     
    135135    call_module_init(patch_sigmatel_init);
    136136    call_module_init(patch_via_init);
     137    dprintf(("OSS32_Initialize: ForceCard: %d",ForceCard));
    137138#if 0
    138139    int i;
     
    162163    }
    163164#else
    164     dprintf(("force card: %d",ForceCard));
    165165    //Check for SoundBlaster Live!
    166166    if((ForceCard == CARD_NONE || ForceCard == CARD_ICH) &&
     
    287287            FillCaps(i);
    288288        }
    289         dprintf(("OSS32_Initialize: SUCCESS. nr. of cards: %d",nrCardsDetected));
     289        dprintf(("OSS32_Initialize: SUCCESS. Cards=%d", nrCardsDetected));
    290290        return OSSERR_SUCCESS;
    291291    }
     
    341341int OSS32_DebugString(char *buffer, ULONG size)
    342342{
    343     dprintf(("U16: %s",buffer));
     343    rprintf(("U16: %s", buffer));
    344344    return size;
    345345}
  • GPL/trunk/lib32/sound.c

    r493 r501  
    696696    //set operation to non-blocking
    697697    pHandle->file.f_flags = O_NONBLOCK;
    698 
    699698    ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_START, 0);
    700699    if (ret)
Note: See TracChangeset for help on using the changeset viewer.