Changeset 501 for GPL/trunk/lib32
- Timestamp:
- Jul 11, 2010, 7:01:51 AM (15 years ago)
- Location:
- GPL/trunk/lib32
- Files:
-
- 5 edited
-
debug.c (modified) (6 diffs)
-
irq.c (modified) (4 diffs)
-
memory.cpp (modified) (10 diffs)
-
ossidc.cpp (modified) (5 diffs)
-
sound.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/lib32/debug.c
r484 r501 27 27 28 28 #include <string.h> 29 #include <dbgos2.h> 30 31 #define COMM_DEBUG 29 32 30 33 #define CR 0x0d … … 34 37 #define SIGNIFICANT_FIELD 0x0007 35 38 36 BOOL fLineTerminate=TRUE; 37 int DebugLevel = 1; 38 39 extern int wrOffset; 40 extern char *szprintBuf; 41 extern int max_buf_size; 39 int DebugLevel; 42 40 43 41 char hextab[]="0123456789ABCDEF"; … … 144 142 } 145 143 146 #ifdef DEBUG147 #define COMM_DEBUG148 //------------------------- StringOut --------------------------//149 150 #define VMDHA_FIXED 0x0002151 152 extern APIRET VMAlloc(ULONG size, ULONG flags, char NEAR* *pAddr);153 154 144 /** 155 145 * Finds the length of a string up to cchMax. … … 218 208 #endif 219 209 210 //------------------------- StringOut --------------------------// 220 211 void StringOut(char *DbgStr) 221 212 { 222 int len; 213 int len; 214 215 len= _strnlen( DbgStr, 1024 ); 216 223 217 #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 } 244 226 #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 286 252 char BuildString[1024]; 287 #endif // DEBUG 288 253 254 #if 0 289 255 //------------------------- PrintfOut - 290 256 void _cdecl DPD(int level, char *DbgStr, ...) 291 257 { 292 #ifdef DEBUG293 258 char *BuildPtr=BuildString; 294 259 char *pStr=(char *) DbgStr; … … 398 363 *BuildPtr=0; // cauterize the string 399 364 StringOut((char *) BuildString); 400 #endif //DEBUG 401 } 402 365 } 366 #endif 403 367 404 368 void _cdecl DPE(char *DbgStr, ...) 405 369 { 406 #ifdef DEBUG407 370 char *BuildPtr=BuildString; 408 371 char *pStr = (char *) DbgStr; … … 517 480 *BuildPtr=0; // cauterize the string 518 481 StringOut((char *) BuildString); 519 #endif //DEBUG520 482 } 521 483 -
GPL/trunk/lib32/irq.c
r479 r501 174 174 IRQ_SLOT *pSlot; 175 175 176 #ifdef DEBUG 177 // dprintf(("enter int proc %d %d",ulSlotNo, *pulIrq)); 178 #endif 176 //dprintf(("enter int proc %d %d",ulSlotNo, *pulIrq)); 179 177 180 178 if(fSuspended) … … 183 181 //Don't pass it to the linux handler as the device doesn't respond as expected 184 182 //when suspended 185 #ifdef DEBUG186 183 dprintf(("Slot %d IRQ %d suspended",ulSlotNo, *pulIrq)); 187 #endif188 184 return FALSE; 189 185 } … … 229 225 //ok, this interrupt was intended for us; notify the 16 bits MMPM/2 driver 230 226 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)); 234 228 eoiIrq[pSlot->irqNo] = 0; 235 229 return TRUE; … … 238 232 } 239 233 } 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)); 243 235 244 236 return FALSE; -
GPL/trunk/lib32/memory.cpp
r485 r501 197 197 *pAddr = (LINEAR)addr; 198 198 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)) 204 203 { 205 204 // EARLYMEMINIT workaround … … 280 279 //only done to save size of memory block 281 280 AddBaseAddress(addr, addr, size); 282 #ifdef DEBUG283 281 dprintf(("get_free_dma_pages %d -> %x (phys %x)", size, (ULONG)addr, virt_to_phys((void *)addr))); 284 #endif285 282 ulget_free_pagesMemUsed += size; 286 #ifdef DEBUG287 283 dprintf(("get_free_dma_pages: total alloc size %d", ulget_free_pagesMemUsed)); 288 #endif289 284 } 290 285 … … 331 326 return 0; 332 327 } 333 ////dprintf(("__get_free_pages %d returned %x", order*PAGE_SIZE, addr));328 //dprintf(("__get_free_pages %d returned %x", order*PAGE_SIZE, addr)); 334 329 if(gfp_mask & (GFP_DMA|GFP_DMAHIGHMEM)) 335 330 {//must be aligned at 64kb boundary … … 359 354 } 360 355 if(addr) { 361 #ifdef DEBUG362 356 dprintf(("get_free_pages %d (%d) -> %x (phys %x)", allocsize, size, (ULONG)addr, virt_to_phys((void *)addr))); 363 #endif364 357 ulget_free_pagesMemUsed += allocsize; 365 #ifdef DEBUG366 358 dprintf(("get_free_pages: total alloc size %d", ulget_free_pagesMemUsed)); 367 #endif368 359 } 369 360 return (void *)addr; … … 382 373 } 383 374 else { 384 #ifdef DEBUG385 375 dprintf(("free_pages %x size %d", (ULONG)addr, size)); 386 #endif387 376 ulget_free_pagesMemUsed -= size; 388 #ifdef DEBUG389 377 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)); 393 380 return 0; 394 381 } … … 409 396 } 410 397 if(addr) { 411 #ifdef DEBUG412 398 //dprintf(("vmalloc %d -> %x (phys %x)", size, addr, virt_to_phys((void *)addr))); 413 #endif414 399 //only done to save size of memory block 415 400 AddBaseAddress(addr, addr, size); 416 401 ulget_free_pagesMemUsed += size; 417 #ifdef DEBUG418 402 //dprintf(("vmalloc: total alloc size %d", ulget_free_pagesMemUsed)); 419 #endif420 403 } 421 404 return (void *)addr; … … 434 417 } 435 418 else { 436 #ifdef DEBUG437 419 //dprintf(("vfree %x size %d", (ULONG)ptr, size)); 438 #endif439 420 ulget_free_pagesMemUsed -= size; 440 #ifdef DEBUG441 421 //dprintf(("vfree: total alloc size %d", ulget_free_pagesMemUsed)); 442 #endif443 422 } 444 423 } … … 474 453 475 454 //round to next page boundary 476 //size = size + PAGE_SIZE - 1;477 //size &= 0xFFFFF000;455 //size = size + PAGE_SIZE - 1; 456 //size &= 0xFFFFF000; 478 457 479 458 #ifdef KEE 480 459 SHORT sel; 481 460 482 //rc = KernVMAlloc(size, VMDHA_PHYS, (PVOID*)&addr, (PVOID*)&physaddr, &sel);461 //rc = KernVMAlloc(size, VMDHA_PHYS, (PVOID*)&addr, (PVOID*)&physaddr, &sel); 483 462 rc = KernVMAlloc(Length, VMDHA_PHYS, (PVOID*)&addr, (PVOID*)&PhysicalAddress, &sel); 484 463 #else … … 616 595 return 0; 617 596 } 618 ////dprintf(("kmalloc %d returned %x", size, addr));597 //dprintf(("kmalloc %d returned %x", size, addr)); 619 598 return addr; 620 599 } … … 634 613 return; 635 614 } 636 ////dprintf(("kfree %x", addr));615 //dprintf(("kfree %x", addr)); 637 616 if(IsHeapAddr(addr)) { 638 617 #ifdef DEBUGHEAP -
GPL/trunk/lib32/ossidc.cpp
r479 r501 110 110 return OSSERR_INIT_FAILED; 111 111 } 112 dprintf(("\nUniaud version %s\n",UNIAUD_VERSION));112 rprintf(("\nUniaud version %s\n",UNIAUD_VERSION)); 113 113 dprintf(("OSS32_Initialize. Start address: %X", OffsetBeginCS32)); 114 //DebugInt3();114 //DebugInt3(); 115 115 116 116 if(call_module_init(alsa_sound_init) != 0) return OSSERR_INIT_FAILED; … … 135 135 call_module_init(patch_sigmatel_init); 136 136 call_module_init(patch_via_init); 137 dprintf(("OSS32_Initialize: ForceCard: %d",ForceCard)); 137 138 #if 0 138 139 int i; … … 162 163 } 163 164 #else 164 dprintf(("force card: %d",ForceCard));165 165 //Check for SoundBlaster Live! 166 166 if((ForceCard == CARD_NONE || ForceCard == CARD_ICH) && … … 287 287 FillCaps(i); 288 288 } 289 dprintf(("OSS32_Initialize: SUCCESS. nr. of cards: %d",nrCardsDetected));289 dprintf(("OSS32_Initialize: SUCCESS. Cards=%d", nrCardsDetected)); 290 290 return OSSERR_SUCCESS; 291 291 } … … 341 341 int OSS32_DebugString(char *buffer, ULONG size) 342 342 { 343 dprintf(("U16: %s",buffer));343 rprintf(("U16: %s", buffer)); 344 344 return size; 345 345 } -
GPL/trunk/lib32/sound.c
r493 r501 696 696 //set operation to non-blocking 697 697 pHandle->file.f_flags = O_NONBLOCK; 698 699 698 ret = pHandle->file.f_op->ioctl(&pHandle->inode, &pHandle->file, SNDRV_PCM_IOCTL_START, 0); 700 699 if (ret)
Note:
See TracChangeset
for help on using the changeset viewer.
