[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what is __pa(x)



Hi,

> What is __pa(x) function, it said that it translates logical address to
> physical address by x-PAGE_OFFSET, PAGE_OFFSET is normally something
> like 0xc0000000, how can this translate? What is x input?

x is a virtual address. Virtual addresses are the physical addresses 
plus PAGE_OFFSET. So to go *back* to a virtual address from a physical 
address as the __pa macro does, you simply do the reverse operation and 
subtract PAGE_OFFSET.

That's my understanding, anyway. I'm a newbie too and it might not be 
that simple.

Kirk

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/