Chagas, Jason writes:
> That's right, 'pgd' is a pointer to the translation table (TB) and 'address'
> contains the virtual address being mapped. Shifting the virtual address
> [right] by 18 (the most significant 11 bits - 31-20) yield the address of
> first-level descriptor in the translation table with the first two least
> significant bits (1-0) set to zero. Oddly enough, the function below is
> shifts by 20. I just wondering if anyone could explain it to me...

It is correct.  sizeof(mm->pgd) = 4, so adding an integer to the pointer
actually does the equivalent of (int)(mm->pgd) + 4*(integer), which will
give you your 18 ( (a >> 20) * 4 == (a >> 18) with bottom two bits cleared)
   _____
  |_____| ------------------------------------------------- ---+---+-
  |   |        Russell King       [EMAIL PROTECTED]      --- ---
  | | | |  http://www.arm.linux.org.uk/~rmk/armlinux.html    /  /  |
  | +-+-+                                                     --- -+-
  /   |               THE developer of ARM Linux              |+| /|\
 /  | | |                                                     ---  |
    +-+-+ -------------------------------------------------  /\\\  |
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]

Reply via email to