From owner-freebsd-hackers Wed Mar 21 14:41: 8 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from barry.mail.mindspring.net (barry.mail.mindspring.net [207.69.200.25]) by hub.freebsd.org (Postfix) with ESMTP id E9A0137B719 for ; Wed, 21 Mar 2001 14:41:04 -0800 (PST) (envelope-from cbsears@ix.netcom.com) Received: from ix.netcom.com (user-2ivfkg4.dialup.mindspring.com [165.247.210.4]) by barry.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id RAA29133; Wed, 21 Mar 2001 17:40:18 -0500 (EST) Message-ID: <3AB92ECF.EAACE3D8@ix.netcom.com> Date: Wed, 21 Mar 2001 14:44:31 -0800 From: Chris Sears X-Mailer: Mozilla 4.75 [en] (X11; U; Linux 2.2.17-21mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: Alexey Dokuchaev Cc: freebsd-hackers@freebsd.org Subject: Re: Linux -> FreeBSD VM functions References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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