From owner-freebsd-hackers Wed Mar 21 9:30:28 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from linux.ssc.nsu.ru (linux.ssc.nsu.ru [193.124.219.91]) by hub.freebsd.org (Postfix) with SMTP id A0ED237B73D for ; Wed, 21 Mar 2001 09:30:21 -0800 (PST) (envelope-from danfe@inet.ssc.nsu.ru) Received: (qmail 23291 invoked from network); 21 Mar 2001 17:30:01 -0000 Received: from inet.ssc.nsu.ru (62.76.110.12) by hub.freebsd.org with SMTP; 21 Mar 2001 17:30:01 -0000 Received: from localhost (danfe@localhost) by inet.ssc.nsu.ru (8.9.3/8.9.3) with ESMTP id XAA25194 for ; Wed, 21 Mar 2001 23:29:42 +0600 Date: Wed, 21 Mar 2001 23:29:41 +0600 (NOVT) From: Alexey Dokuchaev To: freebsd-hackers@freebsd.org Subject: Linux -> FreeBSD VM functions In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hello! I seems to have a lot of VM-relevant code to port, and I'd like to get answers for several questions arised along the way: --- * How do I port something like this: . . . static inline unsigned long get_kvirt_address(unsigned long address) { pgd_t *pg_dir; pmd_t *pg_mid_dir; pte_t *pg_table; unsigned long ret_addr = 0; pg_dir = pgd_offset(current->mm, address); if (pgd_none(*pg_dir)) goto done; pg_mid_dir = pmd_offset(pg_dir, address); if (pmd_none(*pg_mid_dir)) goto done; pg_table = pte_offset(pg_mid_dir, address); if (!pte_present(*pg_table)) goto done; ret_addr = pte_page(*pg_table); done: return ret_addr; } . . . Is simple PHYS_TO_VM_PAGE will do? --- * What about this one: . . . if (PageReserved(mem_map + GET_MAP_NR(page))) { ... } . . . And this one: . . . mem_map_reserve(GET_MAP_NR(page)); . . . --- * There seem to be these flags defined in linux/mm.h: /* 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? --- I will really appreciate any help with regard to this, since this is my first serious in-depth look at VM internals of both linux and FreeBSD, and there seem to be no technical (that is, not plain overviews) of both VM subsystems. -- Regs, Alexey To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message