On 24/05/11 14:17, Kenneth Salerno wrote:
Changed code as requested:
if( !align ) { OFMEM_TRACE("we are here! KPS\n"); if( is_free(addr, size, ofmem->virt_range)&& is_free(addr, size, ofmem->phys_range) ) { ofmem_claim_phys_( 0, size, PAGE_SIZE, 0, ofmem_arch_get_phys_top(), -1 ); ofmem_claim_virt_( addr, size, 0, 0, 0, 0 ); virt = phys = addr; } else { OFMEM_TRACE("**** ofmem_claim failure ***!\n"); return -1; }
Same result however:
Hi Ken,
Ah okay - I just realised we also need to remove the is_free() check for the physical region as we are now allocating it ourselves, and plus we now need to set phys. Note that I am currently not able to compile-test until tomorrow so you may need to tweak it a little further in order to get it to work.
This is not ready for commit yet, but the following should hopefully work better:
if( !align ) { if( is_free(addr, size, ofmem->virt_range) ) { phys = ofmem_claim_phys_( addr, size, PAGE_SIZE, 0, ofmem_arch_get_phys_top(), -1 ); ofmem_claim_virt_( addr, size, 0, 0, 0, 0 ); if ( phys == -1 ) { OFMEM_TRACE("ofmem_claim failed\n"); return -1; } } else { OFMEM_TRACE("**** ofmem_claim failure ***!\n"); return -1; } }
ATB,
Mark.