Re: __pa() vs. virt_to_phys()

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

 



On Wed, 13 Feb 2002, Martin Maletinsky wrote:

> Hi,
> 
> Is there any reason to use __pa() rather than virt_to_phys() or vice versa?
> 
> On i386 virt_to_phys() is just a function that returns the value returned by __pa(); on Alpha virt_to_phys() is a function that subtracts IDENT_ADDR from the argument,
> whereas __pa() is a macro that subtracts PAGE_OFFSET from its argument - however PAGE_OFFSET and IDENT_ADDR expand to the same value; on Sparc virt_to_phys() is a macro
> that expands to __pa().
> 
> So the two things look to be pretty much the same on different platforms - is there any reason
> for having __pa() as well as virt_to_phys(), and which one is to be used by device drivers?

Try not to use the underlying calls directly, they may change under you, 
although these seem less likely, IOW use the API given to you.

Regards,
	Zwane Mwaikambo


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux