Date: Wed, 21 Mar 2001 14:44:31 -0800 From: Chris Sears <cbsears@ix.netcom.com> To: Alexey Dokuchaev <danfe@inet.ssc.nsu.ru> Cc: freebsd-hackers@freebsd.org Subject: Re: Linux -> FreeBSD VM functions Message-ID: <3AB92ECF.EAACE3D8@ix.netcom.com> References: <Pine.LNX.4.10.10103212233240.22100-100000@inet.ssc.nsu.ru>
next in thread | previous in thread | raw e-mail | index | archive | help
Alexey > static inline unsigned long > get_kvirt_address(unsigned long address) > { > } This function returns 0 if a virtual address is not mapped. Otherwise it returns the linear address associated with that virtual address by traversing the page table and extracting the physical address from mem_map, the reverse-mapped software pagetable. > Is simple PHYS_TO_VM_PAGE will do? No actually it would the other way around: VM_PAGE_TO_PHYS. But you have to get the vm_page of the virtual address first. Perhaps pmap_extract(pmap, va) might be more helpful but you will need the pmap of the process. > if (PageReserved(mem_map + GET_MAP_NR(page))) { ... } PG_reserved means that the page is reserved to the kernel. *Maybe* PG_UNMANAGED might be analogous. > > /* Page flag bit values */ > #define PG_locked 0 > #define PG_error 1 > #define PG_referenced 2 > #define PG_dirty 3 > #define PG_uptodate 4 > #define PG_free_after 5 > #define PG_decr_after 6 > #define PG_swap_unlock_after 7 > #define PG_DMA 8 > #define PG_Slab 9 > #define PG_swap_cache 10 > #define PG_skip 11 > #define PG_reserved 31 > > How do those relate to FreeBSD vision of things? Look at vm_page.h You should spend some quality time with Understanding the Linux Kernel especially chapter 6, and/or the Linux Commentary. And chapter 5 of Design and Implementation of 4.4BSD. And since the 4.4BSD vm is really the Mach vm you should look at that stuff too. Chris To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3AB92ECF.EAACE3D8>