linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* __pa() vs. virt_to_phys()
@ 2002-02-13 20:28 Martin Maletinsky
  2002-02-16 12:32 ` Zwane Mwaikambo
  0 siblings, 1 reply; 2+ messages in thread
From: Martin Maletinsky @ 2002-02-13 20:28 UTC (permalink / raw)
  To: kernelnewbies, linux-mm

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?

thanks for your help
regards
Martin
--
Supercomputing System AG          email: maletinsky@scs.ch
Martin Maletinsky                 phone: +41 (0)1 445 16 05
Technoparkstrasse 1               fax:   +41 (0)1 445 16 10
CH-8005 Zurich


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-02-16 12:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-13 20:28 __pa() vs. virt_to_phys() Martin Maletinsky
2002-02-16 12:32 ` Zwane Mwaikambo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox