Re: Need for SHIFT and MASK

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/9/05, Vivek Kutal <[email protected]> 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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux