From owner-freebsd-hackers Tue Oct 23 18: 2:14 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from 4evermail.com (equinox.4evermail.com [204.92.209.4]) by hub.freebsd.org (Postfix) with SMTP id 8E9B337B401 for ; Tue, 23 Oct 2001 18:02:11 -0700 (PDT) Received: (qmail 41331 invoked from network); 24 Oct 2001 01:02:43 -0000 Received: from 66-65-109-16.nyc.rr.com (HELO sioux) (66.65.109.16) by equinox.4evermail.com with SMTP; 24 Oct 2001 01:02:43 -0000 From: "Jonathan M. Slivko" To: "'XuYifeng'" , Subject: RE: A stupid question about pmap Date: Tue, 23 Oct 2001 21:02:21 -0400 Message-ID: <000101c15c27$89207450$6501a8c0@sioux> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 In-Reply-To: <001b01c15c27$2332db60$ef01a8c0@davidwnt> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG [forwarded to -hackers] --------------------------------------------------- Jonathan Slivko - 4EverMail.COM - www.4evermail.com Web Hosting - Web Desgin - UNIX Shell Accounts jslivko@4EverMail.com - Phone: (212) 663-1109 -----Original Message----- From: owner-freebsd-questions@FreeBSD.ORG [mailto:owner-freebsd-questions@FreeBSD.ORG] On Behalf Of XuYifeng Sent: Tuesday, October 23, 2001 9:00 PM To: freebsd-questions@freebsd.org Subject: A stupid question about pmap Hi, I am learning pmap code in FreeBSD 4.4-stable, and confused by some code, for example, in function get_ptbase, the code is: -------- static unsigned * get_ptbase(pmap) pmap_t pmap; { unsigned frame = (unsigned) pmap->pm_pdir[PTDPTDI] & PG_FRAME; /* are we current address space or kernel? */ if (pmap == kernel_pmap || frame == (((unsigned) PTDpde) & PG_FRAME)){ return (unsigned *) PTmap; } /* otherwise, we are alternate address space */ if (frame != (((unsigned) APTDpde) & PG_FRAME)) { APTDpde = (pd_entry_t) (frame | PG_RW | PG_V); #if defined(SMP) /* The page directory is not shared between CPUs */ cpu_invltlb(); #else invltlb(); #endif } return (unsigned *) APTmap; } ----- I know pm_pdir[PTDPTDI] contains page directory page's physical address, while PTDpde is a virtual address to access page directory's page directory entry which is recursivly mapped on virtual address space. question is why could (pmap->pm_pdir[PTDPTDI] & PG_FRAME) and (PTDpde & PG_FRAME) be same thing? a physical address = a virtual address? I am really confused by this. Any help will be appreciated, --- XuYifeng To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message