From: Fawad Lateef <fawadlateef@gmail.com>
To: Vivek Kutal <vivek.kutal@gmail.com>
Cc: Ingo Oeser <ioe-lkml@rameria.de>, linux-kernel@vger.kernel.org
Subject: Re: Need for SHIFT and MASK
Date: Mon, 10 Oct 2005 05:21:13 +0500 [thread overview]
Message-ID: <1e62d1370510091721m530327a9v546da9115a861bdf@mail.gmail.com> (raw)
In-Reply-To: <b9a245c10510091140q78c2480dqb095a7cdab12932e@mail.gmail.com>
On 10/9/05, Vivek Kutal <vivek.kutal@gmail.com> wrote:
>
> > This is usally table driven and someone has to set up
> > this "Page Translation Tables". That's a job of the Linux kernel.
>
> Yes setting up the page table entries is the job of the kernel , but
> for that we need to put the physical add. of the page and some bits
> (present,access writes etc) in the entry, once it is done the main job
> of translation which requires the masking and shifting is done by the
> processor whenever that page is referenced .
> so why these macros are present in the kernel?
>
>
The setting of the Page Translation Tables are done by the Kernel, and
processor actually do the traversing over those page table entries
(PGD, PMD, PTE) to get the physical address of the page and then add
the last 12-bits of virtual/linear address to get to the physical
address .....
And as far as SHIFT, MASK, SIZE macros are concerned they are used in
creating Page Translation Tables and also used to get the translation
from linear to physical, SIZE macro used to get the current PAGE_SIZE,
SHIFT can be used to get PFN etc in Kernel Code ....
(I might not able to explain, just b/c I think your question is not so
clear to me !!!). You better study the stuffs and search in the kernel
code for those SHIFT, MASK, SIZE macros and you will see where they
are needed and used !!!!!
--
Fawad Lateef
next prev parent reply other threads:[~2005-10-10 0:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-10-09 12:02 Vivek Kutal
2005-10-09 12:23 ` Ingo Oeser
2005-10-09 18:40 ` Vivek Kutal
2005-10-10 0:21 ` Fawad Lateef [this message]
2005-10-10 13:13 ` Vivek Kutal
2005-10-10 16:49 ` Fawad Lateef
2005-10-10 14:37 ` Denis Vlasenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1e62d1370510091721m530327a9v546da9115a861bdf@mail.gmail.com \
--to=fawadlateef@gmail.com \
--cc=ioe-lkml@rameria.de \
--cc=linux-kernel@vger.kernel.org \
--cc=vivek.kutal@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®