Help - Search - Members - Calendar
Full Version: Tips And Tricks To Recompile Kext For 64 Bti
Project OS X Forums > OS X 10.6 (Snow Leopard) > Development
Slice
1. Type mismatch. Check that IOPhysicalMymory differ for 32 and 64 bits.
Also. For 32 bits
CODE
        if ( (UInt32) xferDataPtr & 0x01 )

For 64 bits
CODE
        if ( (uintptr_t) xferDataPtr & 0x01 )

2. IOMallocContiguous is depricated
Leo codes
CODE
_prdTable = (PRD *) IOMallocContiguous(
/* size */ sizeof(PRD) * kATAMaxDMADesc,
/* align */ 0x10000,
/* phys */ &_prdTablePhysical );

if ( !_prdTable )
{
IOLog("%s: PRD table allocation failed\n", getName());
return false;
}
.........
bool AppleIntelPIIXPATA::freeDMAChannel( void )
{
if ( _prdTable )
{
// make sure the engine is stopped.
stopDMA();

// free the descriptor table.
IOFreeContiguous(_prdTable, sizeof(PRD) * kATAMaxDMADesc);
}

return true;
}


Snow codes
CODE

_prdBuffer = IOBufferMemoryDescriptor::inTaskWithPhysicalMask(
kernel_task,
kIODirectionInOut | kIOMemoryPhysicallyContiguous,
sizeof(PRD) * kATAMaxDMADesc,
0xFFFF0000UL );

if ( !_prdBuffer )
{
IOLog("%s: PRD buffer allocation failed\n", getName());
return false;
}

_prdBuffer->prepare ( );

_prdTable = (PRD *) _prdBuffer->getBytesNoCopy();
_prdTablePhysical = _prdBuffer->getPhysicalAddress();
............
bool AppleIntelPIIXPATA::freeDMAChannel( void )
{
if ( _prdBuffer )
{
// make sure the engine is stopped.
stopDMA();

// free the descriptor table.
_prdBuffer->complete();
_prdBuffer->release();
_prdBuffer = NULL;
_prdTable = NULL;
_prdTablePhysical = 0;

}

return true;
}

and a new declaration
CODE
#include <IOKit/IOBufferMemoryDescriptor.h>
.........
    IOBufferMemoryDescriptor*        _prdBuffer;


To be continued.
Please publish your experience
codex

please do continue
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.