IOFireWireLibDCLCommandPool.h [plain text]
#import "IOFireWireLibPriv.h"
#import "IOFireWireLibIsoch.h"
#import "IOFWIsoch.h"
namespace IOFireWireLib {
class DCLCommandPool: public IOFireWireIUnknown
{
public:
DCLCommandPool( IUnknownVTbl* interface, Device& inUserClient, IOByteCount inSize ) ;
virtual ~DCLCommandPool() ;
Boolean Init()
{ return true; }
DCLCommandStruct* Allocate(
IOByteCount inSize ) ;
IOReturn AllocateWithOpcode(
DCLCommandStruct* inDCL,
DCLCommandStruct** outDCL,
UInt32 opcode, ... ) ;
DCLCommandStruct* AllocateTransferPacketDCL(
DCLCommandStruct* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize) ;
DCLCommandStruct* AllocateTransferBufferDCL(
DCLCommandStruct* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
DCLCommandStruct* AllocateSendPacketStartDCL(
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommandStruct* AllocateSendPacketWithHeaderStartDCL(
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommandStruct* AllocateSendBufferDCL( DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
DCLCommandStruct* AllocateSendPacketDCL(
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommandStruct* AllocateReceivePacketStartDCL(
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommandStruct* AllocateReceivePacketDCL(
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
DCLCommandStruct* AllocateReceiveBufferDCL( DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
DCLCommandStruct* AllocateCallProcDCL(
DCLCommandStruct* inDCL,
DCLCallCommandProcPtr inProc,
UInt32 inProcData) ;
DCLCommandStruct* AllocateLabelDCL(
DCLCommandStruct* inDCL) ;
DCLCommandStruct* AllocateJumpDCL(
DCLCommandStruct* inDCL,
DCLLabelPtr pInJumpDCLLabel) ;
DCLCommandStruct* AllocateSetTagSyncBitsDCL(
DCLCommandStruct* inDCL,
UInt16 inTagBits,
UInt16 inSyncBits) ;
DCLCommandStruct* AllocateUpdateDCLListDCL(
DCLCommandStruct* inDCL,
DCLCommandPtr* inDCLCommandList,
UInt32 inNumCommands) ;
DCLCommandStruct* AllocatePtrTimeStampDCL(
DCLCommandStruct* inDCL,
UInt32* inTimeStampPtr) ;
void Free(
DCLCommandStruct* inDCL ) ;
IOByteCount GetSize() ;
Boolean SetSize(
IOByteCount inSize ) ;
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 DCLCommandStruct* SAllocate(
IOFireWireLibDCLCommandPoolRef self,
IOByteCount inSize ) ;
static IOReturn SAllocateWithOpcode(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
DCLCommandStruct** outDCL,
UInt32 opcode, ... ) ;
static DCLCommandStruct* SAllocateTransferPacketDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommandStruct* SAllocateTransferBufferDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
UInt32 inOpcode,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
static DCLCommandStruct* SAllocateSendPacketStartDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommandStruct* SAllocateSendPacketWithHeaderStartDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommandStruct* SAllocateSendBufferDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
static DCLCommandStruct* SAllocateSendPacketDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommandStruct* SAllocateReceivePacketStartDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommandStruct* SAllocateReceivePacketDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize) ;
static DCLCommandStruct* SAllocateReceiveBufferDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
void* inBuffer,
IOByteCount inSize,
IOByteCount inPacketSize,
UInt32 inBufferOffset) ;
static DCLCommandStruct* SAllocateCallProcDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
DCLCallCommandProcPtr inProc,
UInt32 inProcData) ;
static DCLCommandStruct* SAllocateLabelDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL) ;
static DCLCommandStruct* SAllocateJumpDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
DCLLabelPtr pInJumpDCLLabel) ;
static DCLCommandStruct* SAllocateSetTagSyncBitsDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
UInt16 inTagBits,
UInt16 inSyncBits) ;
static DCLCommandStruct* SAllocateUpdateDCLListDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
DCLCommandPtr* inDCLCommandList,
UInt32 inNumCommands) ;
static DCLCommandStruct* SAllocatePtrTimeStampDCL(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL,
UInt32* inTimeStampPtr) ;
static void SFree(
IOFireWireLibDCLCommandPoolRef self,
DCLCommandStruct* inDCL ) ;
static IOByteCount SGetSize(
IOFireWireLibDCLCommandPoolRef self ) ;
static Boolean SSetSize(
IOFireWireLibDCLCommandPoolRef self,
IOByteCount inSize ) ;
static IOByteCount SGetBytesRemaining(
IOFireWireLibDCLCommandPoolRef self ) ;
} ;
}