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

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.L3.93.980729144614.1492B-100000>