lkml.org 
[lkml]   [1999]   [Nov]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: new bootmem structure
Hi,

On Tue, 2 Nov 1999, Russell King wrote:

> > > This is just Ingo being bad. He should have used virt_to_phys() and
> > > friends, not __pa().
>
> IMHO, __pa should not be the same as virt_to_phys(). If they are indeed
> supposed to be the same, can we loose one of the names? It's a needless
> complication which should not be there, and can lead to needless confusion.

Maybe it needs a better name (and some documentation too :) ), but
sometimes it would be nice to have at least two variants of
virt_to_phys(). A fast version that does no error checking and only works
normal kernel memory, this would be useful for the mm system, where we
know most of the time that the address is valid. And a slow version that
checks for possible errors and also works e.g. on vmalloced memory (but
that isn't the case on ia32 currently).

> > That's not really a problem, if we could define that __pa()/__va() works
> > only specific memory areas and is completly undefined for others (except
> > for __va(), see other mail for that).
>
> I believe that virt_to_phys() ought to behave as we expect - convert a kernel
> virtual address to a physical address, but __pa() or maybe a renamed __pa()
> should return the offset into physical memory of the virtual address.

The other possibiliy would to remove __pa()/__va() from any portable code,
the most important points are mm/memory.c, drivers/char/mem.c and now
also mm/bootmem.c. They expect __va() to work like phys_to_virt(). Then
these macros could be used for any architecture specific purpose.

bye, Roman


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.084 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site