how to get the physival address

jerry jerry.nguyen at
Thu Apr 5 16:28:11 EST 2001

Yes, if I use kmalloc is OK, either __pa or virt_to_phys will return the
physical address.

But it does not work  for  defined variable (it was defined in driver so it
should be in kernel space, isn't it?). I  wonder  which memory space, this
variable belong to?

Thank in advances

- Original Message -----
From: "Dan Malek" <dan at>
To: "jerry" <jerry.nguyen at>
Cc: <linuxppc-embedded at>
Sent: Thursday, April 05, 2001 1:58 PM
Subject: Re: how to get the physival address

> jerry wrote:
> > I try to print out:  buffer_array = 0xC4056220
> To get an address like this, you must be loading the
> driver as a module.  There are a variety of opinions about
> how to do this, like using kmalloc() to dynamically allocate
> the space after the module is loaded.  In the linuxppc_2_5
> kernel from FSM Labs are some VM modifications I have started.
> The virt_to_phys() is appropriate to use on the MPC8xx for this
> sort of thing, and you can even do consistent_alloc() if you want
> cache inhibited pages.  In older kernels, there are no functions
> that will provide this for you (well, you can trudge through the
> page tables, get the PTE and convert it yourself, but that sucks :-).
> -- Dan

** Sent via the linuxppc-embedded mail list. See

More information about the Linuxppc-embedded mailing list