how to get the physival address

Gabriel Paubert paubert at iram.es
Thu Apr 5 19:16:59 EST 2001


On Thu, 5 Apr 2001, Dan Malek wrote:

>
> 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 :-).
>

Furthermre there is no guarantee that the memory will be physically
contiguous. Unless magically aligned, a 4096 bytes buffer will almost
always span 2 pages.

	Gabriel.


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/





More information about the Linuxppc-embedded mailing list