From owner-freebsd-hackers Wed Jul 29 12:04:59 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id MAA03731 for freebsd-hackers-outgoing; Wed, 29 Jul 1998 12:04:59 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from ultra6 (ultra6.cc.binghamton.edu [128.226.4.26]) by hub.freebsd.org (8.8.8/8.8.8) with SMTP id MAA03656 for ; Wed, 29 Jul 1998 12:04:49 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by ultra6 (SMI-8.6/8.6.9) with SMTP id PAA01509; Wed, 29 Jul 1998 15:04:06 -0400 Date: Wed, 29 Jul 1998 15:04:05 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@ultra6 To: Doug Rabson cc: hackers Subject: Re: Still confused with PTDpde/APTDpde 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 > > The address of xx is 30. If we declare xx in C as: > > pd_entry_t xx; > > then one can use xx to reference the pd_entry_t which is stored at address > 30. So the compiler treats .set directives as setting the addresses of absolute symbols. If I understand correctly, PTmap, PTD, PTDpde, APTmap, APTD, and APTDpde are all stored at fixed virtual addresses -- special VAs that are inaccessible to normal use. > > This confused me as well when I reviewed the i386 pmap before porting it > to alpha. When we access an alternate address space's page tables, we > install it in APTmap by setting APTDpde to the alternate's page directory. > Since the alternate address space has its own self referencial mapping at > directory index PTDPTDI, the page directory for it is available at > address APTD. > After hard thinking, I finally notice that APTDpde is set as .set _APTDpde,_PTD + (APTDPTDI * PDESIZE) NOT as .set _APTDpde,_APTD + (APTDPTDI * PDESIZE) So what you said above makes sense to me. Also, I find a possible bug in the same place (locore.s - Stable FreeBSD). Instead of .set _APTD,_APTmap + (APTDPTDI * PAGE_SIZE) we should say .set _APTD,_APTmap + (PTDPTDI * PAGE_SIZE) Fortunately, the symbol _APTD (in assembly) and the variable APTD (in C) are not in actual use. If I do not understand correctly, please let me know. Thanks very much for your help. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message