Skip to contentSkip to conversation

consistent_alloc() on PPC

DISCUSSION Sachin P 2 participants 2 messages Jan 19, 2005

lore
Share & tools
lore

Sachin P

author
#0 lore raw

Hi ,
I am facing some problems porting my drivers to the PPC platform . Am currently using consistent_alloc() and consistent_free() to allocate/free (non-cached) DMA ble memory.
Is there any function/patch/macro, equivalent to phy_to_virt()/virt_to_phy() for memory returned by consistent_alloc()?

Regards
sachin

#1 lore raw
Quoted 6 lines · Sachin P

I am facing some problems porting my drivers to the PPC platform . Am currently using consistent_alloc() and consistent_free() to allocate/free (non-cached) DMA ble memory.
Is there any function/patch/macro, equivalent to phy_to_virt()/virt_to_phy() for memory returned by consistent_alloc()?

Imo not. I ended up writing a private version of it, along these lines:

static inline unsigned long private_io_to_bus(void *addr)

{
        return iopa((unsigned long)addr) + offset;
}

Wouldn't hurt if you could generalize it somehow.

Jörn

Signature · 2 lines
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein