IOFireWireLibDCLCommandPool.h [plain text]
#import <IOKit/firewire/IOFireWireLibIsoch.h>
#import <IOKit/firewire/IOFireWireFamilyCommon.h>
#import "IOFireWireLibPriv.h"
namespace IOFireWireLib {
class DCLCommandPool: public IOFireWireIUnknown
{
public:
DCLCommandPool( IUnknownVTbl* interface, Device& inUserClient, IOByteCount inSize ) ;
virtual ~DCLCommandPool() ;
Boolean Init()
{ return true; }
DCLCommand* Allocate(
IOByteCount inSize ) ;
IOReturn AllocateWithOpcode(
DCLCommand* inDCL,
DCLCommand** outDCL,
UInt32 opcode, ... ) ;
DCLCommand* AllocateTransferPacketDCL(
DCLCommand* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize) ;
DCLCommand* AllocateTransferBufferDCL(
DCLCommand* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
DCLCommand* AllocateSendPacketStartDCL(
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommand* AllocateSendPacketWithHeaderStartDCL(
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommand* AllocateSendBufferDCL( DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
DCLCommand* AllocateSendPacketDCL(
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommand* AllocateReceivePacketStartDCL(
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommand* AllocateReceivePacketDCL(
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommand* AllocateReceiveBufferDCL( DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
DCLCommand* AllocateCallProcDCL( DCLCommand* inDCL, DCLCallCommandProc* proc, UInt32 procData) ;
DCLCommand* AllocateLabelDCL( DCLCommand* dcl ) ;
DCLCommand* AllocateJumpDCL( DCLCommand* dcl, DCLLabel* pInJumpDCLLabel ) ;
DCLCommand* AllocateSetTagSyncBitsDCL( DCLCommand* dcl, UInt16 tagBits, UInt16 syncBits ) ;
DCLCommand* AllocateUpdateDCLListDCL( DCLCommand* dcl, DCLCommand** dclCommandList, UInt32 numCommands ) ;
DCLCommand* AllocatePtrTimeStampDCL( DCLCommand* dcl, UInt32* timeStampPtr ) ;
void Free( DCLCommand* dcl ) ;
IOByteCount GetSize() ;
Boolean SetSize( IOByteCount size ) ;
IOByteCount GetBytesRemaining() ;
protected:
void Lock() ;
void Unlock() ;
void CoalesceFreeBlocks() ;
protected:
Device& mUserClient ;
CFMutableArrayRef mFreeBlocks ;
CFMutableArrayRef mFreeBlockSizes ;
CFMutableArrayRef mAllocatedBlocks ;
CFMutableArrayRef mAllocatedBlockSizes ;
UInt8* mStorage ;
IOByteCount mStorageSize ;
IOByteCount mBytesRemaining ;
pthread_mutex_t mMutex ;
} ;
class DCLCommandPoolCOM: public DCLCommandPool
{
typedef IOFireWireLibDCLCommandPoolRef Ref ;
typedef IOFireWireDCLCommandPoolInterface Interface ;
public:
DCLCommandPoolCOM( Device& inUserClient, IOByteCount inSize ) ;
virtual ~DCLCommandPoolCOM() ;
static Interface sInterface ;
static IUnknownVTbl** Alloc(
Device& inUserClient,
IOByteCount inSize) ;
virtual HRESULT QueryInterface(REFIID iid, void ** ppv ) ;
static DCLCommand* SAllocate(
IOFireWireLibDCLCommandPoolRef self,
IOByteCount inSize ) ;
static IOReturn SAllocateWithOpcode(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
DCLCommand** outDCL,
UInt32 opcode, ... ) ;
static DCLCommand* SAllocateTransferPacketDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommand* SAllocateTransferBufferDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
static DCLCommand* SAllocateSendPacketStartDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommand* SAllocateSendPacketWithHeaderStartDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommand* SAllocateSendBufferDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
static DCLCommand* SAllocateSendPacketDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommand* SAllocateReceivePacketStartDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommand* SAllocateReceivePacketDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommand* SAllocateReceiveBufferDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
static DCLCommand* SAllocateCallProcDCL( IOFireWireLibDCLCommandPoolRef self, DCLCommand* dcl, DCLCallCommandProc* proc, UInt32 procData ) ;
static DCLCommand* SAllocateLabelDCL( IOFireWireLibDCLCommandPoolRef self, DCLCommand* dcl ) ;
static DCLCommand* SAllocateJumpDCL( IOFireWireLibDCLCommandPoolRef self, DCLCommand* dcl, DCLLabel* jumpDCLLabel) ;
static DCLCommand* SAllocateSetTagSyncBitsDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
UInt16 inTagBits,
UInt16 inSyncBits) ;
static DCLCommand* SAllocateUpdateDCLListDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
DCLCommand** inDCLCommandList,
UInt32 inNumCommands) ;
static DCLCommand* SAllocatePtrTimeStampDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL,
UInt32* inTimeStampPtr) ;
static void SFree(
IOFireWireLibDCLCommandPoolRef self,
DCLCommand* inDCL ) ;
static IOByteCount SGetSize(
IOFireWireLibDCLCommandPoolRef self ) ;
static Boolean SSetSize(
IOFireWireLibDCLCommandPoolRef self,
IOByteCount inSize ) ;
static IOByteCount SGetBytesRemaining(
IOFireWireLibDCLCommandPoolRef self ) ;
} ;
}