1/* 2 * IOFireWireLibDCLCommandPool.cpp 3 * IOFireWireFamily 4 * 5 * Created by NWG on Mon Mar 12 2001. 6 * Copyright (c) 2001 Apple Computer, Inc. All rights reserved. 7 * 8 */ 9/* 10 $Log: IOFireWireLibDCLCommandPool.cpp,v $ 11 Revision 1.17 2007/02/15 19:42:08 ayanowit 12 For 4369537, eliminated support for legacy DCL SendPacketWithHeader, since it didn't work anyway, and NuDCL does support it. 13 14 Revision 1.16 2007/02/07 06:35:22 collin 15 *** empty log message *** 16 17 Revision 1.15 2007/01/08 18:47:20 ayanowit 18 More 64-bit changes for isoch. 19 20 Revision 1.14 2007/01/02 18:14:12 ayanowit 21 Enabled building the plug-in lib 4-way FAT. Also, fixed compile problems for 64-bit. 22 23 Revision 1.13 2006/02/09 00:21:55 niels 24 merge chardonnay branch to tot 25 26 Revision 1.12 2005/09/24 00:55:28 niels 27 *** empty log message *** 28 29 Revision 1.11.20.2 2006/01/31 04:49:57 collin 30 *** empty log message *** 31 32 Revision 1.11 2003/07/21 10:01:29 niels 33 *** empty log message *** 34 35 Revision 1.10 2003/07/21 06:53:10 niels 36 merge isoch to TOT 37 38 Revision 1.9.14.1 2003/07/01 20:54:23 niels 39 isoch merge 40 41 Revision 1.9 2002/09/25 00:27:33 niels 42 flip your world upside-down 43 44 Revision 1.8 2002/08/26 20:08:34 niels 45 fix user space hang (when devices are unplugged and a DCL program is running) 46 47*/ 48 49#import "IOFireWireLibDCLCommandPool.h" 50#import "IOFireWireLibDevice.h" 51#import <mach/mach.h> 52#import <pthread.h> 53 54namespace IOFireWireLib { 55 56 TraditionalDCLCommandPoolCOM::Interface TraditionalDCLCommandPoolCOM::sInterface = { 57 INTERFACEIMP_INTERFACE, 58 1, 0, //vers, rev 59 60 SAllocate, 61 SAllocateWithOpcode, 62 SAllocateTransferPacketDCL, 63 SAllocateTransferBufferDCL, 64 SAllocateSendPacketStartDCL, 65 SAllocateSendPacketWithHeaderStartDCL, 66 SAllocateSendBufferDCL, 67 SAllocateSendPacketDCL, 68 SAllocateReceivePacketStartDCL, 69 SAllocateReceivePacketDCL, 70 SAllocateReceiveBufferDCL, 71 SAllocateCallProcDCL, 72 SAllocateLabelDCL, 73 SAllocateJumpDCL, 74 SAllocateSetTagSyncBitsDCL, 75 SAllocateUpdateDCLListDCL, 76 SAllocatePtrTimeStampDCL, 77 SFree, 78 SGetSize, 79 SSetSize, 80 SGetBytesRemaining 81 } ; 82 83 TraditionalDCLCommandPool::TraditionalDCLCommandPool( const IUnknownVTbl & interface, Device& inUserClient, IOByteCount inSize ) 84 : IOFireWireIUnknown( interface ), 85 mUserClient(inUserClient) 86 { 87 mUserClient.AddRef() ; 88 89 mFreeBlocks = CFArrayCreateMutable(kCFAllocatorDefault, 0, nil) ; 90 mFreeBlockSizes = CFArrayCreateMutable(kCFAllocatorDefault, 0, nil) ; 91 mAllocatedBlocks = CFArrayCreateMutable(kCFAllocatorDefault, 0, nil) ; 92 mAllocatedBlockSizes = CFArrayCreateMutable(kCFAllocatorDefault, 0, nil) ; 93 94// mStorage = new UInt8[inSize] ; 95 IOReturn error = vm_allocate ( mach_task_self (), (vm_address_t *) & mStorage, inSize, true /*anywhere*/ ) ; 96 if ( error ) 97 throw error ; 98 99 if ( ! mStorage ) 100 throw kIOReturnVMError ; 101 102 mBytesRemaining = inSize ; 103 mStorageSize = inSize ; 104 105#ifdef __LP64__ 106 DebugLog( "TraditionalDCLCommandPool::TraditionalDCLCommandPool mStorage=%p, mStorageSize=%u\n", mStorage, (UInt32)mStorageSize ) ; 107#else 108 DebugLog( "TraditionalDCLCommandPool::TraditionalDCLCommandPool mStorage=%p, mStorageSize=%lu\n", mStorage, (UInt32)mStorageSize ) ; 109#endif 110 ::CFArrayAppendValue ( mFreeBlocks, mStorage ) ; 111 ::CFArrayAppendValue ( mFreeBlockSizes, (const void *) inSize ) ; 112 113 pthread_mutex_init( & mMutex, nil ) ; 114 } 115 116 TraditionalDCLCommandPool::~TraditionalDCLCommandPool() 117 { 118 Lock() ; 119 120 if (mStorage) 121 { 122// delete[] mStorage ; 123 vm_deallocate ( mach_task_self (), (vm_address_t) mStorage, mStorageSize ) ; 124 mStorage = nil ; 125 mStorageSize = 0 ; 126 } 127 128 if (mFreeBlocks) 129 CFRelease(mFreeBlocks) ; 130 if (mFreeBlockSizes) 131 CFRelease(mFreeBlockSizes) ; 132 if (mAllocatedBlocks) 133 CFRelease(mAllocatedBlocks) ; 134 if (mAllocatedBlockSizes) 135 CFRelease(mAllocatedBlockSizes) ; 136 137 Unlock() ; 138 139 pthread_mutex_destroy( & mMutex ) ; 140 141 mUserClient.Release() ; 142 } 143 144 DCLCommand* 145 TraditionalDCLCommandPool::Allocate( 146 IOByteCount inSize ) 147 { 148 unsigned long blockSize ; 149 UInt32 remainder ; 150 UInt32 index = 0 ; 151 const UInt8* foundFreeBlock = 0 ; 152 DCLCommand* allocatedBlock = nil ; 153 UInt32 freeBlockCount = CFArrayGetCount(mFreeBlocks) ; 154 155 Lock() ; 156 157 do 158 { 159 blockSize = (unsigned long) CFArrayGetValueAtIndex(mFreeBlockSizes, index) ; 160 remainder = blockSize - inSize ; 161 162 if ( blockSize >= inSize ) 163 { 164 // found a free block w/ enough space, 165 // use it to allocate. we allocate from the end of the free block, not the beginning 166 foundFreeBlock = (const UInt8*) CFArrayGetValueAtIndex(mFreeBlocks, index) ; 167 allocatedBlock = (DCLCommand*) (foundFreeBlock + remainder) ; 168 169 CFArrayAppendValue(mAllocatedBlockSizes, (const void*) inSize) ; 170 CFArrayAppendValue(mAllocatedBlocks, allocatedBlock ) ; 171 172 if (remainder > 0) 173 { 174 // 175 // if we didn't use up all of this free block, 176 // resize the block to reflect the new size 177 // CFArraySetValueAtIndex(mFreeBlocks, index, (UInt32) CFArrayGetValueAtIndex(mFreeBlocks, index)) ; 178 CFArraySetValueAtIndex(mFreeBlockSizes, index, (const void*) remainder) ; 179 } 180 else 181 { 182 // 183 // otherwise remove the block from the free list 184 CFArrayRemoveValueAtIndex(mFreeBlocks, index) ; 185 CFArrayRemoveValueAtIndex(mFreeBlockSizes, index) ; 186 } 187 188 // update reminaing size to reflect successful allocation 189 mBytesRemaining -= inSize ; 190 } 191 } while( (++index < freeBlockCount) && (foundFreeBlock == nil) ) ; 192 193 Unlock() ; 194 195 return allocatedBlock ; 196 } 197 198 IOReturn 199 TraditionalDCLCommandPool::AllocateWithOpcode( 200 DCLCommand* inDCL, 201 DCLCommand** outDCL, 202 UInt32 opcode, ... ) 203 { 204 return kIOReturnUnsupported ; 205 } 206 207 DCLCommand* 208 TraditionalDCLCommandPool::AllocateTransferPacketDCL( 209 DCLCommand* inDCL, 210 UInt32 inOpcode, 211 void* inBuffer, 212 IOByteCount inSize) 213 { 214 DCLTransferPacket* newDCL = (DCLTransferPacket*) Allocate( sizeof(DCLTransferPacket) ) ; 215 216 if (!newDCL) 217 { 218 // mStatus = kIOReturnNoMemory ; 219 return nil ; 220 } 221 222 newDCL->pNextDCLCommand = nil ; 223 newDCL->compilerData = 0 ; 224 newDCL->opcode = inOpcode ; 225 newDCL->buffer = inBuffer ; 226 newDCL->size = inSize ; 227 228 if (inDCL) 229 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 230 231 return (DCLCommand*) newDCL ; 232 } 233 234 DCLCommand* 235 TraditionalDCLCommandPool::AllocateTransferBufferDCL( 236 DCLCommand* inDCL, 237 UInt32 inOpcode, 238 void* inBuffer, 239 IOByteCount inSize, 240 IOByteCount inPacketSize, 241 UInt32 inBufferOffset) 242 { 243 DCLTransferBuffer* newDCL = (DCLTransferBuffer*) Allocate( sizeof(DCLTransferBuffer) ) ; 244 245 if (!newDCL) 246 return nil ; 247 248 newDCL->pNextDCLCommand = nil ; 249 newDCL->compilerData = 0 ; 250 newDCL->opcode = inOpcode ; 251 newDCL->buffer = inBuffer ; 252 newDCL->size = inSize ; 253 newDCL->packetSize = inPacketSize ; 254 newDCL->bufferOffset = inBufferOffset ; 255 256 if (inDCL) 257 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 258 259 return (DCLCommand*) newDCL ; 260 } 261 262 DCLCommand* 263 TraditionalDCLCommandPool::AllocateSendPacketStartDCL( 264 DCLCommand* inDCL, 265 void* inBuffer, 266 IOByteCount inSize) 267 { 268 return AllocateTransferPacketDCL(inDCL, kDCLSendPacketStartOp, inBuffer, inSize) ; 269 } 270 271 DCLCommand* 272 TraditionalDCLCommandPool::AllocateSendPacketWithHeaderStartDCL( 273 DCLCommand* inDCL, 274 void* inBuffer, 275 IOByteCount inSize) 276 { 277 return nil; // Deprecated 278 //return AllocateTransferPacketDCL(inDCL, kDCLSendPacketWithHeaderStartOp, inBuffer, inSize) ; 279 } 280 281 DCLCommand* 282 TraditionalDCLCommandPool::AllocateSendBufferDCL( // not implemented 283 DCLCommand* inDCL, 284 void* inBuffer, 285 IOByteCount inSize, 286 IOByteCount inPacketSize, 287 UInt32 inBufferOffset) 288 { 289 return nil ; 290 } 291 292 DCLCommand* 293 TraditionalDCLCommandPool::AllocateSendPacketDCL( 294 DCLCommand* inDCL, 295 void* inBuffer, 296 IOByteCount inSize) 297 { 298 return AllocateTransferPacketDCL(inDCL, kDCLSendPacketOp, inBuffer, inSize) ; 299 } 300 301 DCLCommand* 302 TraditionalDCLCommandPool::AllocateReceivePacketStartDCL( 303 DCLCommand* inDCL, 304 void* inBuffer, 305 IOByteCount inSize) 306 { 307 return AllocateTransferPacketDCL(inDCL, kDCLReceivePacketStartOp, inBuffer, inSize) ; 308 } 309 310 DCLCommand* 311 TraditionalDCLCommandPool::AllocateReceivePacketDCL( 312 DCLCommand* inDCL, 313 void* inBuffer, 314 IOByteCount inSize) 315 { 316 return AllocateTransferPacketDCL(inDCL, kDCLReceivePacketOp, inBuffer, inSize) ; 317 } 318 319 DCLCommand* 320 TraditionalDCLCommandPool::AllocateReceiveBufferDCL( // not implemented 321 DCLCommand* inDCL, 322 void* inBuffer, 323 IOByteCount inSize, 324 IOByteCount inPacketSize, 325 UInt32 inBufferOffset) 326 { 327 return nil ; 328 } 329 330 DCLCommand* 331 TraditionalDCLCommandPool::AllocateCallProcDCL( 332 DCLCommand* inDCL, 333 DCLCallCommandProc* inProc, 334 DCLCallProcDataType inProcData) 335 { 336 DCLCallProc* newDCL = (DCLCallProc*) Allocate(sizeof(DCLCallProc)) ; 337 338 if (!newDCL) 339 return nil ; 340 341 newDCL->pNextDCLCommand = nil ; 342 newDCL->opcode = kDCLCallProcOp ; 343 newDCL->proc = inProc ; 344 newDCL->procData = inProcData ; 345 346 if (inDCL) 347 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 348 349 return (DCLCommand*) newDCL ; 350 } 351 352 DCLCommand* 353 TraditionalDCLCommandPool::AllocateLabelDCL( 354 DCLCommand* inDCL) 355 { 356 DCLLabel* newDCL = (DCLLabel*) Allocate(sizeof(DCLLabel)) ; 357 358 if (newDCL) 359 { 360 newDCL->pNextDCLCommand = nil ; 361 newDCL->opcode = kDCLLabelOp ; 362 363 if (inDCL) 364 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 365 } 366 367 return (DCLCommand*) newDCL ; 368 } 369 370 DCLCommand* 371 TraditionalDCLCommandPool::AllocateJumpDCL( 372 DCLCommand* inDCL, 373 DCLLabel* pInJumpDCLLabel) 374 { 375 DCLJump* newDCL = (DCLJump*) Allocate( sizeof(DCLJump)) ; 376 377 if (newDCL) 378 { 379 newDCL->pNextDCLCommand = nil ; 380 newDCL->opcode = kDCLJumpOp ; 381 newDCL->pJumpDCLLabel = pInJumpDCLLabel ; 382 383 if (inDCL) 384 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 385 } 386 387 return (DCLCommand*) newDCL ; 388 } 389 390 DCLCommand* 391 TraditionalDCLCommandPool::AllocateSetTagSyncBitsDCL( 392 DCLCommand* inDCL, 393 UInt16 inTagBits, 394 UInt16 inSyncBits) 395 { 396 DCLSetTagSyncBits* newDCL = (DCLSetTagSyncBits*) Allocate(sizeof(DCLSetTagSyncBits)) ; 397 398 if (newDCL) 399 { 400 newDCL->pNextDCLCommand = nil ; 401 newDCL->opcode = kDCLSetTagSyncBitsOp ; 402 newDCL->tagBits = inTagBits ; 403 newDCL->syncBits = inSyncBits ; 404 405 if (inDCL) 406 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 407 } 408 409 return (DCLCommand*) newDCL ; 410 } 411 412 DCLCommand* 413 TraditionalDCLCommandPool::AllocateUpdateDCLListDCL( 414 DCLCommand* inDCL, 415 DCLCommand** inDCLCommandList, 416 UInt32 inNumDCLCommands) 417 { 418 DCLUpdateDCLList* newDCL = (DCLUpdateDCLList*) Allocate(sizeof(DCLUpdateDCLList)) ; 419 420 if (newDCL) 421 { 422 newDCL->pNextDCLCommand = nil ; 423 newDCL->opcode = kDCLUpdateDCLListOp ; 424 newDCL->dclCommandList = inDCLCommandList ; 425 newDCL->numDCLCommands = inNumDCLCommands ; 426 427 if (inDCL) 428 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 429 } 430 431 return (DCLCommand*) newDCL ; 432 } 433 434 DCLCommand* 435 TraditionalDCLCommandPool::AllocatePtrTimeStampDCL( 436 DCLCommand* inDCL, 437 UInt32* inTimeStampPtr) 438 { 439 DCLPtrTimeStamp* newDCL = (DCLPtrTimeStamp*) Allocate(sizeof(DCLPtrTimeStamp)) ; 440 441 if (newDCL) 442 { 443 newDCL->pNextDCLCommand = nil ; 444 newDCL->opcode = kDCLPtrTimeStampOp ; 445 newDCL->timeStampPtr = inTimeStampPtr ; 446 447 if (inDCL) 448 inDCL->pNextDCLCommand = (DCLCommand*) newDCL ; 449 } 450 451 return (DCLCommand*) newDCL ; 452 } 453 454 void 455 TraditionalDCLCommandPool::Free( 456 DCLCommand* inDCL ) 457 { 458 Lock() ; 459 460 // 1. find this block in allocated list 461 CFRange searchRange = {0, CFArrayGetCount(mAllocatedBlocks) } ; 462 CFIndex foundIndex = CFArrayGetFirstIndexOfValue(mAllocatedBlocks, searchRange, (const void*) inDCL); 463 if (foundIndex >= 0) 464 { 465 unsigned long foundBlockSize = (unsigned long) CFArrayGetValueAtIndex(mAllocatedBlockSizes, foundIndex) ; 466 467 // 2. if found, return block to free list 468 469 CFIndex index = 0 ; 470 { 471 CFIndex count = ::CFArrayGetCount( mFreeBlocks ) ; 472 while ( (index < count) && (CFArrayGetValueAtIndex(mFreeBlocks, index) <= inDCL) ) 473 ++index ; 474 } 475 476 // update free space counter to reflect returning block to free list 477 mBytesRemaining += foundBlockSize ; 478 479 CFArrayRemoveValueAtIndex(mAllocatedBlocks, foundIndex) ; 480 CFArrayRemoveValueAtIndex(mAllocatedBlockSizes, foundIndex) ; 481 482 CFArrayInsertValueAtIndex(mFreeBlocks, index, inDCL) ; 483 CFArrayInsertValueAtIndex(mFreeBlockSizes, index, (const void*) foundBlockSize) ; 484 485 CoalesceFreeBlocks() ; 486 } 487 488 Unlock() ; 489 } 490 491 Boolean 492 TraditionalDCLCommandPool::SetSize( 493 IOByteCount inSize ) 494 { 495 // trying to make buffer smaller than space we've already allocated 496 if (inSize < mStorageSize ) 497 return false ; 498 499 if (inSize > mStorageSize) 500 { 501 UInt8* newStorage = 0 ;// = new UInt8[inSize] ; 502 IOReturn error = vm_allocate ( mach_task_self (), (vm_address_t *) & newStorage, inSize, true /*anywhere*/ ) ; 503 if ( error ) 504 return false ; 505 506 if ( ! newStorage ) 507 return false ; 508 509 Lock() ; 510 511 ::CFArrayAppendValue ( mFreeBlocks, mStorage + mStorageSize ) ; 512 ::CFArrayAppendValue ( mFreeBlockSizes, (const void *)( inSize - mStorageSize ) ) ; 513 514 CoalesceFreeBlocks() ; 515 516 mBytesRemaining += inSize - mStorageSize ; 517 518 bcopy ( mStorage, newStorage, mStorageSize ) ; 519 520// delete[] mStorage ; 521 vm_deallocate ( mach_task_self (), (vm_address_t) mStorage, mStorageSize ) ; 522 523 mStorage = newStorage ; 524 mStorageSize = inSize ; 525 526 Unlock() ; 527 } 528 529 return true ; 530 } 531 532 void 533 TraditionalDCLCommandPool::Lock() 534 { 535 pthread_mutex_lock( & mMutex ) ; 536 } 537 538 void 539 TraditionalDCLCommandPool::Unlock() 540 { 541 pthread_mutex_unlock( & mMutex ) ; 542 } 543 544 void 545 TraditionalDCLCommandPool::CoalesceFreeBlocks() 546 { 547 UInt32 freeBlockCount = CFArrayGetCount(mFreeBlocks) ; 548 UInt32 index = 1 ; 549 unsigned long preceedingBlockSize = (unsigned long) CFArrayGetValueAtIndex(mFreeBlockSizes, 0) ; 550 unsigned long blockSize ; 551 552 while (index < freeBlockCount) 553 { 554 blockSize = (unsigned long) CFArrayGetValueAtIndex(mFreeBlockSizes, index) ; 555 556 if ( ((UInt8*)CFArrayGetValueAtIndex(mFreeBlocks, index - 1) + preceedingBlockSize) == (UInt8*)CFArrayGetValueAtIndex(mFreeBlocks, index) ) 557 { 558 // resize preceeding block to include current block 559 CFArraySetValueAtIndex(mFreeBlockSizes, index-1, (const void*)(preceedingBlockSize + blockSize) ) ; 560 561 // remove current block since preceeding block now includes it. 562 CFArrayRemoveValueAtIndex(mFreeBlocks, index) ; 563 CFArrayRemoveValueAtIndex(mFreeBlockSizes, index) ; 564 565 preceedingBlockSize += blockSize ; 566 } 567 else 568 { 569 ++index ; 570 preceedingBlockSize = blockSize ; 571 } 572 } 573 } 574 575 // ============================================================ 576 // TraditionalDCLCommandPoolCOM 577 // ============================================================ 578 579 TraditionalDCLCommandPoolCOM::TraditionalDCLCommandPoolCOM( Device& inUserClient, IOByteCount inSize) 580 : TraditionalDCLCommandPool( reinterpret_cast<const IUnknownVTbl &>( sInterface ), inUserClient, inSize ) 581 { 582 } 583 584 TraditionalDCLCommandPoolCOM::~TraditionalDCLCommandPoolCOM() 585 { 586 } 587 588 IUnknownVTbl** 589 TraditionalDCLCommandPoolCOM::Alloc( 590 Device& inUserClient, 591 IOByteCount inSize) 592 { 593 TraditionalDCLCommandPoolCOM * me = nil; 594 try { 595 me = new TraditionalDCLCommandPoolCOM(inUserClient, inSize) ; 596 } catch(...) { 597 } 598 599 return (nil == me) ? nil : reinterpret_cast<IUnknownVTbl**>(& me->GetInterface()) ; 600 } 601 602 HRESULT 603 TraditionalDCLCommandPoolCOM::QueryInterface(REFIID iid, void ** ppv ) 604 { 605 HRESULT result = S_OK ; 606 *ppv = nil ; 607 608 CFUUIDRef interfaceID = CFUUIDCreateFromUUIDBytes(kCFAllocatorDefault, iid) ; 609 610 if ( CFEqual(interfaceID, IUnknownUUID) || CFEqual(interfaceID, kIOFireWireDCLCommandPoolInterfaceID) ) 611 { 612 *ppv = & GetInterface() ; 613 AddRef() ; 614 } 615 else 616 { 617 *ppv = nil ; 618 result = E_NOINTERFACE ; 619 } 620 621 CFRelease(interfaceID) ; 622 return result ; 623 } 624 625 // 626 // --- static methods ------------------ 627 // 628 DCLCommand* 629 TraditionalDCLCommandPoolCOM::SAllocate( 630 Ref self, 631 IOByteCount inSize ) 632 { 633 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->Allocate(inSize) ; 634 } 635 636 637 IOReturn 638 TraditionalDCLCommandPoolCOM::SAllocateWithOpcode( 639 Ref self, 640 DCLCommand* inDCL, 641 DCLCommand** outDCL, 642 UInt32 opcode, ... ) 643 { 644 IOReturn result = kIOReturnSuccess ; 645 va_list va ; 646 647 va_start(va, opcode) ; 648 result = IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateWithOpcode(inDCL, outDCL, opcode, va) ; 649 va_end(va) ; 650 651 return result ; 652 } 653 654 DCLCommand* 655 TraditionalDCLCommandPoolCOM::SAllocateTransferPacketDCL( 656 Ref self, 657 DCLCommand* inDCL, 658 UInt32 inOpcode, 659 void* inBuffer, 660 IOByteCount inSize) 661 { 662 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateTransferPacketDCL(inDCL, inOpcode, inBuffer, inSize) ; 663 } 664 665 DCLCommand* 666 TraditionalDCLCommandPoolCOM::SAllocateTransferBufferDCL( 667 Ref self, 668 DCLCommand* inDCL, 669 UInt32 inOpcode, 670 void* inBuffer, 671 IOByteCount inSize, 672 IOByteCount inPacketSize, 673 UInt32 inBufferOffset) 674 { 675 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateTransferBufferDCL(inDCL, inOpcode, inBuffer, inSize, inPacketSize, inBufferOffset) ; 676 } 677 678 DCLCommand* 679 TraditionalDCLCommandPoolCOM::SAllocateSendPacketStartDCL( 680 Ref self, 681 DCLCommand* inDCL, 682 void* inBuffer, 683 IOByteCount inSize) 684 { 685 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateSendPacketStartDCL(inDCL, inBuffer, inSize) ; 686 } 687 688 DCLCommand* 689 TraditionalDCLCommandPoolCOM::SAllocateSendPacketWithHeaderStartDCL( 690 Ref self, 691 DCLCommand* inDCL, 692 void* inBuffer, 693 IOByteCount inSize) 694 { 695 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateSendPacketWithHeaderStartDCL(inDCL, inBuffer, inSize) ; 696 } 697 698 DCLCommand* 699 TraditionalDCLCommandPoolCOM::SAllocateSendBufferDCL( // currently does nothing 700 Ref self, 701 DCLCommand* inDCL, 702 void* inBuffer, 703 IOByteCount inSize, 704 IOByteCount inPacketSize, 705 UInt32 inBufferOffset) 706 { 707 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateSendBufferDCL(inDCL, inBuffer, inSize, inPacketSize, inBufferOffset) ; 708 } 709 710 DCLCommand* 711 TraditionalDCLCommandPoolCOM::SAllocateSendPacketDCL( 712 Ref self, 713 DCLCommand* inDCL, 714 void* inBuffer, 715 IOByteCount inSize) 716 { 717 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateSendPacketDCL(inDCL, inBuffer, inSize) ; 718 } 719 720 DCLCommand* 721 TraditionalDCLCommandPoolCOM::SAllocateReceivePacketStartDCL( 722 Ref self, 723 DCLCommand* inDCL, 724 void* inBuffer, 725 IOByteCount inSize) 726 { 727 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateReceivePacketStartDCL(inDCL, inBuffer, inSize) ; 728 } 729 730 DCLCommand* 731 TraditionalDCLCommandPoolCOM::SAllocateReceivePacketDCL( 732 Ref self, 733 DCLCommand* inDCL, 734 void* inBuffer, 735 IOByteCount inSize) 736 { 737 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateReceivePacketDCL(inDCL, inBuffer, inSize) ; 738 } 739 740 DCLCommand* 741 TraditionalDCLCommandPoolCOM::SAllocateReceiveBufferDCL( // currently does nothing 742 Ref self, 743 DCLCommand* inDCL, 744 void* inBuffer, 745 IOByteCount inSize, 746 IOByteCount inPacketSize, 747 UInt32 inBufferOffset) 748 { 749 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateReceiveBufferDCL(inDCL, inBuffer, inSize, inPacketSize, inBufferOffset) ; 750 } 751 752 DCLCommand* 753 TraditionalDCLCommandPoolCOM::SAllocateCallProcDCL( 754 Ref self, 755 DCLCommand* inDCL, 756 DCLCallCommandProc* inProc, 757 DCLCallProcDataType inProcData) 758 { 759 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateCallProcDCL(inDCL, inProc, inProcData) ; 760 } 761 762 DCLCommand* 763 TraditionalDCLCommandPoolCOM::SAllocateLabelDCL( 764 Ref self, 765 DCLCommand* inDCL) 766 { 767 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateLabelDCL(inDCL) ; 768 } 769 770 DCLCommand* 771 TraditionalDCLCommandPoolCOM::SAllocateJumpDCL( 772 Ref self, 773 DCLCommand* inDCL, 774 DCLLabel* pInJumpDCLLabel) 775 { 776 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateJumpDCL(inDCL, pInJumpDCLLabel) ; 777 } 778 779 DCLCommand* 780 TraditionalDCLCommandPoolCOM::SAllocateSetTagSyncBitsDCL( 781 Ref self, 782 DCLCommand* inDCL, 783 UInt16 inTagBits, 784 UInt16 inSyncBits) 785 { 786 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateSetTagSyncBitsDCL(inDCL, inTagBits, inSyncBits) ; 787 } 788 789 DCLCommand* 790 TraditionalDCLCommandPoolCOM::SAllocateUpdateDCLListDCL( 791 Ref self, 792 DCLCommand* inDCL, 793 DCLCommand** inDCLCommandList, 794 UInt32 inNumCommands) 795 { 796 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocateUpdateDCLListDCL(inDCL, inDCLCommandList, inNumCommands) ; 797 } 798 799 DCLCommand* 800 TraditionalDCLCommandPoolCOM::SAllocatePtrTimeStampDCL( 801 Ref self, 802 DCLCommand* inDCL, 803 UInt32* inTimeStampPtr) 804 { 805 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->AllocatePtrTimeStampDCL(inDCL, inTimeStampPtr) ; 806 } 807 808 void 809 TraditionalDCLCommandPoolCOM::SFree( 810 Ref self, 811 DCLCommand* inDCL ) 812 { 813 IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->Free(inDCL) ; 814 } 815 816 IOByteCount 817 TraditionalDCLCommandPoolCOM::SGetSize( 818 Ref self ) 819 { 820 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->mStorageSize ; 821 } 822 823 Boolean 824 TraditionalDCLCommandPoolCOM::SSetSize( 825 Ref self, 826 IOByteCount inSize ) 827 { 828 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->SetSize(inSize) ; 829 } 830 831 IOByteCount 832 TraditionalDCLCommandPoolCOM::SGetBytesRemaining( 833 Ref self ) 834 { 835 return IOFireWireIUnknown::InterfaceMap<TraditionalDCLCommandPoolCOM>::GetThis(self)->mBytesRemaining ; 836 } 837} 838