Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jul 1998 20:13:36 +0100 (BST)
From:      Doug Rabson <dfr@nlsystems.com>
To:        zhihuizhang <bf20761@binghamton.edu>
Cc:        hackers <freebsd-hackers@FreeBSD.ORG>
Subject:   Re: Still confused with PTDpde/APTDpde
Message-ID:  <Pine.BSF.4.01.9807292010080.13755-100000@herring.nlsystems.com>
In-Reply-To: <Pine.SOL.L3.93.980729144614.1492B-100000@ultra6>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 29 Jul 1998, zhihuizhang wrote:

> > 
> > 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. 

Thats exactly right, as I understand things.

> > 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.

I think that you are correct about the definition of APTD being wrong.  If
the meaning of APTD is intended to be, 'the directory of the alternate
address space' then it should be defined in terms of PTDPTDI, not
APTDPTDI.

> 
> Thanks very much for your help.

You are welcome.  I have some of this fairly fresh after working on the
alpha pmap and I'm glad to help.

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 951 1891
					Fax:   +44 181 381 1039


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?Pine.BSF.4.01.9807292010080.13755-100000>