Hi Peter
I don't know the answers to all of your questions, but I'll try to answer what I do know.
IODMACommand::withSpecification() will requires a static C++ function as the first argument. I currently use the provided kIODMACommandOutputHost32, which is defined as
class IODMACommand : public IOCommand
{
...
#define kIODMACommandOutputHost32 (IODMACommand::OutputHost32)
static bool OutputHost32(IODMACommand *target,
Segment64 seg, void *segs, UInt32 ind);
};
So, in theory at least, you should be able to provide your own function.
I then call gen32IOVMSegments thus:
UInt64 offset = 0;
IODMACommand::Segment32 segments[1];
UInt32 numSeg = 1;
result = cmd->gen32IOVMSegments(&offset, &segments[0], &numSeg);
So my sequence is something like (obviously with error checking etc)
mem = IOMemoryDescriptor::withAddress()
cmd = IODMACommand::withSpecification(....)
cmd->setMemoryDescriptor(mem, false)
cmd->prepare()
cmd->gen32IOVMSegments()
cmd->complete()
cmd->clearMemoryDescriptor(false)
cmd->release()
cheers
peter