ProjectOSX

Welcome Guest!

Returning User? Login here.

Want membership privileges? Register here.

 
Start a new topic Add Reply
> Tips And Tricks To Recompile Kext For 64 Bti
Slice
post Oct 30 2009, 12:42 PM
Post #1
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
Пожалуйста, прочитайте ЧаВо!
i3-2120 GA-H61M-S1, Radeon HD6670, ALC887(VoodooHDA 2.8.6), OS⌘10.9.4, OS⌘ 10.7.5 Clover FakeSMC_plugins_3.3.1 Realtek LAN v3.1.2
codex
post Apr 13 2010, 09:21 PM
Post #2

please do continue

This post has been edited by codex: Apr 13 2010, 09:21 PM

Add Reply Start a new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members: