Re: Getting virtual address

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

 



On 19-11-07 19:28, Talib Alim wrote:

You should look into kmap{,_atomic}() to map highmem.

So, if virtual_address retuned is in 0xdxxxxxxx than I can assume this is
mapped, otherwise I map it ? is this correct.

No, that's not the idea. If you look at kmap{,_atomic}() they return the virtual address and when the page in question is not a highmem page turn into a direct page_address() call (which is also the function you could and should've used instead of your homegrown one).

Unless I'm mistaken, one should by the way mostly never use kmap but only kmap_atomic (which means you can't sleep while holding that kmap) but not much practical experience there.

In the block layer, another method for dealing with highmem is not telling anyone you know what it is, so that it'll only ever give you lowmem, using bounce buffers internally as required. No idea what you're doing and whether or not any such blissful ignoring of highmem will be available to you.

Also, can somebody explain what page_to_pfn does and why << PAGE_SHIFT is
needed ? (For my better understanding. page_to_pfn is adding some
constant, what is the significance and what pfn stands for)

Page Frame Number and it makes sense if yu learn about the memory map but the best answer is that you needn't bother and just use the provided functions and macros. If you really want to know, just look at their implementation.

Rene.

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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